/[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.3 Revision 1.7
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.3 2007/12/06 20:40:20 philantrop Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.7 2008/03/29 21:33:17 philantrop 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
28 debug-print-function $FUNCNAME $* 28 debug-print-function $FUNCNAME $*
29 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" 29 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
30 echo "-D$1_${3:-$2}=$(use $2 && echo ON || echo OFF)" 30 echo "-D$1_${3:-$2}=$(use $2 && echo ON || echo OFF)"
31} 31}
32 32
33# @VARIABLE: DOCS
34# @DESCRIPTION:
35# Documents to dodoc
36
33# @FUNCTION: cmake-utils_use_with 37# @FUNCTION: cmake-utils_use_with
34# @USAGE: <USE flag> [flag name] 38# @USAGE: <USE flag> [flag name]
35# @DESCRIPTION: 39# @DESCRIPTION:
36# Based on use_with. See ebuild(5). 40# Based on use_with. See ebuild(5).
37# 41#
38# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled 42# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled
39# and -DWITH_FOO=OFF if it is disabled. 43# and -DWITH_FOO=OFF if it is disabled.
40cmake-utils_use_with() { _use_me_now WITH "$@" ; } 44cmake-utils_use_with() { _use_me_now WITH "$@" ; }
41 45
42# @FUNCTION: cmake-utils_use_enable 46# @FUNCTION: cmake-utils_use_enable
43# @USAGE: <USE flag> [flag name] 47# @USAGE: <USE flag> [flag name]
44# @DESCRIPTION: 48# @DESCRIPTION:
45# Based on use_enable. See ebuild(5). 49# Based on use_enable. See ebuild(5).
46# 50#
47# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled 51# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled
48# and -DENABLE_FOO=OFF if it is disabled. 52# and -DENABLE_FOO=OFF if it is disabled.
49cmake-utils_use_enable() { _use_me_now ENABLE "$@" ; } 53cmake-utils_use_enable() { _use_me_now ENABLE "$@" ; }
50 54
51# @FUNCTION: cmake-utils_use_want 55# @FUNCTION: cmake-utils_use_want
52# @USAGE: <USE flag> [flag name] 56# @USAGE: <USE flag> [flag name]
53# @DESCRIPTION: 57# @DESCRIPTION:
54# Based on use_enable. See ebuild(5). 58# Based on use_enable. See ebuild(5).
55# 59#
56# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled 60# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled
57# and -DWANT_FOO=OFF if it is disabled. 61# and -DWANT_FOO=OFF if it is disabled.
58cmake-utils_use_want() { _use_me_now WANT "$@" ; } 62cmake-utils_use_want() { _use_me_now WANT "$@" ; }
59 63
60# @FUNCTION: cmake-utils_has 64# @FUNCTION: cmake-utils_has
61# @USAGE: <USE flag> [flag name] 65# @USAGE: <USE flag> [flag name]
62# @DESCRIPTION: 66# @DESCRIPTION:
63# Based on use_enable. See ebuild(5). 67# Based on use_enable. See ebuild(5).
64# 68#
65# `cmake-utils_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled 69# `cmake-utils_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled
66# and -DHAVE_FOO=OFF if it is disabled. 70# and -DHAVE_FOO=OFF if it is disabled.
67cmake-utils_has() { _use_me_now HAVE "$@" ; } 71cmake-utils_has() { _use_me_now HAVE "$@" ; }
68 72
69# @FUNCTION: cmake-utils_src_compile 73# @FUNCTION: cmake-utils_src_compile
86# Function for software that requires configure and building in the source 90# Function for software that requires configure and building in the source
87# directory. 91# directory.
88cmake-utils_src_configurein() { 92cmake-utils_src_configurein() {
89 debug-print-function $FUNCNAME $* 93 debug-print-function $FUNCNAME $*
90 94
91 local cmakeargs="$(_common_configure_code) ${mycmakeargs}" 95 local cmakeargs="$(_common_configure_code) ${mycmakeargs} ${EXTRA_ECONF}"
92 96
93 debug-print "$LINENO $ECLASS $FUNCNAME: mycmakeargs is $cmakeargs" 97 debug-print "$LINENO $ECLASS $FUNCNAME: mycmakeargs is $cmakeargs"
94 cmake ${cmakeargs} . || die "Cmake failed" 98 cmake ${cmakeargs} . || die "Cmake failed"
95} 99}
96 100
99# Function for software that requires configure and building outside the source 103# Function for software that requires configure and building outside the source
100# tree - default. 104# tree - default.
101cmake-utils_src_configureout() { 105cmake-utils_src_configureout() {
102 debug-print-function $FUNCNAME $* 106 debug-print-function $FUNCNAME $*
103 107
104 local cmakeargs="$(_common_configure_code) ${mycmakeargs}" 108 local cmakeargs="$(_common_configure_code) ${mycmakeargs} ${EXTRA_ECONF}"
105 mkdir -p "${WORKDIR}"/${PN}_build 109 mkdir -p "${WORKDIR}"/${PN}_build
106 pushd "${WORKDIR}"/${PN}_build > /dev/null 110 pushd "${WORKDIR}"/${PN}_build > /dev/null
107 111
108 debug-print "$LINENO $ECLASS $FUNCNAME: mycmakeargs is $cmakeargs" 112 debug-print "$LINENO $ECLASS $FUNCNAME: mycmakeargs is $cmakeargs"
109 cmake ${cmakeargs} "${S}" || die "Cmake failed" 113 cmake ${cmakeargs} "${S}" || die "Cmake failed"
163 fi 167 fi
164 emake install DESTDIR="${D}" || die "Make install failed" 168 emake install DESTDIR="${D}" || die "Make install failed"
165 if [[ -d ${WORKDIR}/${PN}_build ]]; then 169 if [[ -d ${WORKDIR}/${PN}_build ]]; then
166 popd > /dev/null 170 popd > /dev/null
167 fi 171 fi
172
173 # Manual document installation
174 [[ -n "${DOCS}" ]] && dodoc ${DOCS}
168} 175}
169 176
170# @FUNCTION: cmake-utils_src_test 177# @FUNCTION: cmake-utils_src_test
171# @DESCRIPTION: 178# @DESCRIPTION:
172# Function for testing the package. Automatically detects the build type. 179# Function for testing the package. Automatically detects the build type.

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20