[CMake] problem: using options other than -D with VS.NET

Brad King brad.king at kitware.com
Fri Oct 15 14:08:46 EDT 2004


Erik van der Wal wrote:
> According to the documentation:
> "Adds flags to command line of C and C++ compilers. This command can be 
> used to add any flag to a compile line, but the -D flag is accepted most 
> C/C++ compilers. Other flags may not be as portable."

I'll replace the documentation for the next version.

> 2) Is is possible to change this .NET generator to only accept -D 
> options, disregarding any other option? Preferably it should also give a 
> warning message saying it did disregard some flags.

The proper fix is probably to create a new command that doesn't take the 
-D options explicitly and then deprecate the original command.

> 3) You did not state a workaround. Is SET_SOURCE_FILES_PROPERTIES the 
> way to go?

SET_SOURCE_FILES_PROPERTIES(
   file1 file2 ...
   PROPERTIES
   COMPILE_FLAGS "/Yu\"test.h\""
)

-Brad


More information about the CMake mailing list