Skip to content

Commit

Permalink
ecm.eclass: Introduce _ecm_handbook_optional() to support BUILD_DOC
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Sturmlechner <[email protected]>
  • Loading branch information
a17r committed Dec 17, 2024
1 parent 228669d commit 0673c26
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion eclass/ecm.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,18 @@ ecm_src_prepare() {
fi
}

# @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_src_configure
# @DESCRIPTION:
# Wrapper for cmake_src_configure with extra logic for magic handling of
Expand All @@ -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
Expand Down

0 comments on commit 0673c26

Please sign in to comment.