强制cmake特定的sh路径

强制cmake特定的sh路径

本文介绍了强制cmake特定的sh路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于用于嵌入式开发的多个工具链,我的路径中的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路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!