]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: Strip input variables for CHECK_COMPILER_SETUP 2905/head
authorMatthias Maier <tamiko@43-1.org>
Mon, 1 Aug 2016 16:38:01 +0000 (11:38 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 1 Aug 2016 16:42:33 +0000 (11:42 -0500)
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

cmake/macros/macro_check_compiler_setup.cmake

index c1d3a9e82086965f9623741641b64b087f6faaee..32c33a77aa6277ccb3d75e959103ef23518e2cff 100644 (file)
 # ${_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:
   #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.