Probably an easy beginners question: I want to add the compiler flag /EHsc
to my project and tried both
SET_TARGET_PROPERTIES(name_of_my_project PROPERTIES COMPILER_FLAGS "/EHsc")
and
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
in my CMakeLists.txt. With both, CMake generates a Visual Studio Solution without complaining.
EDIT: initially I asked why both versions did not work. Well, because I am an idiot and made an error elsewhere so that none of the two lines where ever processed. Still, I'm wondering if both versions are equivalent.