From: Matthias Maier Date: Mon, 1 Aug 2016 16:38:01 +0000 (-0500) Subject: CMake: Bugfix: Strip input variables for CHECK_COMPILER_SETUP X-Git-Tag: v8.5.0-rc1~815^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35341509f13b9054fe7782fde2cb3a9f42f6e81d;p=dealii.git CMake: Bugfix: Strip input variables for CHECK_COMPILER_SETUP CMake 2.8.8 (and possibly till 2.8.11) do not normalize CMAKE_REQUIRED_FLAGS and CMAKE_REQUIRED_LIBRARIES correctly leading to stray "-l " in the linker command line. Fix this by normalizing the input of CHECK_COMPILER_SETUP by stripping leading and trailing whitespace --- diff --git a/cmake/macros/macro_check_compiler_setup.cmake b/cmake/macros/macro_check_compiler_setup.cmake index c1d3a9e820..32c33a77aa 100644 --- a/cmake/macros/macro_check_compiler_setup.cmake +++ b/cmake/macros/macro_check_compiler_setup.cmake @@ -25,7 +25,13 @@ # ${_var} is set to true, otherwise it is set to false. # -MACRO(CHECK_COMPILER_SETUP _compiler_flags _linker_flags _var) +MACRO(CHECK_COMPILER_SETUP _compiler_flags_unstr _linker_flags_unstr _var) + # + # Strip leading and trailing whitespace to make CMake 2.8.8 happy + # + STRING(STRIP "${_compiler_flags_unstr}" _compiler_flags) + STRING(STRIP "${_linker_flags_unstr}" _linker_flags) + # # Rerun this test if flags have changed: #