kde-apps/ksirk: x86 stable (bug #661810)
[gentoo.git] / eclass / cmake-multilib.eclass
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: cmake-multilib.eclass
5 # @MAINTAINER:
6 # gx86-multilib team <multilib@gentoo.org>
7 # @AUTHOR:
8 # Author: Michał Górny <mgorny@gentoo.org>
9 # @BLURB: cmake-utils wrapper for multilib builds
10 # @DESCRIPTION:
11 # The cmake-multilib.eclass provides a glue between cmake-utils.eclass(5)
12 # and multilib-minimal.eclass(5), aiming to provide a convenient way
13 # to build packages using cmake for multiple ABIs.
14 #
15 # Inheriting this eclass sets IUSE and exports default multilib_src_*()
16 # sub-phases that call cmake-utils phase functions for each ABI enabled.
17 # The multilib_src_*() functions can be defined in ebuild just like
18 # in multilib-minimal, yet they ought to call appropriate cmake-utils
19 # phase rather than 'default'.
20
21 # EAPI=5 is required for meaningful MULTILIB_USEDEP.
22 case ${EAPI:-0} in
23         5|6) ;;
24         *) die "EAPI=${EAPI} is not supported" ;;
25 esac
26
27 if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
28         die "${ECLASS}: multilib support requires out-of-source builds."
29 fi
30
31 inherit cmake-utils multilib-minimal
32
33 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
34
35 cmake-multilib_src_configure() {
36         local _cmake_args=( "${@}" )
37
38         multilib-minimal_src_configure
39 }
40
41 multilib_src_configure() {
42         cmake-utils_src_configure "${_cmake_args[@]}"
43 }
44
45 cmake-multilib_src_compile() {
46         local _cmake_args=( "${@}" )
47
48         multilib-minimal_src_compile
49 }
50
51 multilib_src_compile() {
52         cmake-utils_src_compile "${_cmake_args[@]}"
53 }
54
55 cmake-multilib_src_test() {
56         local _cmake_args=( "${@}" )
57
58         multilib-minimal_src_test
59 }
60
61 multilib_src_test() {
62         cmake-utils_src_test "${_cmake_args[@]}"
63 }
64
65 cmake-multilib_src_install() {
66         local _cmake_args=( "${@}" )
67
68         multilib-minimal_src_install
69 }
70
71 multilib_src_install() {
72         cmake-utils_src_install "${_cmake_args[@]}"
73 }