/[gentoo-x86]/eclass/cmake-utils.eclass
Gentoo

Diff of /eclass/cmake-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.9 Revision 1.13
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.9 2008/09/28 16:19:06 jmbsvicetto Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.13 2008/10/27 14:38:38 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
19 19
20DESCRIPTION="Based on the ${ECLASS} eclass" 20DESCRIPTION="Based on the ${ECLASS} eclass"
21 21
22DEPEND=">=dev-util/cmake-2.4.6" 22DEPEND=">=dev-util/cmake-2.4.6"
23 23
24case ${EAPI} in
25 2)
24EXPORT_FUNCTIONS src_configure src_compile src_test src_install 26 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
27 ;;
28 *)
29 EXPORT_FUNCTIONS src_compile src_test src_install
30 ;;
31esac
32
25 33
26# Internal function use by cmake-utils_use_with and cmake-utils_use_enable 34# Internal function use by cmake-utils_use_with and cmake-utils_use_enable
27_use_me_now() { 35_use_me_now() {
28 debug-print-function $FUNCNAME $* 36 debug-print-function $FUNCNAME $*
29 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" 37 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
74# @DESCRIPTION: 82# @DESCRIPTION:
75# 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
76# out-of-source build. 84# out-of-source build.
77cmake-utils_src_configure() { 85cmake-utils_src_configure() {
78 debug-print-function $FUNCNAME $* 86 debug-print-function $FUNCNAME $*
87
88 if ! has debug ${IUSE//+} || ! use debug ; then
89 append-cppflags -DNDEBUG
90 fi
79 91
80 if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then 92 if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then
81 cmake-utils_src_configurein 93 cmake-utils_src_configurein
82 else 94 else
83 cmake-utils_src_configureout 95 cmake-utils_src_configureout
88# @DESCRIPTION: 100# @DESCRIPTION:
89# General function for compiling with cmake. Default behaviour is to check for 101# General function for compiling with cmake. Default behaviour is to check for
90# eapi and based on it configure or only compile 102# eapi and based on it configure or only compile
91cmake-utils_src_compile() { 103cmake-utils_src_compile() {
92 case ${EAPI} in 104 case ${EAPI} in
93 2 | 2_pre3 | 2_pre2 | 2_pre1) 105 2)
94 ;; 106 ;;
95 *) 107 *)
96 cmake-utils_src_configure 108 cmake-utils_src_configure
97 ;; 109 ;;
98 esac 110 esac
131} 143}
132 144
133# Internal use only. Common configuration options for all types of builds. 145# Internal use only. Common configuration options for all types of builds.
134_common_configure_code() { 146_common_configure_code() {
135 local tmp_libdir=$(get_libdir) 147 local tmp_libdir=$(get_libdir)
136 if has debug ${IUSE//+} && use debug; then 148 # CMAKE_BUILD_TYPE only modifies compiler flags, so set to None
137 echo -DCMAKE_BUILD_TYPE=Debug 149 echo -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-None}
138 else
139 echo -DCMAKE_BUILD_TYPE=Release
140 fi
141 echo -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) 150 echo -DCMAKE_C_COMPILER=$(type -P $(tc-getCC))
142 echo -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) 151 echo -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX))
143 echo -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr} 152 echo -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr}
144 echo -DLIB_SUFFIX=${tmp_libdir/lib} 153 echo -DLIB_SUFFIX=${tmp_libdir/lib}
145 echo -DLIB_INSTALL_DIR=${PREFIX:-/usr}/${tmp_libdir} 154 echo -DLIB_INSTALL_DIR=${PREFIX:-/usr}/${tmp_libdir}

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20