Index: cmake-utils.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v retrieving revision 1.107 diff -u -B -r1.107 cmake-utils.eclass --- cmake-utils.eclass 6 May 2014 15:29:02 -0000 1.107 +++ cmake-utils.eclass 14 Jun 2014 07:20:57 -0000 @@ -380,6 +380,25 @@ debug-print "$FUNCNAME: applying user patches" epatch_user + : ${CMAKE_USE_DIR:=${S}} + [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && { + local name + for name in ${CMAKE_REMOVE_MODULES_LIST} ; do + find "${S}" -name ${name}.cmake -exec rm -v {} + + done + } + + # check if CMakeLists.txt exist and if no then die + if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then + eerror "Unable to locate CMakeLists.txt under:" + eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\"" + eerror "Consider not inheriting the cmake eclass." + die "FATAL: Unable to find CMakeLists.txt" + fi + + # Remove dangerous things. + _modify-cmakelists + popd >/dev/null } @@ -400,33 +419,16 @@ enable_cmake-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" - [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && { - local name - for name in ${CMAKE_REMOVE_MODULES_LIST} ; do - find "${S}" -name ${name}.cmake -exec rm -v {} + - done - } - _check_build_dir - # check if CMakeLists.txt exist and if no then die - if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then - eerror "Unable to locate CMakeLists.txt under:" - eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\"" - eerror "Consider not inheriting the cmake eclass." - die "FATAL: Unable to find CMakeLists.txt" - fi - - # Remove dangerous things. - _modify-cmakelists - # Fix xdg collision with sandbox - export XDG_CONFIG_HOME="${T}" + local -x XDG_CONFIG_HOME="${T}" # @SEE CMAKE_BUILD_TYPE if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then # Handle release builds if ! has debug ${IUSE//+} || ! use debug; then + local CPPFLAGS=${CPPFLAGS} append-cppflags -DNDEBUG fi fi @@ -444,7 +446,7 @@ SET (PKG_CONFIG_EXECUTABLE $(type -P $(tc-getPKG_CONFIG)) CACHE FILEPATH "pkg-config executable" FORCE) _EOF_ - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= + has "${EAPI:-0}" 0 1 2 && ! use prefix && local EPREFIX= if [[ ${EPREFIX} ]]; then cat >> "${build_rules}" <<- _EOF_