README.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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/cmake/help/documentation.html
  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`: http://www.kitware.com/cmake
  15. License
  16. =======
  17. CMake is distributed under the OSI-approved BSD 3-clause License.
  18. See `Copyright.txt`_ for details.
  19. .. _`Copyright.txt`: Copyright.txt
  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. Subscribe and post to the `CMake Users List`_ to ask if others have
  34. had experience with the platform.
  35. .. _`CMake Users List`: https://cmake.org/mailman/listinfo/cmake
  36. Building CMake from Scratch
  37. ---------------------------
  38. UNIX/Mac OSX/MinGW/MSYS/Cygwin
  39. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  40. You need to have a C++ compiler (supporting C++11) and a ``make`` installed.
  41. Run the ``bootstrap`` script you find in the source directory of CMake.
  42. You can use the ``--help`` option to see the supported options.
  43. You may use the ``--prefix=<install_prefix>`` option to specify a custom
  44. installation directory for CMake. Once this has finished successfully,
  45. run ``make`` and ``make install``.
  46. For example, if you simply want to build and install CMake from source,
  47. you can build directly in the source tree::
  48. $ ./bootstrap && make && sudo make install
  49. Or, if you plan to develop CMake or otherwise run the test suite, create
  50. a separate build tree::
  51. $ mkdir cmake-build && cd cmake-build
  52. $ ../cmake-source/bootstrap && make
  53. Windows
  54. ^^^^^^^
  55. There are two ways for building CMake under Windows:
  56. 1. Compile with MSVC from VS 2015 or later.
  57. You need to download and install a binary release of CMake. You can get
  58. these releases from the `CMake Download Page`_. Then proceed with the
  59. instructions below for `Building CMake with CMake`_.
  60. 2. Bootstrap with MinGW under MSYS2.
  61. Download and install `MSYS2`_. Then install the required build tools::
  62. $ pacman -S --needed git base-devel mingw-w64-x86_64-gcc
  63. and bootstrap as above.
  64. .. _`CMake Download Page`: https://cmake.org/cmake/resources/software.html
  65. .. _`MSYS2`: https://www.msys2.org/
  66. Building CMake with CMake
  67. -------------------------
  68. You can build CMake as any other project with a CMake-based build system:
  69. run the installed CMake on the sources of this CMake with your preferred
  70. options and generators. Then build it and install it.
  71. For instructions how to do this, see documentation on `Running CMake`_.
  72. .. _`Running CMake`: https://cmake.org/cmake/help/runningcmake.html
  73. To build the documentation, install `Sphinx`_ and configure CMake with
  74. ``-DSPHINX_HTML=ON`` and/or ``-DSPHINX_MAN=ON`` to enable the "html" or
  75. "man" builder. Add ``-DSPHINX_EXECUTABLE=/path/to/sphinx-build`` if the
  76. tool is not found automatically.
  77. .. _`Sphinx`: http://sphinx-doc.org
  78. Reporting Bugs
  79. ==============
  80. If you have found a bug:
  81. 1. If you have a patch, please read the `CONTRIBUTING.rst`_ document.
  82. 2. Otherwise, please join the `CMake Users List`_ and ask about
  83. the expected and observed behaviors to determine if it is really
  84. a bug.
  85. 3. Finally, if the issue is not resolved by the above steps, open
  86. an entry in the `CMake Issue Tracker`_.
  87. .. _`CMake Issue Tracker`: https://gitlab.kitware.com/cmake/cmake/issues
  88. Contributing
  89. ============
  90. See `CONTRIBUTING.rst`_ for instructions to contribute.
  91. .. _`CONTRIBUTING.rst`: CONTRIBUTING.rst