diff options
Diffstat (limited to 'eclass/cmake-utils.eclass')
| -rw-r--r-- | eclass/cmake-utils.eclass | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index c3184bd2ec6..b7265896e63 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -397,11 +397,37 @@ _modify-cmakelists() { _EOF_ } +# temporary function for moving cmake cleanups from from src_configure -> src_prepare. +# bug #378850 +_cleanup_cmake() { + : ${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 +} + enable_cmake-utils_src_prepare() { debug-print-function ${FUNCNAME} "$@" pushd "${S}" > /dev/null || die + has "${EAPI:-0}" 6 && _cleanup_cmake + debug-print "$FUNCNAME: PATCHES=$PATCHES" [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" @@ -429,26 +455,10 @@ enable_cmake-utils_src_prepare() { 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 - } + has "${EAPI:-0}" 2 3 4 5 && _cleanup_cmake _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}" |
