You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.9 KiB

  1. CMake
  2. *****
  3. Introduction
  4. ============
  5. CMake is a cross-platform, open-source build system generator.
  6. For full documentation visit the `CMake Home Page`_ and the
  7. `CMake Documentation Page`_. The `CMake Community Wiki`_ also
  8. references useful guides and recipes.
  9. .. _`CMake Home Page`: https://cmake.org
  10. .. _`CMake Documentation Page`: https://cmake.org/documentation
  11. .. _`CMake Community Wiki`: https://gitlab.kitware.com/cmake/community/-/wikis/home
  12. CMake is maintained and supported by `Kitware`_ and developed in
  13. collaboration with a productive community of contributors.
  14. .. _`Kitware`: https://www.kitware.com/cmake
  15. License
  16. =======
  17. CMake is distributed under the OSI-approved BSD 3-clause License.
  18. See `LICENSE.rst`_ for details.
  19. .. _`LICENSE.rst`: LICENSE.rst
  20. Building CMake
  21. ==============
  22. Supported Platforms
  23. -------------------
  24. * Microsoft Windows
  25. * Apple macOS
  26. * Linux
  27. * FreeBSD
  28. * OpenBSD
  29. * Solaris
  30. * AIX
  31. Other UNIX-like operating systems may work too out of the box, if not
  32. it should not be a major problem to port CMake to this platform.
  33. Please post to the `CMake Discourse Forum`_ to ask if others have
  34. had experience with the platform.
  35. .. _`CMake Discourse Forum`: https://discourse.cmake.org
  36. Building CMake with CMake
  37. -------------------------
  38. You can build CMake as any other project with a CMake-based build system:
  39. run an already-installed CMake on this source tree with your preferred
  40. generator and options. Then build it and install it.
  41. To build the documentation, install `Sphinx`_ and configure CMake with
  42. ``-DSPHINX_HTML=ON`` and/or ``-DSPHINX_MAN=ON`` to enable the "html" or
  43. "man" builder. Add ``-DSPHINX_EXECUTABLE=/path/to/sphinx-build`` if the
  44. tool is not found automatically.
  45. To run the test suite, run ``ctest`` in the CMake build directory after
  46. building. See the `CMake Testing Guide`_ for details.
  47. .. _`Sphinx`: https://sphinx-doc.org
  48. .. _`CMake Testing Guide`: Help/dev/testing.rst
  49. Building CMake from Scratch
  50. ---------------------------
  51. UNIX/Mac OSX/MinGW/MSYS/Cygwin
  52. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  53. You need to have a C++ compiler (supporting C++11) and a ``make`` installed.
  54. Run the ``bootstrap`` script you find in the source directory of CMake.
  55. You can use the ``--help`` option to see the supported options.
  56. You may use the ``--prefix=<install_prefix>`` option to specify a custom
  57. installation directory for CMake. Once this has finished successfully,
  58. run ``make`` and ``make install``.
  59. For example, if you simply want to build and install CMake from source,
  60. you can build directly in the source tree::
  61. $ ./bootstrap && make && sudo make install
  62. Or, if you plan to develop CMake or otherwise run the test suite, create
  63. a separate build tree::
  64. $ mkdir build && cd build
  65. $ ../bootstrap && make
  66. Windows
  67. ^^^^^^^
  68. There are two ways for building CMake under Windows:
  69. 1. Compile with MSVC from VS 2015 or later.
  70. You need to download and install a binary release of CMake. You can get
  71. these releases from the `CMake Download Page`_. Then proceed with the
  72. instructions above for `Building CMake with CMake`_.
  73. 2. Bootstrap with MinGW under MSYS2.
  74. Download and install `MSYS2`_. Then install the required build tools::
  75. $ pacman -S --needed git base-devel mingw-w64-x86_64-gcc
  76. and bootstrap as above.
  77. .. _`CMake Download Page`: https://cmake.org/download
  78. .. _`MSYS2`: https://www.msys2.org/
  79. Reporting Bugs
  80. ==============
  81. If you have found a bug:
  82. 1. If you have a patch, please read the `CONTRIBUTING.rst`_ document.
  83. 2. Otherwise, please post to the `CMake Discourse Forum`_ and ask about
  84. the expected and observed behaviors to determine if it is really
  85. a bug.
  86. 3. Finally, if the issue is not resolved by the above steps, open
  87. an entry in the `CMake Issue Tracker`_.
  88. .. _`CMake Issue Tracker`: https://gitlab.kitware.com/cmake/cmake/-/issues
  89. Contributing
  90. ============
  91. See `CONTRIBUTING.rst`_ for instructions to contribute.
  92. .. _`CONTRIBUTING.rst`: CONTRIBUTING.rst