[CMake] CONFIGURE_FILE, Windows and Native vs CMake Paths

Brian Davis bitminer at gmail.com
Sat Aug 7 23:45:33 EDT 2010


I am using configure_file to generate a batch file on the fly with CMake
based on location of Libs found (adding to PATH env var in batch script) and
I was wondering if there is a way to not have to create a lot of variables
for native paths such as below

--snip CMakelists.txt --
SET( GTK2_ROOT_DIR "C:/Program Files/Gtk+" )

file(TO_NATIVE_PATH ${GTK2_ROOT_DIR} GTK2_ROOT_DIR_NATIVE )

message( "\tConfiguring batch file" )
CONFIGURE_FILE( run_glade_test1.txt
${CMAKE_CURRENT_SOURCE_DIR}/run_glade_test1.bat )
--end snip--

-snip run_glade_test1.txt--
SET PWD=%CD%

set PATH=${GTK2_ROOT_DIR_NATIVE}\lib

GladeGTKTest2.exe

-end snip--

by default configure_file uses whatever the variable is set to and will not
convert to native when generating files.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100807/991adca3/attachment.htm>


More information about the CMake mailing list