Hi Eric, Your solution is one possibility to tackle my problem.
What I am trying to accomplish is to record version information into some (but not all) of the libraries/executables in my project. So, this version file -- let's call it version.cc -- may, or may not be part of the list of sources to add to a library. Moreover, version.cc is generated, based on information from, a.o., Subversion. I just re-read the thread "Embedding up-to-date version info in built library" from mid-December 2009. I think I'll have to study that solution more carefully, cause the subject is very close to what I'm currently facing. Best regards, Marcel Loose. On Mon, 2010-01-11 at 11:14 +0100, Eric Noulard wrote: > 2010/1/11 Marcel Loose <lo...@astron.nl>: > > Too bad. I was hoping I could do this without having to use a list > > variable to collect all my sources. In my case, the use of conditionals > > is somewhat awkward. > > Personnally I sometime use several variable like: > > add_library(blah > ${BLAH_SOURCE} > ${BLAH_SOURCE_OPT1} > ${BLAH_SOURCE_OPT2} > ${BLAH_SOURCE_OPT3}) > > xxx_OPTy var may contains source or may be void and off course > should be defined BEFORE add_library is called. > > It is mostly like conditionnally adding the same content to a list but > may required less conditionnal because xxx_OPTy may defaulted to void content. > > Would you explain us why you need to add source AFTER add_library > and may be why conditionnal is awkward? _______________________________________________ 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