summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2024-12-17 23:46:31 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2025-02-09 20:12:12 +0100
commita5c363d516d91502cc766e0f4c914944c2498882 (patch)
tree1722680274d538053a89a4d20ecb64e822491c51 /eclass
parentecm.eclass: Replace KDE_GCC_MINIMAL logic with tc-check-min_ver (diff)
downloadgentoo-a5c363d516d91502cc766e0f4c914944c2498882.tar.gz
gentoo-a5c363d516d91502cc766e0f4c914944c2498882.tar.bz2
gentoo-a5c363d516d91502cc766e0f4c914944c2498882.zip
ecm.eclass: Introduce _ecm_handbook_optional() to support BUILD_DOC
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ecm.eclass16
1 files changed, 14 insertions, 2 deletions
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass
index 876039705288..826a32a17d08 100644
--- a/eclass/ecm.eclass
+++ b/eclass/ecm.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ecm.eclass
@@ -334,6 +334,18 @@ DEPEND+=" ${COMMONDEPEND}"
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
+# @FUNCTION: _ecm_handbook_optional
+# @DESCRIPTION:
+# Use with ECM_HANDBOOK=optional; ticks either -DBUILD_DOC if available,
+# or -DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools
+_ecm_handbook_optional() {
+ if grep -Eq "option.*BUILD_DOC" CMakeLists.txt; then
+ echo "-DBUILD_DOC=$(usex handbook)"
+ else
+ echo "-DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools=$(usex !handbook)"
+ fi
+}
+
# @FUNCTION: _ecm_strip_handbook_translations
# @INTERNAL
# @DESCRIPTION:
@@ -621,7 +633,7 @@ ecm_src_configure() {
fi
if [[ ${ECM_HANDBOOK} = optional ]] ; then
- cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools=$(usex !handbook) )
+ cmakeargs+=( $(_ecm_handbook_optional) )
fi
if in_iuse designer && [[ ${ECM_DESIGNERPLUGIN} = true ]]; then