[CMake] scope of set_source_files_properties?

Brad King brad.king at kitware.com
Tue Mar 23 11:24:09 EDT 2010


Brad King wrote:
> Simmons, Aaron wrote:
>> Lots of these subfolders have per-source flags/args
>>
>> Is there some other way to go about doing this?
> 
> Generally per-source flags should be reserved for tweaking and
> workarounds such as using -O0 to disable buggy optimizations.
> Their Makefile and VS project file implementations are not
> scalable (as in changing one flag on one file causes the whole
> target to recompile).
> 
> Are all these sources going into a single executable?
> If so, I suggest using an add_library() to create a static
> library for each feature.  Then link the executable to all
> of them.

Oh, and then you can specify per-feature flags as target
flags on each static library.

-Brad


More information about the CMake mailing list