Simmons, Aaron wrote:
> You have to send in a flag that tells it what audio api to use on which OS.

We rarely create source files that depend on definitions from the command line
to function (which is one reason per-source flags are not solid in CMake).
Instead we use configure_file() to put options in header files which then
get included by the sources.  It's much more reliable because the configured
header gets included in dependency scanning.

>> 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.)

That's a "convenience" library approach, and it's not really supported
(partly because there is no way to implement it on some toolchains such
as MSVC).

-Brad
_______________________________________________
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

Reply via email to