Why doesn't “CMAKE_MAKE_PROGRAM” variable take effect?

戏子无情 提交于 2020-06-28 12:03:31

问题


I try to use gmake instead of make as the build command. So I modify the CMakeList.txt as following:

......
set(CMAKE_MAKE_PROGRAM /usr/local/bin/gmake)
......

While in CMakeCache.txt, CMAKE_MAKE_PROGRAM is still /usr/bin/make:

//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make

How to make "CMAKE_MAKE_PROGRAM" variable take effect?


回答1:


You have two options:

1: Set the make command when you call CMake: cmake -DCMAKE_MAKE_PROGRAM=gmake <the rest of your arguments>

2: Do as @arrowd hinted in the comments, but use the correct syntax: set(CMAKE_MAKE_PROGRAM gmake CACHE FILEPATH "" FORCE) or set(CMAKE_MAKE_PROGRAM gmake CACHE INTERNAL ""). The latter will hide the setting from cmake-gui.

Both of these assume that gmake is in your PATH, othwerwise you must specify a full path to gmake.



来源:https://stackoverflow.com/questions/49103936/why-doesnt-cmake-make-program-variable-take-effect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!