/[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.22 Revision 1.23
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.22 2009/03/19 09:12:41 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.23 2009/04/04 12:28:10 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#
9# @CODE
9# Tomáš Chvátal <scarabeus@gentoo.org> 10# Tomáš Chvátal <scarabeus@gentoo.org>
10# Maciej Mrozowski <reavertm@poczta.fm> 11# Maciej Mrozowski <reavertm@poczta.fm>
11# (undisclosed contributors) 12# (undisclosed contributors)
12# Original author: Zephyrus (zephyrus@mirach.it) 13# Original author: Zephyrus (zephyrus@mirach.it)
14# @CODE
13# @BLURB: common ebuild functions for cmake-based packages 15# @BLURB: common ebuild functions for cmake-based packages
14# @DESCRIPTION: 16# @DESCRIPTION:
15# The cmake-utils eclass contains functions that make creating ebuilds for 17# The cmake-utils eclass contains functions that make creating ebuilds for
16# cmake-based packages much easier. 18# cmake-based packages much easier.
17# Its main features are support of out-of-source builds as well as in-source 19# Its main features are support of out-of-source builds as well as in-source
29esac 31esac
30EXPORT_FUNCTIONS ${EXPF} 32EXPORT_FUNCTIONS ${EXPF}
31 33
32: ${DESCRIPTION:="Based on the ${ECLASS} eclass"} 34: ${DESCRIPTION:="Based on the ${ECLASS} eclass"}
33 35
34DEPEND=" 36if [[ ${PN} != cmake ]]; then
35 >=dev-util/cmake-2.6.2-r1 37 CMAKEDEPEND=">=dev-util/cmake-2.6.2-r1"
38fi
39
40DEPEND="${CMAKEDEPEND}
36 userland_GNU? ( >=sys-apps/findutils-4.4.0 ) 41 userland_GNU? ( >=sys-apps/findutils-4.4.0 )
37" 42"
38 43
39# Internal functions used by cmake-utils_use_* 44# Internal functions used by cmake-utils_use_*
40_use_me_now() { 45_use_me_now() {
41 debug-print-function ${FUNCNAME} "$@" 46 debug-print-function ${FUNCNAME} "$@"
47
48 local uper capitalised x
42 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" 49 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
50 if [[ ! -z $3 ]]; then
51 # user specified the use name so use it
43 echo "-D$1${3:-$2}=$(use $2 && echo ON || echo OFF)" 52 echo "-D$1$3=$(use $2 && echo ON || echo OFF)"
53 else
54 # use all various most used combinations
55 uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
56 capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
57 for x in $2 $uper $capitalised; do
58 echo "-D$1$x=$(use $2 && echo ON || echo OFF) "
59 done
60 fi
44} 61}
45_use_me_now_inverted() { 62_use_me_now_inverted() {
46 debug-print-function ${FUNCNAME} "$@" 63 debug-print-function ${FUNCNAME} "$@"
64
65 local uper capitalised x
47 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" 66 [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
67 if [[ ! -z $3 ]]; then
68 # user specified the use name so use it
48 echo "-D$1${3:-$2}=$(use $2 && echo OFF || echo ON)" 69 echo "-D$1$3=$(use $2 && echo OFF || echo ON)"
70 else
71 # use all various most used combinations
72 uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
73 capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
74 for x in $2 $uper $capitalised; do
75 echo "-D$1$x=$(use $2 && echo OFF || echo ON) "
76 done
77 fi
49} 78}
50 79
51# @ECLASS-VARIABLE: DOCS 80# @ECLASS-VARIABLE: DOCS
52# @DESCRIPTION: 81# @DESCRIPTION:
53# Documents passed to dodoc command. 82# Documents passed to dodoc command.
55# @ECLASS-VARIABLE: HTML_DOCS 84# @ECLASS-VARIABLE: HTML_DOCS
56# @DESCRIPTION: 85# @DESCRIPTION:
57# Documents passed to dohtml command. 86# Documents passed to dohtml command.
58 87
59# @ECLASS-VARIABLE: PREFIX 88# @ECLASS-VARIABLE: PREFIX
60# @DESCRIPTION 89# @DESCRIPTION:
61# Eclass respects PREFIX variable, though it's not recommended way to set 90# Eclass respects PREFIX variable, though it's not recommended way to set
62# install/lib/bin prefixes. 91# install/lib/bin prefixes.
63# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead. 92# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead.
64 93
65# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD 94# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20