[cmake] assign CMAKE_CXX_FLAGS as a string instead of a list 44/head
authorThomas Debesse <dev@illwieckz.net>
Sun, 9 Jul 2017 20:01:46 +0000 (22:01 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sun, 9 Jul 2017 20:06:26 +0000 (22:06 +0200)
- fix command line -DCMAKE_CXX_FLAGS expansion

spotted by !43

CMakeLists.txt

index 742fd05..dda42c7 100644 (file)
@@ -48,7 +48,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
     include(CheckCXXCompilerFlag)
     check_cxx_compiler_flag(--std=c++${CMAKE_CXX_STANDARD} STD_CXX)
     if (STD_CXX)
-        list(APPEND CMAKE_CXX_FLAGS --std=c++${CMAKE_CXX_STANDARD})
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++${CMAKE_CXX_STANDARD}")
     else ()
         message(SEND_ERROR "Requires C++${CMAKE_CXX_STANDARD} or better")
     endif ()