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.8 2008/04/23 11:55:51 ingmar Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.9 2008/09/28 16:19:06 jmbsvicetto 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 | |
20 | DESCRIPTION="Based on the ${ECLASS} eclass" |
20 | DESCRIPTION="Based on the ${ECLASS} eclass" |
21 | |
21 | |
22 | DEPEND=">=dev-util/cmake-2.4.6" |
22 | DEPEND=">=dev-util/cmake-2.4.6" |
23 | |
23 | |
24 | EXPORT_FUNCTIONS src_compile src_test src_install |
24 | EXPORT_FUNCTIONS src_configure src_compile src_test src_install |
25 | |
25 | |
26 | # Internal function use by cmake-utils_use_with and cmake-utils_use_enable |
26 | # Internal function use by cmake-utils_use_with and cmake-utils_use_enable |
27 | _use_me_now() { |
27 | _use_me_now() { |
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>]" |
… | |
… | |
68 | # |
68 | # |
69 | # `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 |
70 | # and -DHAVE_FOO=OFF if it is disabled. |
70 | # and -DHAVE_FOO=OFF if it is disabled. |
71 | cmake-utils_has() { _use_me_now HAVE "$@" ; } |
71 | cmake-utils_has() { _use_me_now HAVE "$@" ; } |
72 | |
72 | |
73 | # @FUNCTION: cmake-utils_src_compile |
73 | # @FUNCTION: cmake-utils_src_configure |
74 | # @DESCRIPTION: |
74 | # @DESCRIPTION: |
75 | # General function for compiling with cmake. Default behaviour is to start an |
75 | # General function for configuring with cmake. Default behaviour is to start an |
76 | # out-of-source build. All arguments are passed to cmake-utils_src_make. |
76 | # out-of-source build. |
77 | cmake-utils_src_compile() { |
77 | cmake-utils_src_configure() { |
78 | debug-print-function $FUNCNAME $* |
78 | debug-print-function $FUNCNAME $* |
79 | |
79 | |
80 | if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then |
80 | if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then |
81 | cmake-utils_src_configurein |
81 | cmake-utils_src_configurein |
82 | else |
82 | else |
83 | cmake-utils_src_configureout |
83 | cmake-utils_src_configureout |
84 | fi |
84 | fi |
|
|
85 | } |
|
|
86 | |
|
|
87 | # @FUNCTION: cmake-utils_src_compile |
|
|
88 | # @DESCRIPTION: |
|
|
89 | # General function for compiling with cmake. Default behaviour is to check for |
|
|
90 | # eapi and based on it configure or only compile |
|
|
91 | cmake-utils_src_compile() { |
|
|
92 | case ${EAPI} in |
|
|
93 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
|
|
94 | ;; |
|
|
95 | *) |
|
|
96 | cmake-utils_src_configure |
|
|
97 | ;; |
|
|
98 | esac |
|
|
99 | |
85 | cmake-utils_src_make "$@" |
100 | cmake-utils_src_make "$@" |
86 | } |
101 | } |
87 | |
102 | |
88 | # @FUNCTION: cmake-utils_src_configurein |
103 | # @FUNCTION: cmake-utils_src_configurein |
89 | # @DESCRIPTION: |
104 | # @DESCRIPTION: |