| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2010 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.60 2010/10/13 16:40:34 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.61 2010/12/16 14:36:55 scarabeus Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: cmake-utils.eclass |
5 | # @ECLASS: cmake-utils.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # kde@gentoo.org |
7 | # kde@gentoo.org |
| 8 | # |
8 | # |
| … | |
… | |
| 135 | # @ECLASS-VARIABLE: PREFIX |
135 | # @ECLASS-VARIABLE: PREFIX |
| 136 | # @DESCRIPTION: |
136 | # @DESCRIPTION: |
| 137 | # Eclass respects PREFIX variable, though it's not recommended way to set |
137 | # Eclass respects PREFIX variable, though it's not recommended way to set |
| 138 | # install/lib/bin prefixes. |
138 | # install/lib/bin prefixes. |
| 139 | # Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead. |
139 | # Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead. |
|
|
140 | |
|
|
141 | # @ECLASS-VARIABLE: CMAKE_BINARY |
|
|
142 | # @DESCRIPTION: |
|
|
143 | # Eclass can use different cmake binary than the one provided in by system. |
|
|
144 | : ${CMAKE_BINARY:=cmake} |
| 140 | |
145 | |
| 141 | # Determine using IN or OUT source build |
146 | # Determine using IN or OUT source build |
| 142 | _check_build_dir() { |
147 | _check_build_dir() { |
| 143 | : ${CMAKE_USE_DIR:=${S}} |
148 | : ${CMAKE_USE_DIR:=${S}} |
| 144 | if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then |
149 | if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then |
| … | |
… | |
| 342 | ) |
347 | ) |
| 343 | |
348 | |
| 344 | mkdir -p "${CMAKE_BUILD_DIR}" |
349 | mkdir -p "${CMAKE_BUILD_DIR}" |
| 345 | pushd "${CMAKE_BUILD_DIR}" > /dev/null |
350 | pushd "${CMAKE_BUILD_DIR}" > /dev/null |
| 346 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" |
351 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" |
| 347 | echo cmake "${cmakeargs[@]}" "${CMAKE_USE_DIR}" |
352 | echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" |
| 348 | cmake "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" |
353 | "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" |
| 349 | popd > /dev/null |
354 | popd > /dev/null |
| 350 | } |
355 | } |
| 351 | |
356 | |
| 352 | enable_cmake-utils_src_compile() { |
357 | enable_cmake-utils_src_compile() { |
| 353 | debug-print-function ${FUNCNAME} "$@" |
358 | debug-print-function ${FUNCNAME} "$@" |