[CMake] configure_file behaves differently on Mac and Linux?

James C. Sutherland James.Sutherland at utah.edu
Thu Oct 22 10:37:07 EDT 2009


Thank you, Dave and Bill.  Your suggestions fixed the problem.  It  
seems that this is likely a bug that should be fixed, since the  
behavior is different on Mac and Linux.


On Oct 22, 2009, at 6:27 AM, Bill Hoffman wrote:

> James C. Sutherland wrote:
>> I am using configure_file to copy files during the build process.   
>> I have a nested directory structure, that can be represented as:
>>    /rootdir
>>      CMakeLists.txt
>>      /test
>>         CMakeLists.txt
>> When processing rootdir/test/CMakeLists.txt, I have the following:
>>    #---------------------------
>>    get_filename_component( dir ${CMAKE_CURRENT_LIST_FILE} PATH )
>>    configure_file( ${dir}/blessed.txt blessed.txt COPY_FILE )
>>    #---------------------------
>
> This should work:
>
> configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blessed.txt $ 
> {CMAKE_CURRENT_BINARY_DIR}/blessed.txt COPY_ONLY)
>
> Not sure why yours does not work, some message statements might show  
> what is going on...
>
>
> -Bill



More information about the CMake mailing list