>Generally per-source flags should be reserved for tweaking >and workarounds such as using -O0 to disable buggy optimizations.
Well, I have lots of sources that don't work that way. These sources need flags defined that turn on and off certain features. Some of them won't even compile without the flags set. For an open-source example, take a look at RtAudio. You have to send in a flag that tells it what audio api to use on which OS. > 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. All the sources are going into a single *library*. I could make a bunch of static libraries corresponding to each folder, but I'm not sure how to subsequently link all them into a single static library. (It's been mentioned elsewhere on this list, but the answer was vague.) At any rate, it seems like a rather elaborate workaround... aaron _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake