README.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. Docker
  7. ------
  8. The ``linux/<arch>/`` directories contain Docker specifications that anyone
  9. may use to produce Linux binaries for CMake:
  10. * ``linux/<arch>/base/Dockerfile``:
  11. Produces a base image with a build environment for portable CMake binaries.
  12. This image is published in the `kitware/cmake Docker Hub Repository`_
  13. with tag ``build-linux-<arch>-base-<date>``.
  14. * ``linux/<arch>/deps/Dockerfile``:
  15. Produces an image with custom-built dependencies for portable CMake binaries.
  16. This image is published in the `kitware/cmake Docker Hub Repository`_
  17. with tag ``build-linux-<arch>-deps-<date>``.
  18. * ``linux/<arch>/Dockerfile``:
  19. Produce an image containing a portable CMake binary package for Linux.
  20. Build this image using the CMake source directory as the build context.
  21. The resulting image will have an ``/out`` directory containing the package.
  22. For example:
  23. .. code-block:: console
  24. $ docker build --tag=cmake:build --network none \
  25. -f cmake-src/Utilities/Release/linux/$arch/Dockerfile cmake-src
  26. $ docker container create --name cmake-build cmake:build
  27. $ docker cp cmake-build:/out .
  28. $ ls out/cmake-*-Linux-$arch.*
  29. * ``linux/<arch>/test/Dockerfile``:
  30. Produces a base image with a test environment for packaged CMake binaries.
  31. For example, build the test base image:
  32. .. code-block:: console
  33. $ docker build --tag=cmake:test-base \
  34. cmake-src/Utilities/Release/linux/$arch/test
  35. Then create a local ``test/Dockerfile`` to prepare an image with both the
  36. CMake source tree and the above-built package::
  37. FROM cmake:test-base
  38. COPY cmake-src /opt/cmake/src/cmake
  39. ADD out/cmake-<ver>-Linux-<arch>.tar.gz /opt/
  40. ENV PATH=/opt/cmake-<ver>-Linux-<arch>/bin:$PATH
  41. Build the test image and run it to drive testing:
  42. .. code-block:: console
  43. $ docker build --tag cmake:test --network none -f test/Dockerfile .
  44. $ docker run --network none cmake:test bash test-make.bash
  45. $ docker run --network none cmake:test bash test-ninja.bash
  46. .. _`kitware/cmake Docker Hub Repository`: https://hub.docker.com/r/kitware/cmake
  47. Scripts for Kitware
  48. -------------------
  49. Kitware uses the following scripts to produce binaries for ``cmake.org``.
  50. They work only on specific machines Kitware uses for such builds.
  51. * ``create-cmake-release.cmake``:
  52. Run ``cmake -DCMAKE_CREATE_VERSION=$ver -P ../create-cmake-release.cmake``
  53. to generate ``create-$ver-*.sh`` release scripts. It also displays
  54. instructions to run them.
  55. * ``*_release.cmake``:
  56. Platform-specific settings used in corresponding scripts generated above.
  57. * ``release_cmake.cmake``:
  58. Code shared by all ``*_release.cmake`` scripts.
  59. * ``release_cmake.sh.in``:
  60. Template for script that runs on the actual build machines.