| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 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.10 2008/09/28 18:52:16 jmbsvicetto Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.11 2008/10/27 05:06:41 vapier 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 | # @BLURB: common ebuild functions for cmake-based packages |
8 | # @BLURB: common ebuild functions for cmake-based packages |
| … | |
… | |
| 83 | # General function for configuring with cmake. Default behaviour is to start an |
83 | # General function for configuring with cmake. Default behaviour is to start an |
| 84 | # out-of-source build. |
84 | # out-of-source build. |
| 85 | cmake-utils_src_configure() { |
85 | cmake-utils_src_configure() { |
| 86 | debug-print-function $FUNCNAME $* |
86 | debug-print-function $FUNCNAME $* |
| 87 | |
87 | |
|
|
88 | if has debug ${IUSE//+} && use debug ; then |
|
|
89 | append-cppflags -DNDEBUG |
|
|
90 | fi |
|
|
91 | |
| 88 | if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then |
92 | if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then |
| 89 | cmake-utils_src_configurein |
93 | cmake-utils_src_configurein |
| 90 | else |
94 | else |
| 91 | cmake-utils_src_configureout |
95 | cmake-utils_src_configureout |
| 92 | fi |
96 | fi |
| … | |
… | |
| 139 | } |
143 | } |
| 140 | |
144 | |
| 141 | # Internal use only. Common configuration options for all types of builds. |
145 | # Internal use only. Common configuration options for all types of builds. |
| 142 | _common_configure_code() { |
146 | _common_configure_code() { |
| 143 | local tmp_libdir=$(get_libdir) |
147 | local tmp_libdir=$(get_libdir) |
| 144 | if has debug ${IUSE//+} && use debug; then |
148 | # CMAKE_BUILD_TYPE only modifies compiler flags, so set to None |
| 145 | echo -DCMAKE_BUILD_TYPE=Debug |
149 | echo -DCMAKE_BUILD_TYPE=None |
| 146 | else |
|
|
| 147 | echo -DCMAKE_BUILD_TYPE=Release |
|
|
| 148 | fi |
|
|
| 149 | echo -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) |
150 | echo -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) |
| 150 | echo -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) |
151 | echo -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) |
| 151 | echo -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr} |
152 | echo -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr} |
| 152 | echo -DLIB_SUFFIX=${tmp_libdir/lib} |
153 | echo -DLIB_SUFFIX=${tmp_libdir/lib} |
| 153 | echo -DLIB_INSTALL_DIR=${PREFIX:-/usr}/${tmp_libdir} |
154 | echo -DLIB_INSTALL_DIR=${PREFIX:-/usr}/${tmp_libdir} |