[CMake] MSYS EXEC_PROGRAM() or EXECUTE_PROCESS() fails

Peter Visser pervulgo at gmail.com
Tue Sep 12 16:01:40 EDT 2006


I just "discovered" cmake, I find cmake easy to setup and it works
fantastic.
However, a small problem occurs. I'm using: cmake 2.4-patch3 under
MSYS-1.0.10.

The problem occurs when using EXEC_PROGRAM() or EXECUTE_PROCESS().
Instead of "sh.exe" from MSYS being used to execute the program "cmd.exe"
from windows is being used.
This results in an error if the binary doesn't run under windows natively
e.g. wx-config. (e.g. FIND_PACKAGE(wxWidgets) will not work)
It can be solved by
Changing:
 EXEC_PROGRAM(wx-config
        ARGS "--cxxflags"
        OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
        RETURN_VALUE RET)
Into:
 EXEC_PROGRAM(sh
        ARGS "wx-config --cxxflags"
        OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
        RETURN_VALUE RET)

Most likely I'm doing something wrong, is there a switch/macro or calling
cmake with an argument to solve this?

Any help appreciated, Peter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060912/185a57b8/attachment.htm


More information about the CMake mailing list