CMAKE_MAKE_PROGRAM.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. CMAKE_MAKE_PROGRAM
  2. ------------------
  3. Tool that can launch the native build system.
  4. The value may be the full path to an executable or just the tool
  5. name if it is expected to be in the ``PATH``.
  6. The tool selected depends on the :variable:`CMAKE_GENERATOR` used
  7. to configure the project:
  8. * The :ref:`Makefile Generators` set this to ``make``, ``gmake``, or
  9. a generator-specific tool (e.g. ``nmake`` for :generator:`NMake Makefiles`).
  10. These generators store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  11. so that it may be edited by the user.
  12. * The :generator:`Ninja` generator sets this to ``ninja``.
  13. This generator stores ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  14. so that it may be edited by the user.
  15. * The :generator:`Xcode` generator sets this to ``xcodebuild``.
  16. This generator prefers to lookup the build tool at build time
  17. rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  18. ahead of time. This is because ``xcodebuild`` is easy to find.
  19. For compatibility with versions of CMake prior to 3.2, if
  20. a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
  21. the CMake cache then CMake will use the specified value.
  22. * The :ref:`Visual Studio Generators` set this to the full path to
  23. ``MSBuild.exe`` or ``devenv.com``.
  24. (See also variables
  25. :variable:`CMAKE_VS_MSBUILD_COMMAND` and
  26. :variable:`CMAKE_VS_DEVENV_COMMAND`.
  27. These generators prefer to lookup the build tool at build time
  28. rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  29. ahead of time. This is because the tools are version-specific
  30. and can be located using the Visual Studio Installer. It is also
  31. necessary because the proper build tool may depend on the
  32. project content (e.g. the Intel Fortran plugin to Visual Studio
  33. requires ``devenv.com`` to build its ``.vfproj`` project files
  34. even though ``MSBuild.exe`` is normally preferred to support
  35. the :variable:`CMAKE_GENERATOR_TOOLSET`).
  36. For compatibility with versions of CMake prior to 3.0, if
  37. a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
  38. the CMake cache then CMake will use the specified value if
  39. possible.
  40. * The :generator:`Green Hills MULTI` generator sets this to the full
  41. path to ``gbuild.exe(Windows)`` or ``gbuild(Linux)`` based upon
  42. the toolset being used.
  43. Once the generator has initialized a particular value for this
  44. variable, changing the value has undefined behavior.
  45. The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
  46. The value is also used by the :option:`cmake --build` and
  47. :option:`ctest --build-and-test` tools to launch the native
  48. build process.