/[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.19 Revision 1.20
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.19 2009/03/12 08:45:52 fauli Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.20 2009/03/14 11:14:37 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# @AUTHORS: 8# @AUTHORS:
35 35
36# Internal functions used by cmake-utils_use_* 36# Internal functions used by cmake-utils_use_*
37_use_me_now() { 37_use_me_now() {
38 debug-print-function ${FUNCNAME} "$@" 38 debug-print-function ${FUNCNAME} "$@"
39 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" 39 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
40 echo "-D$1_${3:-$2}=$(use $2 && echo ON || echo OFF)" 40 echo "-D$1${3:-$2}=$(use $2 && echo ON || echo OFF)"
41} 41}
42_use_me_now_inverted() { 42_use_me_now_inverted() {
43 debug-print-function ${FUNCNAME} "$@" 43 debug-print-function ${FUNCNAME} "$@"
44 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" 44 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
45 echo "-D$1_${3:-$2}=$(use $2 && echo OFF || echo ON)" 45 echo "-D$1${3:-$2}=$(use $2 && echo OFF || echo ON)"
46} 46}
47 47
48# @ECLASS-VARIABLE: DOCS 48# @ECLASS-VARIABLE: DOCS
49# @DESCRIPTION: 49# @DESCRIPTION:
50# Documents passed to dodoc command. 50# Documents passed to dodoc command.
97# @DESCRIPTION: 97# @DESCRIPTION:
98# Based on use_with. See ebuild(5). 98# Based on use_with. See ebuild(5).
99# 99#
100# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled 100# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled
101# and -DWITH_FOO=OFF if it is disabled. 101# and -DWITH_FOO=OFF if it is disabled.
102cmake-utils_use_with() { _use_me_now WITH "$@" ; } 102cmake-utils_use_with() { _use_me_now WITH_ "$@" ; }
103 103
104# @FUNCTION: cmake-utils_use_enable 104# @FUNCTION: cmake-utils_use_enable
105# @USAGE: <USE flag> [flag name] 105# @USAGE: <USE flag> [flag name]
106# @DESCRIPTION: 106# @DESCRIPTION:
107# Based on use_enable. See ebuild(5). 107# Based on use_enable. See ebuild(5).
108# 108#
109# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled 109# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled
110# and -DENABLE_FOO=OFF if it is disabled. 110# and -DENABLE_FOO=OFF if it is disabled.
111cmake-utils_use_enable() { _use_me_now ENABLE "$@" ; } 111cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; }
112 112
113# @FUNCTION: cmake-utils_use_disable 113# @FUNCTION: cmake-utils_use_disable
114# @USAGE: <USE flag> [flag name] 114# @USAGE: <USE flag> [flag name]
115# @DESCRIPTION: 115# @DESCRIPTION:
116# Based on inversion of use_enable. See ebuild(5). 116# Based on inversion of use_enable. See ebuild(5).
117# 117#
118# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled 118# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled
119# and -DDISABLE_FOO=ON if it is disabled. 119# and -DDISABLE_FOO=ON if it is disabled.
120cmake-utils_use_disable() { _use_me_now_inverted DISABLE "$@" ; } 120cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; }
121 121
122# @FUNCTION: cmake-utils_use_no 122# @FUNCTION: cmake-utils_use_no
123# @USAGE: <USE flag> [flag name] 123# @USAGE: <USE flag> [flag name]
124# @DESCRIPTION: 124# @DESCRIPTION:
125# Based on use_disable. See ebuild(5). 125# Based on use_disable. See ebuild(5).
126# 126#
127# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled 127# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled
128# and -DNO_FOO=ON if it is disabled. 128# and -DNO_FOO=ON if it is disabled.
129cmake-utils_use_no() { _use_me_now_inverted NO "$@" ; } 129cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; }
130 130
131# @FUNCTION: cmake-utils_use_want 131# @FUNCTION: cmake-utils_use_want
132# @USAGE: <USE flag> [flag name] 132# @USAGE: <USE flag> [flag name]
133# @DESCRIPTION: 133# @DESCRIPTION:
134# Based on use_enable. See ebuild(5). 134# Based on use_enable. See ebuild(5).
135# 135#
136# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled 136# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled
137# and -DWANT_FOO=OFF if it is disabled. 137# and -DWANT_FOO=OFF if it is disabled.
138cmake-utils_use_want() { _use_me_now WANT "$@" ; } 138cmake-utils_use_want() { _use_me_now WANT_ "$@" ; }
139 139
140# @FUNCTION: cmake-utils_use_build 140# @FUNCTION: cmake-utils_use_build
141# @USAGE: <USE flag> [flag name] 141# @USAGE: <USE flag> [flag name]
142# @DESCRIPTION: 142# @DESCRIPTION:
143# Based on use_enable. See ebuild(5). 143# Based on use_enable. See ebuild(5).
144# 144#
145# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled 145# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled
146# and -DBUILD_FOO=OFF if it is disabled. 146# and -DBUILD_FOO=OFF if it is disabled.
147cmake-utils_use_build() { _use_me_now BUILD "$@" ; } 147cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; }
148 148
149# @FUNCTION: cmake-utils_use_has 149# @FUNCTION: cmake-utils_use_has
150# @USAGE: <USE flag> [flag name] 150# @USAGE: <USE flag> [flag name]
151# @DESCRIPTION: 151# @DESCRIPTION:
152# Based on use_enable. See ebuild(5). 152# Based on use_enable. See ebuild(5).
153# 153#
154# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled 154# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled
155# and -DHAVE_FOO=OFF if it is disabled. 155# and -DHAVE_FOO=OFF if it is disabled.
156cmake-utils_use_has() { _use_me_now HAVE "$@" ; } 156cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; }
157 157
158# @FUNCTION: cmake-utils_has 158# @FUNCTION: cmake-utils_has
159# @DESCRIPTION: 159# @DESCRIPTION:
160# Deprecated, use cmake-utils_use_has, kept now for backcompat. 160# Deprecated, use cmake-utils_use_has, kept now for backcompat.
161cmake-utils_has() { ewarn "QA notice: using deprecated ${FUNCNAME} call, use cmake-utils_use_has instead." ; _use_me_now HAVE "$@" ; } 161cmake-utils_has() { ewarn "QA notice: using deprecated ${FUNCNAME} call, use cmake-utils_use_has instead." ; _use_me_now HAVE_ "$@" ; }
162 162
163# @FUNCTION: cmake-utils_use 163# @FUNCTION: cmake-utils_use
164# @USAGE: <USE flag> [flag name] 164# @USAGE: <USE flag> [flag name]
165# @DESCRIPTION: 165# @DESCRIPTION:
166# Based on use_enable. See ebuild(5). 166# Based on use_enable. See ebuild(5).

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20