| 1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 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.83 2012/10/02 08:14:36 kensington Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.84 2012/10/17 14:09:10 kensington 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: |
| … | |
… | |
| 325 | if ! has debug ${IUSE//+} || ! use debug; then |
325 | if ! has debug ${IUSE//+} || ! use debug; then |
| 326 | append-cppflags -DNDEBUG |
326 | append-cppflags -DNDEBUG |
| 327 | fi |
327 | fi |
| 328 | fi |
328 | fi |
| 329 | |
329 | |
| 330 | # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS) |
330 | # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.) |
| 331 | local build_rules=${CMAKE_BUILD_DIR}/gentoo_rules.cmake |
331 | local build_rules=${CMAKE_BUILD_DIR}/gentoo_rules.cmake |
| 332 | cat > "${build_rules}" <<- _EOF_ |
332 | cat > "${build_rules}" <<- _EOF_ |
|
|
333 | SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE) |
| 333 | SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE) |
334 | SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE) |
| 334 | SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) |
335 | SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) |
| 335 | SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE) |
336 | SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE) |
| 336 | SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) |
337 | SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) |
|
|
338 | SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE) |
| 337 | _EOF_ |
339 | _EOF_ |
| 338 | |
340 | |
| 339 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
341 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
| 340 | |
342 | |
| 341 | if [[ ${EPREFIX} ]]; then |
343 | if [[ ${EPREFIX} ]]; then |