/[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.106 Revision 1.107
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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.106 2014/03/26 13:12:39 kensington Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.107 2014/05/06 15:29:02 jer 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# @AUTHOR: 8# @AUTHOR:
20if [[ ${___ECLASS_ONCE_CMAKE_UTILS} != "recur -_+^+_- spank" ]] ; then 20if [[ ${___ECLASS_ONCE_CMAKE_UTILS} != "recur -_+^+_- spank" ]] ; then
21___ECLASS_ONCE_CMAKE_UTILS="recur -_+^+_- spank" 21___ECLASS_ONCE_CMAKE_UTILS="recur -_+^+_- spank"
22 22
23# @ECLASS-VARIABLE: WANT_CMAKE 23# @ECLASS-VARIABLE: WANT_CMAKE
24# @DESCRIPTION: 24# @DESCRIPTION:
25# Specify if cmake-utils eclass should depend on cmake optionaly or not. 25# Specify if cmake-utils eclass should depend on cmake optionally or not.
26# This is usefull when only part of aplication is using cmake build system. 26# This is usefull when only part of aplication is using cmake build system.
27# Valid values are: always [default], optional (where the value is the useflag 27# Valid values are: always [default], optional (where the value is the useflag
28# used for optionality) 28# used for optionality)
29WANT_CMAKE="${WANT_CMAKE:-always}" 29WANT_CMAKE="${WANT_CMAKE:-always}"
30 30
666 666
667# @FUNCTION: cmake-utils_src_prepare 667# @FUNCTION: cmake-utils_src_prepare
668# @DESCRIPTION: 668# @DESCRIPTION:
669# Apply ebuild and user patches. 669# Apply ebuild and user patches.
670cmake-utils_src_prepare() { 670cmake-utils_src_prepare() {
671 _execute_optionaly "src_prepare" "$@" 671 _execute_optionally "src_prepare" "$@"
672} 672}
673 673
674# @FUNCTION: cmake-utils_src_configure 674# @FUNCTION: cmake-utils_src_configure
675# @DESCRIPTION: 675# @DESCRIPTION:
676# General function for configuring with cmake. Default behaviour is to start an 676# General function for configuring with cmake. Default behaviour is to start an
677# out-of-source build. 677# out-of-source build.
678cmake-utils_src_configure() { 678cmake-utils_src_configure() {
679 _execute_optionaly "src_configure" "$@" 679 _execute_optionally "src_configure" "$@"
680} 680}
681 681
682# @FUNCTION: cmake-utils_src_compile 682# @FUNCTION: cmake-utils_src_compile
683# @DESCRIPTION: 683# @DESCRIPTION:
684# General function for compiling with cmake. Default behaviour is to check for 684# General function for compiling with cmake. Default behaviour is to check for
685# EAPI and respectively to configure as well or just compile. 685# EAPI and respectively to configure as well or just compile.
686# Automatically detects the build type. All arguments are passed to emake. 686# Automatically detects the build type. All arguments are passed to emake.
687cmake-utils_src_compile() { 687cmake-utils_src_compile() {
688 _execute_optionaly "src_compile" "$@" 688 _execute_optionally "src_compile" "$@"
689} 689}
690 690
691# @FUNCTION: cmake-utils_src_install 691# @FUNCTION: cmake-utils_src_install
692# @DESCRIPTION: 692# @DESCRIPTION:
693# Function for installing the package. Automatically detects the build type. 693# Function for installing the package. Automatically detects the build type.
694cmake-utils_src_install() { 694cmake-utils_src_install() {
695 _execute_optionaly "src_install" "$@" 695 _execute_optionally "src_install" "$@"
696} 696}
697 697
698# @FUNCTION: cmake-utils_src_test 698# @FUNCTION: cmake-utils_src_test
699# @DESCRIPTION: 699# @DESCRIPTION:
700# Function for testing the package. Automatically detects the build type. 700# Function for testing the package. Automatically detects the build type.
701cmake-utils_src_test() { 701cmake-utils_src_test() {
702 _execute_optionaly "src_test" "$@" 702 _execute_optionally "src_test" "$@"
703} 703}
704 704
705# Optionally executes phases based on WANT_CMAKE variable/USE flag. 705# Optionally executes phases based on WANT_CMAKE variable/USE flag.
706_execute_optionaly() { 706_execute_optionally() {
707 local phase="$1" ; shift 707 local phase="$1" ; shift
708 if [[ ${WANT_CMAKE} = always ]]; then 708 if [[ ${WANT_CMAKE} = always ]]; then
709 enable_cmake-utils_${phase} "$@" 709 enable_cmake-utils_${phase} "$@"
710 else 710 else
711 use ${WANT_CMAKE} && enable_cmake-utils_${phase} "$@" 711 use ${WANT_CMAKE} && enable_cmake-utils_${phase} "$@"

Legend:
Removed from v.1.106  
changed lines
  Added in v.1.107

  ViewVC Help
Powered by ViewVC 1.1.20