CMAKE_MAKE_PROGRAM.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 Makefile generators set this to ``make``, ``gmake``, or
  9. a generator-specific tool (e.g. ``nmake`` for "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 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 Xcode generator sets this to ``xcodebuild`` (or possibly an
  16. otherwise undocumented ``cmakexbuild`` wrapper implementing some
  17. workarounds).
  18. This generator stores ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  19. so that it may be edited by the user.
  20. * The Visual Studio generators set this to the full path to
  21. ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9),
  22. ``VCExpress.exe`` (VS Express 8,9), or ``msdev.exe`` (VS 6).
  23. (See also variables
  24. :variable:`CMAKE_VS_MSBUILD_COMMAND`,
  25. :variable:`CMAKE_VS_DEVENV_COMMAND`, and
  26. :variable:`CMAKE_VS_MSDEV_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 Windows Registry. It is also
  31. necessary because the proper build tool may depend on the
  32. project content (e.g. the Intel Fortran plugin to VS 10 and 11
  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 ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
  41. The value is also used by the :manual:`cmake(1)` ``--build`` and
  42. :manual:`ctest(1)` ``--build-and-test`` tools to launch the native
  43. build process.