问题描述
由于用于嵌入式开发的多个工具链,我的路径中的sh.exe和make.exe不兼容。我想强制使用不在我的路径中的那个。
I have incompatible sh.exe and make.exe in my path due to multiple toolchains for embedded development. I want to force use of the one not in my path.
cmake使用错误的make(路径中的那个)检查GCC功能,因此我可以强制使用正确的用 SET(CMAKE_MAKE_PROGRAM ... / make.exe)制作
cmake used the wrong make (the one in the path) to check GCC functionnality and I could force the correct make with SET(CMAKE_MAKE_PROGRAM .../make.exe)
如何对sh.exe执行相同操作?
How to do the same for sh.exe ?
推荐答案
将我的评论变成答案
要使CMake忽略路径中的工具链,可以使用类似于:
To make CMake to ignore the toolchain in your path you can utilize CMAKE_IGNORE_PATH
with something like:
cmake -DCMAKE_IGNORE_PATH="/path/to/your/toolchain/bin" ..
请注意,该路径必须是与路径完全匹配的字符串(以CMake格式加上 /
斜杠,并且区分大小写)。
Just be aware that the path has to be exact string match for the path (in CMake format with /
slashes and it's case sensitive).
For more details: Environment variable used by CMake to detect Visual C++ compiler tools for Ninja
这篇关于强制cmake特定的sh路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!