diff options
| author | Andreas Sturmlechner <asturm@gentoo.org> | 2019-02-24 14:32:58 +0100 |
|---|---|---|
| committer | Andreas Sturmlechner <asturm@gentoo.org> | 2019-03-01 14:29:08 +0100 |
| commit | 3603015258476c34dde7d805abc9b5474fd6e4dd (patch) | |
| tree | 7efccf7ab7e9eb1f969e3a18d7d5c7fa382a6d60 /eclass/cmake-utils.eclass | |
| parent | 9bee6f3b0f90db1a9e0a78dbefe4542e798467f8 (diff) | |
| download | kde-3603015258476c34dde7d805abc9b5474fd6e4dd.tar.gz kde-3603015258476c34dde7d805abc9b5474fd6e4dd.tar.bz2 kde-3603015258476c34dde7d805abc9b5474fd6e4dd.zip | |
cmake-utils.eclass: Fix _cmake_modify-cmakelists, add QA output
Bug: https://bugs.gentoo.org/674768
Reported-by: Fabio Rossi <rossi.f@inwind.it>
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass/cmake-utils.eclass')
| -rw-r--r-- | eclass/cmake-utils.eclass | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 77c6d0481cf..42a108976f6 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -419,13 +419,17 @@ _cmake_modify-cmakelists() { grep -qs "<<< Gentoo configuration >>>" "${CMAKE_USE_DIR}"/CMakeLists.txt && return 0 # Comment out all set (<some_should_be_user_defined_variable> value) - # TODO Add QA checker - inform when variable being checked for below is set in CMakeLists.txt - find "${CMAKE_USE_DIR}" -name CMakeLists.txt \ - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE.*)/{s/^/#IGNORE /g}' {} + \ - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \ - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX.*)/{s/^/#IGNORE /g}' {} + \ - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \ - || die "${LINENO}: failed to disable hardcoded settings" + find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#G_cmake_modify_IGNORE /g}' \ + -i {} + || die "${LINENO}: failed to disable hardcoded settings" + local x + for x in $(find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec grep -l "^#_cmake_modify_IGNORE" {} +;); do + eqawarn "Hardcoded definition(s) removed in $(echo "${x}" | cut -c $((${#CMAKE_USE_DIR}+2))-):" + eqawarn "$(grep -se '^#_cmake_modify_IGNORE' ${x} | cut -c 22-99)" + done # NOTE Append some useful summary here cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die |
