/[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.59 Revision 1.63
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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.59 2010/09/16 16:04:11 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.63 2011/01/13 19:17:00 grobian 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# 8#
135# @ECLASS-VARIABLE: PREFIX 135# @ECLASS-VARIABLE: PREFIX
136# @DESCRIPTION: 136# @DESCRIPTION:
137# Eclass respects PREFIX variable, though it's not recommended way to set 137# Eclass respects PREFIX variable, though it's not recommended way to set
138# install/lib/bin prefixes. 138# install/lib/bin prefixes.
139# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead. 139# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead.
140
141# @ECLASS-VARIABLE: CMAKE_BINARY
142# @DESCRIPTION:
143# Eclass can use different cmake binary than the one provided in by system.
144: ${CMAKE_BINARY:=cmake}
140 145
141# Determine using IN or OUT source build 146# Determine using IN or OUT source build
142_check_build_dir() { 147_check_build_dir() {
143 : ${CMAKE_USE_DIR:=${S}} 148 : ${CMAKE_USE_DIR:=${S}}
144 if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then 149 if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
302 # right ... except for Darwin hosts 307 # right ... except for Darwin hosts
303 IF (NOT APPLE) 308 IF (NOT APPLE)
304 SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE) 309 SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
305 SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" 310 SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)"
306 CACHE STRING "" FORCE) 311 CACHE STRING "" FORCE)
312
313 ELSE ()
314
315 SET(CMAKE_PREFIX_PATH "${EPREFIX}${PREFIX:-/usr}" CACHE STRING ""FORCE)
316 SET(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
317 SET(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
318 SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE CACHE BOOL "" FORCE)
319 SET(CMAKE_INSTALL_RPATH "${EPREFIX}${PREFIX:-/usr}/lib;${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" CACHE STRING "" FORCE)
320 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
321 SET(CMAKE_INSTALL_NAME_DIR "${EPREFIX}${PREFIX:-/usr}/lib" CACHE STRING "" FORCE)
322
307 ENDIF (NOT APPLE) 323 ENDIF (NOT APPLE)
308 _EOF_ 324 _EOF_
309 fi 325 fi
310 326
311 # Common configure parameters (invariants) 327 # Common configure parameters (invariants)
342 ) 358 )
343 359
344 mkdir -p "${CMAKE_BUILD_DIR}" 360 mkdir -p "${CMAKE_BUILD_DIR}"
345 pushd "${CMAKE_BUILD_DIR}" > /dev/null 361 pushd "${CMAKE_BUILD_DIR}" > /dev/null
346 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" 362 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
347 echo cmake "${cmakeargs[@]}" "${CMAKE_USE_DIR}" 363 echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
348 cmake "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" 364 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
349 popd > /dev/null 365 popd > /dev/null
350} 366}
351 367
352enable_cmake-utils_src_compile() { 368enable_cmake-utils_src_compile() {
353 debug-print-function ${FUNCNAME} "$@" 369 debug-print-function ${FUNCNAME} "$@"
378enable_cmake-utils_src_install() { 394enable_cmake-utils_src_install() {
379 debug-print-function ${FUNCNAME} "$@" 395 debug-print-function ${FUNCNAME} "$@"
380 396
381 _check_build_dir 397 _check_build_dir
382 pushd "${CMAKE_BUILD_DIR}" > /dev/null 398 pushd "${CMAKE_BUILD_DIR}" > /dev/null
383 base_src_install 399 base_src_install "$@"
384 popd > /dev/null 400 popd > /dev/null
385 401
386 # Backward compatibility, for non-array variables 402 # Backward compatibility, for non-array variables
387 if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then 403 if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
388 dodoc ${DOCS} || die "dodoc failed" 404 dodoc ${DOCS} || die "dodoc failed"

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.20