MantisBT - CMake
View Issue Details
0009765CMakeCMakepublic2009-10-22 12:332009-10-22 17:40
James Sutherland 
 
normalminoralways
closedwon't fix 
CMake-2-6 
 
0009765: configure_file behaves differently on Mac and Linux
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 )
#---------------------------

The intention is to copy the file "blessed.txt" from the source tree to the build tree prior to running a regression test.

On Mac, this works as I intend it to. The file "blessed.txt" is copied to the "test" subdirectory in the build tree.

On Linux, "blessed.txt" is copied to the top-level directory in the build tree, NOT to the "test" subdirectory.
The attached file is a very simple project that reproduces this behavior. On Mac it functions as expected, on Linux, it does not.
No tags attached.
zip MyProject.zip (2,724) 2009-10-22 12:33
https://public.kitware.com/Bug/file/2591/MyProject.zip
Issue History
2009-10-22 12:33James SutherlandNew Issue
2009-10-22 12:33James SutherlandFile Added: MyProject.zip
2009-10-22 17:40Bill HoffmanNote Added: 0018199
2009-10-22 17:40Bill HoffmanStatusnew => closed
2009-10-22 17:40Bill HoffmanResolutionopen => won't fix

Notes
(0018199)
Bill Hoffman   
2009-10-22 17:40   
OK, so in CVS and 2.8 this works. For 2.6 and below you have to specify the full path to the output file, or it uses the current directory that cmake was run in.