CMAKE_MAKE_PROGRAM.rst 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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`` (VS >= 10), ``devenv.com`` (VS 7,8,9), or
  24. ``VCExpress.exe`` (VS Express 8,9).
  25. (See also variables
  26. :variable:`CMAKE_VS_MSBUILD_COMMAND` and
  27. :variable:`CMAKE_VS_DEVENV_COMMAND`.
  28. These generators prefer to lookup the build tool at build time
  29. rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  30. ahead of time. This is because the tools are version-specific
  31. and can be located using the Windows Registry. It is also
  32. necessary because the proper build tool may depend on the
  33. project content (e.g. the Intel Fortran plugin to VS 10 and 11
  34. requires ``devenv.com`` to build its ``.vfproj`` project files
  35. even though ``MSBuild.exe`` is normally preferred to support
  36. the :variable:`CMAKE_GENERATOR_TOOLSET`).
  37. For compatibility with versions of CMake prior to 3.0, if
  38. a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
  39. the CMake cache then CMake will use the specified value if
  40. possible.
  41. * The :generator:`Green Hills MULTI` generator sets this to the full
  42. path to ``gbuild.exe(Windows)`` or ``gbuild(Linux)`` based upon
  43. the toolset being used.
  44. Once the generator has initialized a particular value for this
  45. variable, changing the value has undefined behavior.
  46. The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
  47. The value is also used by the :manual:`cmake(1)` ``--build`` and
  48. :manual:`ctest(1)` ``--build-and-test`` tools to launch the native
  49. build process.