/[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.77 Revision 1.78
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.77 2012/01/21 23:31:11 dilfridge Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.78 2012/04/16 10:28:47 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# @AUTHOR: 8# @AUTHOR:
62EXPORT_FUNCTIONS ${CMAKE_EXPF} 62EXPORT_FUNCTIONS ${CMAKE_EXPF}
63 63
64: ${DESCRIPTION:="Based on the ${ECLASS} eclass"} 64: ${DESCRIPTION:="Based on the ${ECLASS} eclass"}
65 65
66if [[ ${PN} != cmake ]]; then 66if [[ ${PN} != cmake ]]; then
67 CMAKEDEPEND+=">=dev-util/cmake-${CMAKE_MIN_VERSION}" 67 CMAKEDEPEND+=" >=dev-util/cmake-${CMAKE_MIN_VERSION}"
68fi 68fi
69 69
70CMAKEDEPEND+=" userland_GNU? ( >=sys-apps/findutils-4.4.0 )" 70CMAKEDEPEND+=" userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
71 71
72[[ ${WANT_CMAKE} = always ]] || CMAKEDEPEND+=" )" 72[[ ${WANT_CMAKE} = always ]] || CMAKEDEPEND+=" )"
159 # we build in source dir 159 # we build in source dir
160 CMAKE_BUILD_DIR="${CMAKE_USE_DIR}" 160 CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
161 else 161 else
162 : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build} 162 : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build}
163 fi 163 fi
164 mkdir -p "${CMAKE_BUILD_DIR}"
164 echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\"" 165 echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
165} 166}
166# @FUNCTION: cmake-utils_use_with 167# @FUNCTION: cmake-utils_use_with
167# @USAGE: <USE flag> [flag name] 168# @USAGE: <USE flag> [flag name]
168# @DESCRIPTION: 169# @DESCRIPTION:
310 append-cppflags -DNDEBUG 311 append-cppflags -DNDEBUG
311 fi 312 fi
312 fi 313 fi
313 314
314 # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS) 315 # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS)
315 local build_rules=${T}/gentoo_rules.cmake 316 local build_rules=${CMAKE_BUILD_DIR}/gentoo_rules.cmake
316 cat > "${build_rules}" <<- _EOF_ 317 cat > "${build_rules}" <<- _EOF_
317 SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE) 318 SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE)
318 SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) 319 SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
319 SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE) 320 SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE)
320 SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) 321 SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
344 ENDIF (NOT APPLE) 345 ENDIF (NOT APPLE)
345 _EOF_ 346 _EOF_
346 fi 347 fi
347 348
348 # Common configure parameters (invariants) 349 # Common configure parameters (invariants)
349 local common_config=${T}/gentoo_common_config.cmake 350 local common_config=${CMAKE_BUILD_DIR}/gentoo_common_config.cmake
350 local libdir=$(get_libdir) 351 local libdir=$(get_libdir)
351 cat > "${common_config}" <<- _EOF_ 352 cat > "${common_config}" <<- _EOF_
352 SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE) 353 SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
353 SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries") 354 SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
354 _EOF_ 355 _EOF_
375 -DCMAKE_INSTALL_DO_STRIP=OFF 376 -DCMAKE_INSTALL_DO_STRIP=OFF
376 -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}" 377 -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
377 "${MYCMAKEARGS}" 378 "${MYCMAKEARGS}"
378 ) 379 )
379 380
380 mkdir -p "${CMAKE_BUILD_DIR}"
381 pushd "${CMAKE_BUILD_DIR}" > /dev/null 381 pushd "${CMAKE_BUILD_DIR}" > /dev/null
382 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" 382 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
383 echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" 383 echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
384 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" 384 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
385 popd > /dev/null 385 popd > /dev/null

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

  ViewVC Help
Powered by ViewVC 1.1.20