1

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?

2
  • 1
    set(... CACHE FORCE)? Commented Mar 5, 2018 at 6:12
  • @arrowd Unfortunately, it reminds me "set given invalid arguments for CACHE mode.". Commented Mar 5, 2018 at 7:43

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.