[CMake] surprising new behaviour of cmake cvs - objectfilecreation

William A. Hoffman billlist at nycap.rr.com
Wed Dec 8 16:25:42 EST 2004


At 03:50 PM 12/8/2004, Alexander Neundorf wrote:
>> Hi Alex, 
>>  
>>This was desired behavior from beginning, but because of bug in CMake it 
>> didn't work when you use SET_SOURCE_FILES_PROPERTIES. I suspect you are 
>> using CVS CMake, which means that the fix that Ken put in to fix the 
>> problem made your thing work the way it should. 
>>  
>>So, the simple explanation, CMake does what it should. If your source is 
>> in subdirectory, then your object file will also be. 
>>  
>> Is this behavior problematic for you? 
> 
>Yes, very. 
>Our whole build system relies on the fact that I can compile the source 
>files from different compile directories (where the CMakeLists.txt 
>reside) and they all end up in their specific compile directory. 
>In each "compile directory" we have CMakeLists.txt which compile the 
>source files differently, i.e. with different optimization settings, 
>debugging on/off, and especially for different target hardware. 
> 
>Hmmm, what to do now... 
>I'd like to have the old behaviour back or a switch to reenable it. 
>Having to do SET_SOURCE_FILE_PROPERTY() for each of the files would also 
>be possible, but I'd like to avoid this (makes things go slower) 
> 
>Until then I'd like to revert the patch on my local copy. 
>webcvs for cmake cvs would be nice :-) 
> 


One solution would be to use full paths.   If you did:
${PROJECT_SOURCE_DIR}/dir/blah.c

Then it would work.  Only relative paths are preserved in the .o files.

-Bill




More information about the CMake mailing list