[CMake] Re: one source file should depend on every other

Brandon J. Van Every bvanevery at gmail.com
Thu Apr 12 18:39:18 EDT 2007


Matthew Woehlke wrote:
> Denis Stuenkel wrote:
>> currently my CMakeLists.txt looks basically like this:
>>
>>   file(GLOB sources *.cc)
>>   add_executable(myprog ${sources})
>>
>> One of these cc-files just contains:
>>
>>   const char* build_date() {return __DATE__;}
>>
>> The obvious problem here is that this build-date doesn't change
>> because the object stays the same until I make a change to that
>> specific source file.
>>
>> How can I tell cmake that I want this file to be rebuilt every
>> time I make a change to one of the other source files?
>
> It sounds like you want to "See the OBJECT_DEPENDS option in 
> SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object 
> files." I.e. make the object of your build_date source depend on every 
> other source.
>

Setting OBJECT_DEPENDS is archaic.  I doubt this is adviseable.


Cheers,
Brandon Van Every



More information about the CMake mailing list