[CMake] compiler flag property overwriting parents' settings in VS 2010
Shiqing Fan
fan at hlrs.de
Fri Jul 30 08:28:10 EDT 2010
Hi,
With CMake 2.8.2 and Visual Studio 2010, it seems that using compiler
flag property in set_source_files_properties will overwrite the
inherited properties in some cases.
For example, in one cmake project, we have a global setting of include
headers:
include_headers(${global_include_path})
for some of the source files in this project, we have:
set_source_files_properties(source1.c PROPERTIES COMPILE_FLAGS
"/I${local_include_path}")
with this settings, we want source1.c have both ${global_include_path}
and ${local_include_path} included, this is only possible with Visual
Studio 2008, but not Visual Studio 2010, ${global_include_path} is not
inherited for source1.c, I have to manually change the property of
source1.c in VS 2010.
It says in CMake document, for set_source_files_properties command :
"COMPILE_FLAGS (string) is passed to the compiler as additional command
line arguments when the source file is compiled. " But it's not true for
me in Visual Studio 2010. The "additional command line arguments" is
overwriting the inherited ones.
I don't know if this has been posted or not, I didn't find any solution
for this. Does any one know how can I solve this problem? Thanks a lot.
Shiqing
More information about the CMake
mailing list