1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 # @BLURB: Support eclass for KDE 5-related packages.
9 # The kde5.eclass provides support for building KDE 5-related packages.
11 if [[ -z ${_KDE5_ECLASS} ]]; then
14 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
16 # For proper description see virtualx.eclass manpage.
17 # Here we redefine default value to be manual, if your package needs virtualx
18 # for tests you should proceed with setting VIRTUALX_REQUIRED=test.
19 : ${VIRTUALX_REQUIRED:=manual}
21 inherit cmake-utils eutils flag-o-matic gnome2-utils kde5-functions versionator virtualx xdg
23 if [[ ${KDE_BUILD_TYPE} = live ]]; then
25 git) inherit git-r3 ;;
29 if [[ -v KDE_GCC_MINIMAL ]]; then
30 EXPORT_FUNCTIONS pkg_pretend
33 EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
35 # @ECLASS-VARIABLE: KDE_AUTODEPS
37 # If set to "false", do nothing.
38 # For any other value, add a dependency on dev-qt/qtcore:5 and kde-frameworks/extra-cmake-modules:5.
39 : ${KDE_AUTODEPS:=true}
41 # @ECLASS-VARIABLE: KDE_BLOCK_SLOT4
43 # This variable is used when KDE_AUTODEPS is set.
44 # If set to "true", add RDEPEND block on kde-apps/${PN}:4
45 : ${KDE_BLOCK_SLOT4:=true}
47 # @ECLASS-VARIABLE: KDE_DEBUG
49 # If set to "false", unconditionally build with -DNDEBUG.
50 # Otherwise, add debug to IUSE to control building with that flag.
53 # @ECLASS-VARIABLE: KDE_DESIGNERPLUGIN
55 # If set to "false", do nothing.
56 # Otherwise, add "designer" to IUSE to toggle build of designer plugins
57 # and add the necessary DEPENDs.
58 : ${KDE_DESIGNERPLUGIN:=false}
60 # @ECLASS-VARIABLE: KDE_EXAMPLES
62 # If set to "false", unconditionally ignore a top-level examples subdirectory.
63 # Otherwise, add "examples" to IUSE to toggle adding that subdirectory.
64 : ${KDE_EXAMPLES:=false}
66 # @ECLASS-VARIABLE: KDE_HANDBOOK
68 # If set to "false", do nothing.
69 # Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and
70 # generate and install KDE handbook.
71 # If set to "optional", config with -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON
72 # when USE=!handbook. In case package requires KF5KDELibs4Support, see next:
73 # If set to "forceoptional", remove a KF5DocTools dependency from the root
74 # CMakeLists.txt in addition to the above.
75 : ${KDE_HANDBOOK:=false}
77 # @ECLASS-VARIABLE: KDE_DOC_DIR
79 # Defaults to "doc". Otherwise, use alternative KDE handbook path.
82 # @ECLASS-VARIABLE: KDE_TEST
84 # If set to "false", do nothing.
85 # For any other value, add test to IUSE and add a dependency on dev-qt/qttest:5.
86 # If set to "optional", configure with -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON
88 # If set to "forceoptional", remove a Qt5Test dependency and comment test
89 # subdirs from the root CMakeLists.txt in addition to the above.
90 # If set to "forceoptional-recursive", remove a Qt5Test dependency and comment
91 # test subdirs from *any* CMakeLists.txt in addition to the above.
92 if [[ ${CATEGORY} = kde-frameworks ]]; then
98 # @ECLASS-VARIABLE: KDE_L10N
100 # This is an array of translations this ebuild supports. These translations
101 # are automatically added to IUSE.
102 if [[ ${KDEBASE} = kdel10n ]]; then
103 if [[ -n ${KDE_L10N} ]]; then
104 IUSE="${IUSE} $(printf 'l10n_%s ' ${KDE_L10N[@]})"
108 # @ECLASS-VARIABLE: KDE_SELINUX_MODULE
110 # If set to "none", do nothing.
111 # For any other value, add selinux to IUSE, and depending on that useflag
112 # add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND.
113 : ${KDE_SELINUX_MODULE:=none}
115 # @ECLASS-VARIABLE: KDE_SUBSLOT
117 # If set to "false", do nothing.
118 # If set to "true", add a subslot to the package, where subslot is either
119 # defined as major.minor version for kde-*/ categories or ${PV} if other.
120 # For any other value, that value will be used as subslot.
121 : ${KDE_SUBSLOT:=false}
123 # @ECLASS-VARIABLE: KDE_UNRELEASED
126 # An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
127 # Any package matching this will have fetch restriction enabled, and receive
128 # a proper error message via pkg_nofetch.
131 if [[ ${KDEBASE} = kdevelop ]]; then
132 HOMEPAGE="https://www.kdevelop.org/"
133 elif [[ ${KDEBASE} = kdel10n ]]; then
134 HOMEPAGE="http://l10n.kde.org"
135 elif [[ ${KMNAME} = kdepim ]]; then
136 HOMEPAGE="https://www.kde.org/applications/office/kontact/"
138 HOMEPAGE="https://www.kde.org/"
145 if [[ ${CATEGORY} = kde-frameworks ]]; then
149 case ${KDE_SUBSLOT} in
156 SLOT+="/$(get_version_component_range 1-2)"
164 SLOT+="/${KDE_SUBSLOT}"
168 case ${KDE_AUTODEPS} in
171 DEPEND+=" $(add_frameworks_dep extra-cmake-modules)"
172 RDEPEND+=" >=kde-frameworks/kf-env-4"
173 COMMONDEPEND+=" $(add_qt_dep qtcore)"
175 if [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma && ${PN} != polkit-kde-agent ]]; then
176 RDEPEND+=" !<kde-apps/kde4-l10n-15.12.3-r1"
179 if [[ ${KDE_BLOCK_SLOT4} = true && ${CATEGORY} = kde-apps ]]; then
180 RDEPEND+=" !kde-apps/${PN}:4"
192 case ${KDE_DESIGNERPLUGIN} in
196 DEPEND+=" designer? (
197 $(add_frameworks_dep kdesignerplugin)
198 $(add_qt_dep designer)
203 case ${KDE_EXAMPLES} in
210 case ${KDE_HANDBOOK} in
214 DEPEND+=" handbook? ( $(add_frameworks_dep kdoctools) )"
222 DEPEND+=" test? ( $(add_qt_dep qttest) )"
226 case ${KDE_SELINUX_MODULE} in
230 RDEPEND+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
234 DEPEND+=" ${COMMONDEPEND} dev-util/desktop-file-utils"
235 RDEPEND+=" ${COMMONDEPEND}"
238 if [[ -n ${KMNAME} && ${KMNAME} != ${PN} && ${KDE_BUILD_TYPE} = release ]]; then
239 S=${WORKDIR}/${KMNAME}-${PV}
242 if [[ -n ${KDEBASE} && ${KDEBASE} = kdevelop && ${KDE_BUILD_TYPE} = release ]]; then
243 if [[ -n ${KMNAME} ]]; then
244 S=${WORKDIR}/${KMNAME}-${PV}
250 _kde_is_unreleased() {
252 for pair in "${KDE_UNRELEASED[@]}" ; do
253 if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then
261 # Determine fetch location for released tarballs
262 _calculate_src_uri() {
263 debug-print-function ${FUNCNAME} "$@"
267 if [[ -n ${KMNAME} ]]; then
280 _kmname="portingAids/${_kmname}"
284 DEPEND+=" app-arch/xz-utils"
289 ??.?.[6-9]? | ??.??.[6-9]? )
290 SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
294 SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
298 SRC_URI="mirror://kde/stable/frameworks/${PV%.*}/${_kmname}-${PV}.tar.xz" ;;
300 local plasmapv=$(get_version_component_range 1-3)
304 # Plasma 5 beta releases
305 SRC_URI="mirror://kde/unstable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz"
309 # Plasma 5 stable releases
310 SRC_URI="mirror://kde/stable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz" ;;
315 if [[ -z ${SRC_URI} && -n ${KDEBASE} ]] ; then
321 _kdebase=${KDEBASE} ;;
325 SRC_URI="mirror://kde/unstable/${_kdebase}/${PV}/src/${_kmname}-${PV}.tar.xz"
329 SRC_URI="mirror://kde/stable/${_kdebase}/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
334 if [[ ${KDEBASE} = kdel10n ]] ; then
335 local uri_base="${SRC_URI/${_kmname}-${PV}.tar.xz/}kde-l10n/kde-l10n"
337 for my_l10n in ${KDE_L10N[@]} ; do
339 sr | sr-ijekavsk | sr-Latn-ijekavsk | sr-Latn)
340 SRC_URI="${SRC_URI} l10n_${my_l10n}? ( ${uri_base}-sr-${PV}.tar.xz )"
343 SRC_URI="${SRC_URI} l10n_${my_l10n}? ( ${uri_base}-$(kde_l10n2lingua ${my_l10n})-${PV}.tar.xz )"
349 if _kde_is_unreleased ; then
354 # Determine fetch location for live sources
355 _calculate_live_repo() {
356 debug-print-function ${FUNCNAME} "$@"
362 # @ECLASS-VARIABLE: EGIT_MIRROR
364 # This variable allows easy overriding of default kde mirror service
365 # (anongit) with anything else you might want to use.
366 EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
370 # @ECLASS-VARIABLE: EGIT_REPONAME
372 # This variable allows overriding of default repository
373 # name. Specify only if this differ from PN and KMNAME.
374 if [[ -n ${EGIT_REPONAME} ]]; then
375 # the repository and kmname different
376 _kmname=${EGIT_REPONAME}
377 elif [[ -n ${KMNAME} ]]; then
383 if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
384 EGIT_BRANCH="Applications/$(get_version_component_range 1-2)"
387 if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
388 EGIT_BRANCH="Plasma/$(get_version_component_range 1-2)"
391 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
396 case ${KDE_BUILD_TYPE} in
397 live) _calculate_live_repo ;;
398 *) _calculate_src_uri ;;
401 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
403 # @FUNCTION: kde5_pkg_pretend
405 # Do some basic settings
407 debug-print-function ${FUNCNAME} "$@"
411 # @FUNCTION: kde5_pkg_setup
413 # Do some basic settings
415 debug-print-function ${FUNCNAME} "$@"
419 # @FUNCTION: kde5_pkg_nofetch
421 # Display package publication status
423 if ! _kde_is_unreleased ; then
427 eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ "
428 eerror "| | | | \ | | _ \| ____| | | ____| / \ / ___|| ____| _ \ "
429 eerror "| | | | \| | |_) | _| | | | _| / _ \ \___ \| _| | | | |"
430 eerror "| |_| | |\ | _ <| |___| |___| |___ / ___ \ ___) | |___| |_| |"
431 eerror " \___/|_| \_|_| \_\_____|_____|_____/_/ \_\____/|_____|____/ "
433 eerror " ____ _ ____ _ __ _ ____ _____ "
434 eerror "| _ \ / \ / ___| |/ / / \ / ___| ____|"
435 eerror "| |_) / _ \| | | ' / / _ \| | _| _| "
436 eerror "| __/ ___ \ |___| . \ / ___ \ |_| | |___ "
437 eerror "|_| /_/ \_\____|_|\_\/_/ \_\____|_____|"
439 eerror "${CATEGORY}/${P} has not been released to the public yet"
440 eerror "and is only available to packagers right now."
442 eerror "This is not a bug. Please do not file bugs or contact upstream about this."
444 eerror "Please consult the upstream release schedule to see when this "
445 eerror "package is scheduled to be released:"
446 eerror "https://community.kde.org/Schedules"
449 # @FUNCTION: kde5_src_unpack
451 # Function for unpacking KDE 5.
453 debug-print-function ${FUNCNAME} "$@"
455 if [[ ${KDE_BUILD_TYPE} = live ]]; then
461 elif [[ ${KDEBASE} = kdel10n ]]; then
463 [[ ${PN} = kde4-l10n ]] && l10npart=4
464 mkdir -p "${S}" || die "Failed to create source dir ${S}"
466 for my_tar in ${A}; do
467 tar -xpf "${DISTDIR}/${my_tar}" --xz \
468 "${my_tar/.tar.xz/}/CMakeLists.txt" "${my_tar/.tar.xz/}/${l10npart}" 2> /dev/null ||
469 elog "${my_tar}: tar extract command failed at least partially - continuing"
476 # @FUNCTION: kde5_src_prepare
478 # Function for preparing the KDE 5 sources.
480 debug-print-function ${FUNCNAME} "$@"
482 if [[ ${KDEBASE} = kdel10n ]]; then
484 [[ ${PN} = kde4-l10n ]] && l10npart=4
485 # move known variant subdirs to root dir, currently sr@*
486 use_if_iuse l10n_sr-ijekavsk && _l10n_variant_subdir2root sr-ijekavsk sr
487 use_if_iuse l10n_sr-Latn-ijekavsk && _l10n_variant_subdir2root sr-Latn-ijekavsk sr
488 use_if_iuse l10n_sr-Latn && _l10n_variant_subdir2root sr-Latn sr
489 if use_if_iuse l10n_sr; then
490 rm -rf kde-l10n-sr-${PV}/${l10npart}/sr/sr@* || die "Failed to cleanup L10N=sr"
491 _l10n_variant_subdir_buster sr
492 elif [[ -d kde-l10n-sr-${PV} ]]; then
493 # having any variant selected means parent lingua will be unpacked as well
494 rm -r kde-l10n-sr-${PV} || die "Failed to remove sr parent lingua"
497 cat <<-EOF > CMakeLists.txt || die
499 cmake_minimum_required(VERSION 2.8.12)
501 # add all l10n directories to cmake
502 if [[ -n ${A} ]]; then
503 cat <<-EOF >> CMakeLists.txt || die
504 $(printf "add_subdirectory( %s )\n" \
505 `find . -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"`)
509 # for KF5: drop KDE4-based part; for KDE4: drop KF5-based part
511 5) find -maxdepth 2 -type f -name CMakeLists.txt -exec \
512 sed -i -e "/add_subdirectory(4)/ s/^/#DONT/" {} + || die ;;
513 4) find -maxdepth 2 -type f -name CMakeLists.txt -exec \
514 sed -i -e "/add_subdirectory(5)/ s/^/#DONT/" {} + || die ;;
518 cmake-utils_src_prepare
520 # only build examples when required
521 if ! use_if_iuse examples || ! use examples ; then
522 cmake_comment_add_subdirectory examples
525 # only enable handbook when required
526 if ! use_if_iuse handbook ; then
527 cmake_comment_add_subdirectory ${KDE_DOC_DIR}
529 if [[ ${KDE_HANDBOOK} = forceoptional ]] ; then
530 punt_bogus_dep KF5 DocTools
534 # drop translations when nls is not wanted
535 if [[ -d po ]] && in_iuse nls && ! use nls ; then
539 # enable only the requested translations
541 if [[ -d po && -v LINGUAS ]] ; then
542 pushd po > /dev/null || die
545 if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
547 if [[ -e CMakeLists.txt ]] ; then
548 cmake_comment_add_subdirectory ${lang}
550 elif [[ -f ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
551 if [[ ${lang} != CMakeLists.txt && ${lang} != ${PN}.pot ]] ; then
556 popd > /dev/null || die
559 if [[ ${KDE_BUILD_TYPE} = release && ${CATEGORY} != kde-apps ]] ; then
560 if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && -v LINGUAS ]] ; then
561 pushd ${KDE_DOC_DIR} > /dev/null || die
564 if ! has ${lang} ${LINGUAS} ; then
565 cmake_comment_add_subdirectory ${lang}
568 popd > /dev/null || die
572 # in frameworks, tests = manual tests so never build them
573 if [[ ${CATEGORY} = kde-frameworks ]] && [[ ${PN} != extra-cmake-modules ]]; then
574 cmake_comment_add_subdirectory tests
577 # only build unit tests when required
578 if ! use_if_iuse test ; then
579 if [[ ${KDE_TEST} = forceoptional ]] ; then
580 punt_bogus_dep Qt5 Test
581 # if forceoptional, also cover non-kde categories
582 cmake_comment_add_subdirectory autotests test tests
583 elif [[ ${KDE_TEST} = forceoptional-recursive ]] ; then
584 punt_bogus_dep Qt5 Test
586 for d in $(find . -type d -name "autotests" -or -name "tests" -or -name "test" -or -name "unittests"); do
587 pushd ${d%/*} > /dev/null || die
588 punt_bogus_dep Qt5 Test
589 cmake_comment_add_subdirectory autotests test tests
590 popd > /dev/null || die
592 elif [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
593 cmake_comment_add_subdirectory autotests test tests
598 # @FUNCTION: kde5_src_configure
600 # Function for configuring the build of KDE 5.
601 kde5_src_configure() {
602 debug-print-function ${FUNCNAME} "$@"
604 # we rely on cmake-utils.eclass to append -DNDEBUG too
605 if ! use_if_iuse debug; then
606 append-cppflags -DQT_NO_DEBUG
611 if ! use_if_iuse test ; then
612 cmakeargs+=( -DBUILD_TESTING=OFF )
614 if [[ ${KDE_TEST} = optional ]] ; then
615 cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON )
619 if ! use_if_iuse handbook && [[ ${KDE_HANDBOOK} = optional ]] ; then
620 cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON )
623 if ! use_if_iuse designer && [[ ${KDE_DESIGNERPLUGIN} != false ]] ; then
624 cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Designer=ON )
627 # install mkspecs in the same directory as qt stuff
628 cmakeargs+=(-DKDE_INSTALL_USE_QT_SYS_PATHS=ON)
630 # allow the ebuild to override what we set here
631 mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
633 cmake-utils_src_configure
636 # @FUNCTION: kde5_src_compile
638 # Function for compiling KDE 5.
640 debug-print-function ${FUNCNAME} "$@"
642 cmake-utils_src_compile "$@"
645 # @FUNCTION: kde5_src_test
647 # Function for testing KDE 5.
649 debug-print-function ${FUNCNAME} "$@"
652 if [[ -n "${VIRTUALDBUS_TEST}" ]]; then
653 export $(dbus-launch)
659 # When run as normal user during ebuild development with the ebuild command, the
660 # kde tests tend to access the session DBUS. This however is not possible in a real
661 # emerge or on the tinderbox.
662 # > make sure it does not happen, so bad tests can be recognized and disabled
663 unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
665 if [[ ${VIRTUALX_REQUIRED} = always || ${VIRTUALX_REQUIRED} = test ]]; then
671 if [[ -n "${DBUS_SESSION_BUS_PID}" ]] ; then
672 kill ${DBUS_SESSION_BUS_PID}
676 # @FUNCTION: kde5_src_install
678 # Function for installing KDE 5.
680 debug-print-function ${FUNCNAME} "$@"
682 cmake-utils_src_install
684 # We don't want ${PREFIX}/share/doc/HTML to be compressed,
685 # because then khelpcenter can't find the docs
686 if [[ -d ${ED}/${PREFIX}/share/doc/HTML ]]; then
687 docompress -x ${PREFIX}/share/doc/HTML
691 # @FUNCTION: kde5_pkg_preinst
693 # Function storing icon caches
695 debug-print-function ${FUNCNAME} "$@"
701 # @FUNCTION: kde5_pkg_postinst
703 # Function to rebuild the KDE System Configuration Cache after an application has been installed.
704 kde5_pkg_postinst() {
705 debug-print-function ${FUNCNAME} "$@"
707 gnome2_icon_cache_update
710 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
711 if [[ ${KDE_BUILD_TYPE} = live ]]; then
713 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
714 einfo "Use it at your own risk."
715 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
717 # for kf5-based applications tell user that he SHOULD NOT be using kde-plasma/plasma-workspace:4
718 if [[ ${KDEBASE} != kde-base || ${CATEGORY} = kde-apps ]] && \
719 has_version 'kde-plasma/plasma-workspace:4'; then
721 ewarn "WARNING! Your system configuration still contains \"kde-plasma/plasma-workspace:4\","
722 ewarn "indicating a Plasma 4 setup. With this setting you are unsupported by KDE team."
723 ewarn "Please consider upgrading to Plasma 5."
728 # @FUNCTION: kde5_pkg_postrm
730 # Function to rebuild the KDE System Configuration Cache after an application has been removed.
732 debug-print-function ${FUNCNAME} "$@"
734 gnome2_icon_cache_update
738 _l10n_variant_subdir2root() {
740 [[ ${PN} = kde4-l10n ]] && l10npart=4
741 local lingua=$(kde_l10n2lingua ${1})
742 local src=kde-l10n-${2}-${PV}
743 local dest=kde-l10n-${lingua}-${PV}/${l10npart}
745 # create variant rootdir structure from parent lingua and adapt it
746 mkdir -p ${dest} || die "Failed to create ${dest}"
747 mv ${src}/${l10npart}/${2}/${lingua} ${dest}/${lingua} || die "Failed to create ${dest}/${lingua}"
748 cp -f ${src}/CMakeLists.txt kde-l10n-${lingua}-${PV} || die "Failed to prepare L10N=${1} subdir"
749 echo "add_subdirectory(${lingua})" > ${dest}/CMakeLists.txt ||
750 die "Failed to prepare ${dest}/CMakeLists.txt"
751 cp -f ${src}/${l10npart}/${2}/CMakeLists.txt ${dest}/${lingua} ||
752 die "Failed to create ${dest}/${lingua}/CMakeLists.txt"
753 sed -e "s/${2}/${lingua}/" -i ${dest}/${lingua}/CMakeLists.txt ||
754 die "Failed to prepare ${dest}/${lingua}/CMakeLists.txt"
756 _l10n_variant_subdir_buster ${1}
759 _l10n_variant_subdir_buster() {
761 [[ ${PN} = kde4-l10n ]] && l10npart=4
762 local dir=kde-l10n-$(kde_l10n2lingua ${1})-${PV}/${l10npart}/$(kde_l10n2lingua ${1})
765 5) sed -e "/^add_subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;;
766 4) sed -e "/^macro.*subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;;
769 for subdir in $(find ${dir} -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"); do
770 if [[ ${subdir##*/} != "cmake_modules" ]] ; then
771 echo "add_subdirectory(${subdir##*/})" >> ${dir}/CMakeLists.txt || die