]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
CMake: allow compile-time C++ flags to be set
[lyx.git] / CMakeLists.txt
index e72aad5e15adb89673b72f8c5b08b2c4f098027b..fa16d1074d90ea89b0ba327a0d32c5d82dff5e29 100644 (file)
@@ -469,8 +469,12 @@ if(NOT MSVC)
        endif()
 endif()
 
+set(LYX_CXX_FLAGS_EXTRA "" CACHE STRING "Desired semicolon separated list of extra cxx compile flags, like '-Werror'")
+mark_as_advanced(LYX_CXX_FLAGS_EXTRA)
 if(LYX_CXX_FLAGS_EXTRA)
-       add_definitions(${LYX_CXX_FLAGS_EXTRA})
+       foreach(_flag ${LYX_CXX_FLAGS_EXTRA})
+               add_definitions(${_flag})
+       endforeach()
 endif()
 
 find_package(Qt5Core QUIET)