[CMake] compiling single source with different flags

Bart bana at cs.cmu.edu
Tue Dec 29 15:17:11 EST 2009


Hi,

I'm trying to find a way to build a library with two different instances of the same source file.
for example I would like to compile foo.c with -DDINT into foo_int.o and with -DDLONG into foo_long.o
and have both objects added to the same library libfoo.a

I have experimented with custom command to generate the source files (which did not work), and would have still
left me with how to compile them with different -D flags.

So I would be interested to hear how I would be able to do this.

Thanks,

Bart


More information about the CMake mailing list