[CMake] Selectively adding source files and compiling assembly sources

Johannes Bauer dfnsonfsduifb at gmx.de
Mon May 28 12:32:50 EDT 2012


On 28.05.2012 11:34, Alexander Neundorf wrote:

>> the only solution I can think of is something like:
>>
>> #
>> option(WITH_A ...)
>> option(WITH_B ...)
>>
>> set(MySources always/present/files ...)
>>
>> if(WITH_A)
>>   list(APPEND MySources files/for/a ...)
>> endif()
>>
>> if(WITH_B)
>>   list(APPEND MySources files/for/b ...)
>> endif()
>>
>> add_executable(MyExec ${MySources})
> 
> Yes, that's the way t do it.

Perfect, works nicely.

>> I have never used assembler files, so I can't comment there,
> 
> Did you enable the ASM language ?

I had not. :-/

Thank you two very much!
Best regards,
Joe


More information about the CMake mailing list