cmake-language

CMake incorrectly identifying valid C++ compiler options?

戏子无情 提交于 2021-02-11 18:16:48
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable

CMake incorrectly identifying valid C++ compiler options?

柔情痞子 提交于 2021-02-11 18:07:30
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable

CMake set_property command with generator expressions using multiple values

走远了吗. 提交于 2020-12-12 06:04:07
问题 I am using CMake v3.13.4 with the Visual Studio 2017 Win64 generator and I need to modify the command line options for the Visual Studio Librarian (for a CMake object library). To achieve that CMake offers the target property STATIC_LIBRARY_OPTIONS that can be set by the set_property and set_target_properties command. The documentation states that STATIC_LIBRARY_OPTIONS supports generator expressions: Contents of STATIC_LIBRARY_OPTIONS may use “generator expressions” with the syntax $<...> .