I have a CMakeLists.txt which imports several static libraries like so:
add_subdirectory("/foo/bar" "/bar/foo") add_subdirectory("/foo2/bar" "/bar2/foo") In my main CMakeLists.txt I set CMAKE_C_FLAGS like this:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ...my flags...") All static libraries which I import using add_subdirectory seem to inherit these flags as well now but I don't want that! Is there any way to set the compiler flags locally, i.e. just for the source files inside the respective CMakeLists.txt file instead of the whole project?