How are CMake execute_process commands run?

后端 未结 1 1388
梦如初夏
梦如初夏 2020-12-20 10:11

I\'ve got the following lines in my CMakeLists.txt file. I\'m running CMake 3.5.2 on Windows 7, and using Visual Studio 12 2013 as the generator with \"Use default native co

相关标签:
1条回答
  • 2020-12-20 10:25

    CMake comes with Kitware's OS abstraction/detection library kwsys:

    KWSys provides a platform-independent API to many common system features that are implemented differently on every platform.

    The execute_process() magic is happening in ProcessWin32.c using CreateProcessW() or ProcessUNIX.c using execvp() depending of which version of CMake you are using.

    So - as @Tsyvarev has commented - your behavior could either be the Win32/64 version of CMake with MinGW/MSYS in the PATH environment (finding the Unix specific commands given) or the MinGW32/64 version of CMake run from MSYS.

    Also you may consider the use of something like the FindUnixCommands to get absolute paths to the Unix tools in question.

    Reference

    • CMake does not find custom command "ls"
    0 讨论(0)
提交回复
热议问题