summaryrefslogtreecommitdiff
path: root/eclass/cmake-utils.eclass
diff options
context:
space:
mode:
authorabcd <abcd@gentoo.org>2009-12-04 21:46:01 -0500
committerabcd <abcd@gentoo.org>2009-12-05 12:56:14 -0500
commit0bc54a89408d18cc899ea33f54c10b6f8def42cf (patch)
tree4cea3b40b292cb3a08a47d506bbf693aba78defc /eclass/cmake-utils.eclass
parentad7f4d140520f0f6d97971ed1160a70088bb5af9 (diff)
downloadkde-0bc54a89408d18cc899ea33f54c10b6f8def42cf.tar.gz
kde-0bc54a89408d18cc899ea33f54c10b6f8def42cf.tar.bz2
kde-0bc54a89408d18cc899ea33f54c10b6f8def42cf.zip
[eclass] Use arrays in cmake-utils.eclass; convert kde4-{base,meta}
Diffstat (limited to 'eclass/cmake-utils.eclass')
-rw-r--r--eclass/cmake-utils.eclass34
1 files changed, 20 insertions, 14 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 1c03ff75819..4d87b85acb2 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -293,16 +293,6 @@ SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FO
SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
_EOF_
- # Common configure parameters (overridable)
- # NOTE CMAKE_BUILD_TYPE can be only overriden via CMAKE_BUILD_TYPE eclass variable
- # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect.
- local cmakeargs="
- -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr}
- ${mycmakeargs}
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_DO_STRIP=OFF
- -DCMAKE_USER_MAKE_RULES_OVERRIDE=${build_rules}"
-
# Common configure parameters (invariants)
local common_config="${TMPDIR}"/gentoo_common_config.cmake
local libdir=$(get_libdir)
@@ -310,13 +300,29 @@ cat > ${common_config} << _EOF_
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
_EOF_
[[ -n ${CMAKE_NO_COLOR} ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> ${common_config}
- cmakeargs="-C ${common_config} ${cmakeargs}"
+
+ # Convert mycmakeargs to an array, for backwards compatibility
+ if [[ $(declare -p mycmakeargs) != "declare -a mycmakeargs="* ]]; then
+ mycmakeargs=(${mycmakeargs})
+ fi
+
+ # Common configure parameters (overridable)
+ # NOTE CMAKE_BUILD_TYPE can be only overriden via CMAKE_BUILD_TYPE eclass variable
+ # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect.
+ local cmakeargs=(
+ -C "${common_config}"
+ -DCMAKE_INSTALL_PREFIX="${PREFIX:-/usr}"
+ "${mycmakeargs[@]}"
+ -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
+ -DCMAKE_INSTALL_DO_STRIP=OFF
+ -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
+ )
mkdir -p "${CMAKE_BUILD_DIR}"
pushd "${CMAKE_BUILD_DIR}" > /dev/null
- debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is $cmakeargs"
- echo cmake ${cmakeargs} "${CMAKE_USE_DIR}"
- cmake ${cmakeargs} "${CMAKE_USE_DIR}" || die "cmake failed"
+ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${cmakeargs[*]}"
+ echo cmake "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
+ cmake "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
popd > /dev/null
}