CMAKE_MAKE_PROGRAM.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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`` (or possibly an
  16. otherwise undocumented ``cmakexbuild`` wrapper implementing some
  17. workarounds).
  18. This generator prefers to lookup the build tool at build time
  19. rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  20. ahead of time. This is because ``xcodebuild`` is easy to find,
  21. the ``cmakexbuild`` wrapper is needed only for older Xcode versions,
  22. and the path to ``cmakexbuild`` may be outdated if CMake itself moves.
  23. For compatibility with versions of CMake prior to 3.2, if
  24. a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
  25. the CMake cache then CMake will use the specified value.
  26. * The :ref:`Visual Studio Generators` set this to the full path to
  27. ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9), or
  28. ``VCExpress.exe`` (VS Express 8,9).
  29. (See also variables
  30. :variable:`CMAKE_VS_MSBUILD_COMMAND` and
  31. :variable:`CMAKE_VS_DEVENV_COMMAND`.
  32. These generators prefer to lookup the build tool at build time
  33. rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
  34. ahead of time. This is because the tools are version-specific
  35. and can be located using the Windows Registry. It is also
  36. necessary because the proper build tool may depend on the
  37. project content (e.g. the Intel Fortran plugin to VS 10 and 11
  38. requires ``devenv.com`` to build its ``.vfproj`` project files
  39. even though ``MSBuild.exe`` is normally preferred to support
  40. the :variable:`CMAKE_GENERATOR_TOOLSET`).
  41. For compatibility with versions of CMake prior to 3.0, if
  42. a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
  43. the CMake cache then CMake will use the specified value if
  44. possible.
  45. * The :generator:`Green Hills MULTI` generator sets this to ``gbuild``.
  46. If a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to
  47. the CMake cache then CMake will use the specified value.
  48. The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
  49. The value is also used by the :manual:`cmake(1)` ``--build`` and
  50. :manual:`ctest(1)` ``--build-and-test`` tools to launch the native
  51. build process.