> > > in our code base we would like to add a warning compilation flags. > Nevertheless, this flag prevents us from compiling a few targets so we > would like to remove this flag for the given targets. > > Since I don't want to *add* a compilation flags but remove one, I would > like to retrieve the properties of the target > (get_target_property(my_compilation_flags TARGET COMPILE_FLAGS)), and > then modify those and use it to set the properties of the target. >
Instead of removing, have you tried appending the -Wno-fubar flag that turns back off these specific warnings for these specific files? With gcc for instance: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html "Each of these specific warning options also has a negative form beginning ‘-Wno-’ to turn off warnings; for example, -Wno-implicit. [...] For options of the same specificity, the last one takes effect"
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake