README.rst 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. CMake Release Utilities
  2. ***********************
  3. This directory contains scripts used to package CMake itself for distribution
  4. on ``cmake.org``. See also the `CMake Source Code Guide`_.
  5. .. _`CMake Source Code Guide`: ../../Help/dev/source.rst
  6. File Table
  7. ----------
  8. The set of package files distributed on ``cmake.org`` varies by CMake version.
  9. Clients providing automatic download functionality may query the set of
  10. package files available using a special file that lists them:
  11. * `File Table v1`_ Documentation
  12. .. _`File Table v1`: files-v1.rst
  13. Docker
  14. ------
  15. The ``<os>/<arch>/`` directories contain Docker specifications that anyone
  16. may use to produce binaries for CMake on the following platforms:
  17. * ``linux/x86_64/``: Linux on ``x86_64`` architectures.
  18. * ``win/x86/``: Windows on ``x86_64`` and ``i386`` architectures.
  19. Each ``<os>/<arch>/`` directory contains the following:
  20. * ``<os>/<arch>/base/Dockerfile``:
  21. Produces a base image with a build environment for portable CMake binaries.
  22. This image is published in the `kitware/cmake Docker Hub Repository`_
  23. with tag ``build-<os>-<arch>-base-<date>``.
  24. * ``<os>/<arch>/deps/Dockerfile``:
  25. Produces an image with custom-built dependencies for portable CMake binaries.
  26. This image is published in the `kitware/cmake Docker Hub Repository`_
  27. with tag ``build-<os>-<arch>-deps-<date>``.
  28. * ``<os>/<arch>/Dockerfile``:
  29. Produce an image containing a portable CMake binary package.
  30. Build this image using the CMake source directory as the build context.
  31. The resulting image will have an ``/out`` (or ``c:/out``) directory
  32. containing the package. For example, on Linux ``x86_64``:
  33. .. code-block:: console
  34. $ docker build --tag=cmake:build --network none \
  35. -f cmake-src/Utilities/Release/linux/x86_64/Dockerfile cmake-src
  36. $ docker container create --name cmake-build cmake:build
  37. $ docker cp cmake-build:/out .
  38. $ ls out/cmake-*-linux-x86_64.*
  39. On Windows, the ``win/x86`` specifications support both the ``x86_64``
  40. and ``i386`` architectures selected via ``--build-arg ARCH=...``.
  41. * ``<os>/<arch>/test/Dockerfile``:
  42. Produces a base image with a test environment for packaged CMake binaries.
  43. For example, on Linux ``x86_64``, one may build the test base image:
  44. .. code-block:: console
  45. $ docker build --tag=cmake:test-base \
  46. cmake-src/Utilities/Release/linux/x86_64/test
  47. Then create a local ``test/Dockerfile`` to prepare an image with both the
  48. CMake source tree and the above-built package::
  49. FROM cmake:test-base
  50. COPY cmake-src /opt/cmake/src/cmake
  51. ADD out/cmake-<ver>-linux-x86_64.tar.gz /opt/
  52. ENV PATH=/opt/cmake-<ver>-linux-x86_64/bin:$PATH
  53. Build the test image and run it to drive testing:
  54. .. code-block:: console
  55. $ docker build --tag cmake:test --network none -f test/Dockerfile .
  56. $ docker run --network none cmake:test bash test-make.bash
  57. $ docker run --network none cmake:test bash test-ninja.bash
  58. On Windows, the test scripts are called ``test-nmake.bat`` and
  59. ``test-ninja.bat``. In the ``x86`` architecture they accept one
  60. argument specifying either ``x86_64`` or ``i386``.
  61. .. _`kitware/cmake Docker Hub Repository`: https://hub.docker.com/r/kitware/cmake
  62. macOS
  63. -----
  64. The ``macos/`` directory contains scripts used to produce dependencies
  65. for building CMake binaries on macOS.