cmake/Utilities/Release/README.rst

93 lines
3.1 KiB
ReStructuredText
Raw Normal View History

2020-02-01 23:06:01 +01:00
CMake Release Utilities
***********************
This directory contains scripts used to package CMake itself for distribution
on ``cmake.org``. See also the `CMake Source Code Guide`_.
.. _`CMake Source Code Guide`: ../../Help/dev/source.rst
2021-09-14 00:13:48 +02:00
File Table
----------
The set of package files distributed on ``cmake.org`` varies by CMake version.
Clients providing automatic download functionality may query the set of
package files available using a special file that lists them:
* `File Table v1`_ Documentation
.. _`File Table v1`: files-v1.rst
2020-02-01 23:06:01 +01:00
Docker
------
2020-08-30 11:54:41 +02:00
The ``<os>/<arch>/`` directories contain Docker specifications that anyone
may use to produce binaries for CMake on the following platforms:
2020-02-01 23:06:01 +01:00
2020-08-30 11:54:41 +02:00
* ``linux/x86_64/``: Linux on ``x86_64`` architectures.
2022-08-04 22:12:04 +02:00
* ``linux/aarch64/``: Linux on ``aarch64`` architectures.
2020-08-30 11:54:41 +02:00
Each ``<os>/<arch>/`` directory contains the following:
* ``<os>/<arch>/base/Dockerfile``:
2020-02-01 23:06:01 +01:00
Produces a base image with a build environment for portable CMake binaries.
This image is published in the `kitware/cmake Docker Hub Repository`_
2020-08-30 11:54:41 +02:00
with tag ``build-<os>-<arch>-base-<date>``.
2020-02-01 23:06:01 +01:00
2020-08-30 11:54:41 +02:00
* ``<os>/<arch>/deps/Dockerfile``:
2020-02-01 23:06:01 +01:00
Produces an image with custom-built dependencies for portable CMake binaries.
This image is published in the `kitware/cmake Docker Hub Repository`_
2020-08-30 11:54:41 +02:00
with tag ``build-<os>-<arch>-deps-<date>``.
2020-02-01 23:06:01 +01:00
2020-08-30 11:54:41 +02:00
* ``<os>/<arch>/Dockerfile``:
Produce an image containing a portable CMake binary package.
2020-02-01 23:06:01 +01:00
Build this image using the CMake source directory as the build context.
2022-08-04 22:12:04 +02:00
The resulting image will have an ``/out`` directory
2020-08-30 11:54:41 +02:00
containing the package. For example, on Linux ``x86_64``:
2020-02-01 23:06:01 +01:00
.. code-block:: console
$ docker build --tag=cmake:build --network none \
2020-08-30 11:54:41 +02:00
-f cmake-src/Utilities/Release/linux/x86_64/Dockerfile cmake-src
2020-02-01 23:06:01 +01:00
$ docker container create --name cmake-build cmake:build
$ docker cp cmake-build:/out .
2021-09-14 00:13:48 +02:00
$ ls out/cmake-*-linux-x86_64.*
2020-02-01 23:06:01 +01:00
2020-08-30 11:54:41 +02:00
* ``<os>/<arch>/test/Dockerfile``:
2020-02-01 23:06:01 +01:00
Produces a base image with a test environment for packaged CMake binaries.
2020-08-30 11:54:41 +02:00
For example, on Linux ``x86_64``, one may build the test base image:
2020-02-01 23:06:01 +01:00
.. code-block:: console
$ docker build --tag=cmake:test-base \
2020-08-30 11:54:41 +02:00
cmake-src/Utilities/Release/linux/x86_64/test
2020-02-01 23:06:01 +01:00
Then create a local ``test/Dockerfile`` to prepare an image with both the
CMake source tree and the above-built package::
FROM cmake:test-base
COPY cmake-src /opt/cmake/src/cmake
2021-09-14 00:13:48 +02:00
ADD out/cmake-<ver>-linux-x86_64.tar.gz /opt/
ENV PATH=/opt/cmake-<ver>-linux-x86_64/bin:$PATH
2020-02-01 23:06:01 +01:00
Build the test image and run it to drive testing:
.. code-block:: console
$ docker build --tag cmake:test --network none -f test/Dockerfile .
$ docker run --network none cmake:test bash test-make.bash
$ docker run --network none cmake:test bash test-ninja.bash
.. _`kitware/cmake Docker Hub Repository`: https://hub.docker.com/r/kitware/cmake
2021-09-14 00:13:48 +02:00
macOS
-----
2020-02-01 23:06:01 +01:00
2021-09-14 00:13:48 +02:00
The ``macos/`` directory contains scripts used to produce dependencies
for building CMake binaries on macOS.
2022-08-04 22:12:04 +02:00
Windows
-------
The ``win/`` directory contains scripts used to produce dependencies
for building CMake binaries on Windows.