I'll give COMPILE_FLAGS another try. There is always a chance with how I
was using it that it had no effect or a bug/typo in my usage..
___
Powered by www.kitware.com
Visit other Kitware open-source projects at
I can't say I share this experience. We use this mechanism to substitute
standard flags with less or more optimization and/or other options. Usually
-O3 instead of -O2, and I don't get them both on the commandline.
Arjen
From: Brian Davis [mailto:bitmi...@gmail.com]
Hi Brian,
We override the standard CMAKE_LANG_FLAGS (C CXX Fortran) and use it as a
baseline. Then, for individual source files it is possible to override them in
a separate file using:
set_source_files_properties(${CMAKE_BINARY_DIR}/path/to/file.f PROPERTIES
GENERATED TRUE COMPILE_FLAGS
We override the standard CMAKE_LANG_FLAGS (C CXX Fortran) and use it as a
baseline. Then, for individual source files it is possible to override them
in a separate file using:
Yes this is seemingly common practice in CMake land. The problem with this
approach is when using add_subdirectory
CMAKE_CXX_FLAGS..., CMAKE_C_FLAGS... and CMAKE_C_STANDARD_LIBRARIES_INIT and
friends are seemingly global variables. Is there a way to override (all of)
these on a per target basis? A method which is not tied to the directory
(properties). One that does not simply append such as COMPILE_FLAGS,