You can use CONFIGURE_FILE to copy the file:

IF(CMAKE_CONFIGURATION_TYPES)
  # Handle multi-configuration generators.
  FOREACH(config ${CMAKE_CONFIGURATION_TYPES})
    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/my.config.in,
                   ${CMAKE_CURRENT_BINARY_DIR}/${config}/my.config)
  ENDFOREACH(config)
ELSE(CMAKE_CONFIGURATION_TYPES)
  # Handle single-configuration generators.
  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/my.config.in,
                 ${CMAKE_CURRENT_BINARY_DIR}/my.config)
ENDIF(CMAKE_CONFIGURATION_TYPES)


Excellent!  Thanks very much for this info.
I'm seeing a problem, though.
CMake is not finding my config file, even though it does exist.
CMake announces its search with forward-slash paths, but I'm in the VS C++ IDE.
Is CMake not actually looking for:

 c:\Temp\traps.p01\trunk\TRAPS2\traps_config.txt

(I guess not, or it would find it, because the file does exist there.)

Is this a bug, or a driver error of some sort?


Below is the CMake output from the Build -
____________________________________


Deleting intermediate files and output files for project 'jklib2', configuration 'Debug|Win32'.
Building Custom Rule c:/Temp/traps.p01/trunk/JKLIB2/CMakeLists.txt
CMake Error: File c:/Temp/traps.p01/trunk/TRAPS2/traps_config.txt, does not exist.
CMake Error: Error in cmake code at
c:/Temp/traps.p01/trunk/TRAPS2/CMakeLists.txt:28:
CONFIGURE_FILE Problem configuring file
CMake Error: File c:/Temp/traps.p01/trunk/TRAPS2/traps_config.txt, does not exist.
CMake Error: Error in cmake code at
c:/Temp/traps.p01/trunk/TRAPS2/CMakeLists.txt:28:
CONFIGURE_FILE Problem configuring file
CMake Error: File c:/Temp/traps.p01/trunk/TRAPS2/traps_config.txt, does not exist.
CMake Error: Error in cmake code at
c:/Temp/traps.p01/trunk/TRAPS2/CMakeLists.txt:28:
CONFIGURE_FILE Problem configuring file
CMake Error: File c:/Temp/traps.p01/trunk/TRAPS2/traps_config.txt, does not exist.
CMake Error: Error in cmake code at
c:/Temp/traps.p01/trunk/TRAPS2/CMakeLists.txt:28:
CONFIGURE_FILE Problem configuring file
-- Configuring done

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to