summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2009-05-29 08:06:46 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2009-05-29 08:06:46 +0000
commit3f33619b499214b245ffbc2d2fcf70f33c90fd6f (patch)
tree18b10d939b657d9458185630d13c534d121133b3 /eclass/cmake-utils.eclass
parentVersion bump to development version, bug #271091, thank Dennis Schridde for r... (diff)
downloadgentoo-2-3f33619b499214b245ffbc2d2fcf70f33c90fd6f.tar.gz
gentoo-2-3f33619b499214b245ffbc2d2fcf70f33c90fd6f.tar.bz2
gentoo-2-3f33619b499214b245ffbc2d2fcf70f33c90fd6f.zip
Remove not needed warning about non-existent push. Fix CMAKE_BUILD_DIR variable if insource build specified as local variable in some src_ function only.
Diffstat (limited to 'eclass/cmake-utils.eclass')
-rw-r--r--eclass/cmake-utils.eclass20
1 files changed, 11 insertions, 9 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 45aa43372f9d..b83e0c81bc2e 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.27 2009/05/27 14:34:33 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.28 2009/05/29 08:06:46 scarabeus Exp $
# @ECLASS: cmake-utils.eclass
# @MAINTAINER:
@@ -132,7 +132,9 @@ _check_build_dir() {
if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then
CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
else
- CMAKE_BUILD_DIR="${CMAKE_USE_DIR}_build"
+ [[ ${1} = init || -d ${CMAKE_USE_DIR}_build ]] && SUF="_build" || SUF=""
+ CMAKE_BUILD_DIR="${CMAKE_USE_DIR}${SUF}"
+
fi
echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
}
@@ -239,7 +241,7 @@ Install path: ${CMAKE_INSTALL_PREFIX}\n")' >> CMakeLists.txt
cmake-utils_src_configure() {
debug-print-function ${FUNCNAME} "$@"
- _check_build_dir
+ _check_build_dir init
# check if CMakeLists.txt exist and if no then die
if [[ ! -e "${CMAKE_USE_DIR}"/CMakeLists.txt ]] ; then
@@ -331,7 +333,7 @@ cmake-utils_src_make() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${CMAKE_BUILD_DIR}" &> /dev/null
# first check if Makefile exist otherwise die
[[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
if [[ -n ${CMAKE_VERBOSE} ]]; then
@@ -339,7 +341,7 @@ cmake-utils_src_make() {
else
emake "$@" || die "Make failed!"
fi
- popd > /dev/null
+ popd &> /dev/null
}
# @FUNCTION: cmake-utils_src_install
@@ -349,9 +351,9 @@ cmake-utils_src_install() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${CMAKE_BUILD_DIR}" &> /dev/null
emake install DESTDIR="${D}" || die "Make install failed"
- popd > /dev/null
+ popd &> /dev/null
# Manual document installation
[[ -n "${DOCS}" ]] && { dodoc ${DOCS} || die "dodoc failed" ; }
@@ -365,7 +367,7 @@ cmake-utils_src_test() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${CMAKE_BUILD_DIR}" &> /dev/null
# Standard implementation of src_test
if emake -j1 check -n &> /dev/null; then
einfo ">>> Test phase [check]: ${CATEGORY}/${PF}"
@@ -380,5 +382,5 @@ cmake-utils_src_test() {
else
einfo ">>> Test phase [none]: ${CATEGORY}/${PF}"
fi
- popd > /dev/null
+ popd &> /dev/null
}