diff options
author | Michael Palimaka <kensington@gentoo.org> | 2014-10-15 13:44:24 +0000 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2014-10-15 13:44:24 +0000 |
commit | 553bbac3f118fbb0ca92e7714405a6e930014f7d (patch) | |
tree | 7dc1c420c733397200022802211b109194b9505e | |
parent | version bumped 31.x ESR (restoring a 31.x version to the tree, bug 525486), s... (diff) | |
download | historical-553bbac3f118fbb0ca92e7714405a6e930014f7d.tar.gz historical-553bbac3f118fbb0ca92e7714405a6e930014f7d.tar.bz2 historical-553bbac3f118fbb0ca92e7714405a6e930014f7d.zip |
Introduce comment_add_subdirectory function. Make EAPI check more technically correct.
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/cmake-utils.eclass | 21 |
2 files changed, 23 insertions, 4 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 0a6c56bf5d86..4c8fa219effc 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1384 2014/10/15 12:48:57 kensington Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1385 2014/10/15 13:44:24 kensington Exp $ + + 15 Oct 2014; Michael Palimaka <kensington@gentoo.org> cmake-utils.eclass: + Introduce comment_add_subdirectory function. Make EAPI check more technically + correct. 15 Oct 2014; Michael Palimaka <kensington@gentoo.org> +kde5-functions.eclass, +kde5.eclass: diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index ec40d3b12466..0dfcbd453b44 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.110 2014/08/12 14:58:40 kensington Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.111 2014/10/15 13:44:24 kensington Exp $ # @ECLASS: cmake-utils.eclass # @MAINTAINER: @@ -118,9 +118,9 @@ case ${WANT_CMAKE} in esac inherit toolchain-funcs multilib flag-o-matic eutils -case ${EAPI:-0} in +case ${EAPI} in 2|3|4|5) : ;; - *) die "EAPI=${EAPI} is not supported" ;; + *) die "EAPI=${EAPI:-0} is not supported" ;; esac CMAKE_EXPF="src_prepare src_configure src_compile src_test src_install" @@ -238,6 +238,21 @@ _generator_to_use() { echo ${generator_name} } +# @FUNCTION: comment_add_subdirectory +# @USAGE: <subdirectory> +# @DESCRIPTION: +# Comment out an add_subdirectory call in CMakeLists.txt in the current directory +comment_add_subdirectory() { + if [[ -z ${1} ]]; then + die "comment_add_subdirectory must be passed the directory name to comment" + fi + + if [[ -e "CMakeLists.txt" ]]; then + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${1//\//\\/}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ + -i CMakeLists.txt || die "failed to comment add_subdirectory(${1})" + fi +} + # @FUNCTION: cmake-utils_use_with # @USAGE: <USE flag> [flag name] # @DESCRIPTION: |