Hi,<br><br>This could well be a silly question. I'm having some issues with
execute_process() on windows platforms. Below is a small test program
with output on windows and linux. The only command i can get to work on
windows is "hostname", everything else i've tried gives the output below
(internal and external dos commands, and other commands such as Matlabs
mexext). All the commands work properly in the dos command shell. Under
unix it all seems to work as expected.
<br>
<br>Is there anything obvious that needs to set up etc for this to work
under windows? <br><br>If i add <br> message("$ENV{PATH}") <br>to the small test below it correctly prints out the full path on both windows and unix.
<br><br>Thanks in advance.
<br>
<br>
<br># start test execute_process #######################################
<br>
<br>cmake_minimum_required (VERSION 2.6)
<br>project ("test execute_process")
<br>
<br>execute_process(COMMAND "ver" RESULT_VARIABLE result
<br> OUTPUT_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE
<br> ERROR_VARIABLE error)
<br>
<br>message( "result = " ${result} )
<br>message( "output = " ${output} )
<br>message( "error = " ${error} )
<br>
<br>
<br># end test execute_process ########################################
<br><br><br>Output on Windows XP i686 and Windows 7 x86_64 with cmake 2.8.1
gui<br>------------------------------------------------------------------------------------<br>
<br>Here is the output with the ver, "date /t", mexext etc.
<br>The only command that worked was hostname.<br>
<br>result = The system cannot find the file specified <br>output =
<br>error =
<br>Configuring done
<br>
<br>
<br>Output on Unix - Linux Fedora core 11 x86_64 cmake 2.6-patch 4
gui<br>-------------------------------------------------------------------------------------<br>
<br>Used identical CMakeLists.txt file except replaced with a suitable unix
command. e.g. here is the output with "date". Every command tried worked correctly.
<br>
<br>
<br>result = 0
<br>output = Fri Jul 30 13:21:48 NZST 2010
<br>error =
<br>-- Configuring done
<br><br><br>