[CMake] surprising new behaviour of cmake cvs - objectfilecreation

Andy Cedilnik andy.cedilnik at kitware.com
Wed Dec 8 16:26:41 EST 2004


Hi Alex,

Could you please try to specify full path to your sources?

You can do something like:

SET(srcs
  ${CMAKE_CURRENT_SOURCE_DIR}/../blah.cpp
  ${CMAKE_CURRENT_SOURCE_DIR}/../lib/foo.cpp
...)

of

SET(SRCS main.cpp ../blah.cpp ../lib/foo.cpp)
SET(srcs)
FOREACH(src ${SRCS})
  SET(srcs ${srcs} "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
ENDFOREACH(src)

As a part of another feature, we will add at some point in the future
support for setting source file property which is location of the object
file.

          Andy

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 :-) 
> 
>Bye 
>Alex 
> 
>
>  
>


-- 
Andy Cedilnik
Kitware Inc.



More information about the CMake mailing list