docs(cmake): describe the fixed CMake behavior

- Remove the notes about the empty FairMQ_PACKAGE_COMPONENTS, the typo in
  the Boost.Asio definition, the unused IWYU variable and the
  installed start scripts
- Document that the installed scripts use the install-time prefix and
  that FairMQ no longer sets CMAKE_CONFIGURATION_TYPES

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-09 22:26:58 +00:00
committed by Dennis Klein
parent 201d784ee4
commit 043dd323a4
3 changed files with 9 additions and 16 deletions

View File

@@ -252,25 +252,21 @@ Example 1-1 has these files:
| `CONFIG` | Copies `ex-<name>.json` to the build directory of the example, and installs it into `share/fairmq/`. The scripts get `@EX_CONF_DIR@`. |
| `TRANSPORT <transport>…` | The transports of the tests. The default is `zeromq` and `shmem`. |
| `VARIANT <variant>…` | One test for each variant and transport, `Example.<name>.<variant>.<transport>`. The test script gets the variant as its second argument. |
| `NO_TRANSPORT` | One test, without the transport argument. Known defect: the test name is `Example.<name>.`, with a dot at the end. |
| `NO_TRANSPORT` | One test, `Example.<name>`, without the transport argument. |
| `NO_TEST` | No test script and no test. |
Other arguments stop CMake with `Unexpected unparsed arguments`. Without `VARIANT` and `NO_TRANSPORT`, the tests are `Example.<name>.<transport>`, for example `Example.1-1.zeromq` and `Example.1-1.shmem`.
### The scripts
CMake writes two copies of each start script. The copy in the build directory of the example has the name `fairmq-start-ex-<script>.sh`. The copy `fairmq-start-ex-<script>.sh_install` has the paths of the installation, and the install step copies it to `bin/` as `fairmq-start-ex-<script>.sh`. CMake replaces these variables:
CMake writes two copies of each start script. CMake configures the copy in the build directory of the example, `fairmq-start-ex-<script>.sh`, at configure time. The install step configures the installed copy again, with the paths of the install prefix. This prefix is the one of `cmake --install --prefix`, or `CMAKE_INSTALL_PREFIX` when you give no prefix at the install step. CMake replaces these variables:
| Variable | Build directory | Installation |
| --- | --- | --- |
| `@EX_BIN_DIR@` | The build directory of the example | `<prefix>/bin` |
| `@FAIRMQ_BIN_DIR@` | `<build>/fairmq` | `<prefix>/bin/fairmq` |
| `@FAIRMQ_BIN_DIR@` | `<build>/fairmq` | `<prefix>/bin` |
| `@EX_CONF_DIR@` (with `CONFIG`) | The build directory of the example | `<prefix>/share/fairmq` |
:::caution[Known defect]
The installed programs of FairMQ are in `<prefix>/bin`, not in `<prefix>/bin/fairmq`. An installed start script that runs a built-in device from `@FAIRMQ_BIN_DIR@` does not find it.
:::
CTest runs `test-ex-<name>.sh <transport>`, or `test-ex-<name>.sh <transport> <variant>`, with a timeout of 30 s. The test passes if the script exits with 0. The install step does not install the test script. This is the test script of example 1-1:
<Snippet file="examples/1-1/test-ex-1-1.sh.in" />

View File

@@ -103,7 +103,7 @@ The configure step writes the header `fairmq/Version.h` from `fairmq/Version.h.i
| Variable | Default | Description |
| --- | --- | --- |
| `CMAKE_BUILD_TYPE` | `RelWithDebInfo` | The build type. See the next table. A multi-config generator gets the types `Debug`, `Release` and `RelWithDebInfo`. |
| `CMAKE_BUILD_TYPE` | `RelWithDebInfo` | The build type of a single-config generator. See the next table. A multi-config generator selects the build type at build time, and FairMQ does not change `CMAKE_CONFIGURATION_TYPES`. |
| `CMAKE_CXX_STANDARD` | not set | If you set it, the value must be 17 or more. The target `FairMQ::FairMQ` requires C++17 in all cases. |
| `CMAKE_CXX_EXTENSIONS` | `OFF` | Compile without the language extensions of the compiler. |
| `BUILD_SHARED_LIBS` | `ON` | `ON` builds `libfairmq` as a shared library, `OFF` as a static archive. The CI builds only the shared library. |
@@ -140,10 +140,10 @@ FairMQ joins the selected sanitizers in one flag, for example `-fsanitize=addres
| Variable | Default | Description | Source |
| --- | --- | --- | --- |
| `RUN_STATIC_ANALYSIS` | `OFF` | Run `clang-tidy --extra-arg=-std=c++17` and `cpplint` on each file that the build compiles. `clang-tidy` uses the checks in `.clang-tidy`. CMake searches the programs in `PATH`. | [FairMQProjectSettings.cmake](https://github.com/FairRootGroup/FairMQ/blob/dev/cmake/FairMQProjectSettings.cmake) |
| `RUN_STATIC_ANALYSIS` | `OFF` | Run `clang-tidy --extra-arg=-std=c++17`, `include-what-you-use` and `cpplint` on each file that the build compiles. `clang-tidy` uses the checks in `.clang-tidy`. CMake searches the programs in `PATH`. | [FairMQProjectSettings.cmake](https://github.com/FairRootGroup/FairMQ/blob/dev/cmake/FairMQProjectSettings.cmake) |
| `RUN_FAIRMQ_TIDY` | `OFF` | With `BUILD_TIDY_TOOL=ON`: run `fairmq-tidy` on the sources of the library, the programs and the tests. | [fairmq/CMakeLists.txt](https://github.com/FairRootGroup/FairMQ/blob/dev/fairmq/CMakeLists.txt), [GTestHelper.cmake](https://github.com/FairRootGroup/FairMQ/blob/dev/cmake/GTestHelper.cmake) |
With `RUN_STATIC_ANALYSIS`, CMake also searches `iwyu`, and the summary shows the result. The build does not run `iwyu`: `FairMQProjectSettings.cmake` sets `CMAKE_CXX_IWYU`, and CMake does not read this variable.
With `RUN_STATIC_ANALYSIS`, CMake also searches `include-what-you-use` (shown as `iwyu` in the summary) and sets `CMAKE_CXX_INCLUDE_WHAT_YOU_USE` when it finds the program.
[`cmake/FairMQTidy.cmake`](https://github.com/FairRootGroup/FairMQ/blob/dev/cmake/FairMQTidy.cmake) defines `fairmq_target_tidy(TARGET <target> [EXTRA_ARGS <args>] [CLANG_EXECUTABLE <clang>])`. It runs `fairmq-tidy` on the `.cpp` and `.cxx` files of a target. The installed package has this module when it has the component `tidy_tool`. See [Check code with fairmq-tidy](/guides/fairmq-tidy/).
@@ -171,7 +171,7 @@ The sources are [`cmake/FairMQProjectSettings.cmake`](https://github.com/FairRoo
With `autoBind`, a channel that cannot bind to its TCP port tries random ports from `portRangeMin` (default `22000`) to `portRangeMax` (default `23000`). See [Channel properties](/reference/channel-properties/).
The target also has the public definitions `BOOST_ERROR_CODE_HEADER_ONLY` and `BOOST_ASIO_HAS_HAS_STD_CHRONO`.
The target also has the public definition `BOOST_ERROR_CODE_HEADER_ONLY`.
## The installed package
@@ -243,7 +243,7 @@ The package does not search its dependencies. Your project must find Boost, Fair
| `FairMQ_<dep>_VERSION` | The minimum version of `<dep>` that the build required, for example `FairMQ_FairLogger_VERSION` is `1.6.0`. |
| `FairMQ_<dep>_COMPONENTS` | The components of `<dep>` that the build required, for example the five components in `FairMQ_Boost_COMPONENTS`. |
| `FairMQ_<component>_FOUND` | `TRUE` for each [component](#components) of the installation. |
| `FairMQ_PACKAGE_COMPONENTS` | Empty. The variable must list the components, but a typo in `cmake/FairMQPackage.cmake` empties it. Use `FairMQ_<component>_FOUND`. |
| `FairMQ_PACKAGE_COMPONENTS` | The list of the [components](#components) of the installation. |
## Install layout

View File

@@ -131,7 +131,7 @@ Use the targets of the programs in custom commands and tests. For example, `$<TA
- **Include directories.** `<prefix>/include` and `<prefix>/include/fairmq`. Include the headers as `fairmq/<Name>.h`, for example `#include <fairmq/Device.h>`.
- **C++17.** The target has the compile feature `cxx_std_17`. CMake compiles your target with C++17 or a later standard.
- **Compile definitions.** `BOOST_ERROR_CODE_HEADER_ONLY`, `BOOST_ASIO_HAS_HAS_STD_CHRONO`, and `FAIRMQ_HAS_STD_FILESYSTEM` and `FAIRMQ_HAS_STD_PMR` with the value `0` or `1`. An installation with `FAIRMQ_DEBUG_MODE=ON` adds `FAIRMQ_DEBUG_MODE`. An installation with `FAIRMQ_CHANNEL_DEFAULT_AUTOBIND` adds `FAIRMQ_CHANNEL_DEFAULT_AUTOBIND` with the value `true` or `false`.
- **Compile definitions.** `BOOST_ERROR_CODE_HEADER_ONLY`, and `FAIRMQ_HAS_STD_FILESYSTEM` and `FAIRMQ_HAS_STD_PMR` with the value `0` or `1`. An installation with `FAIRMQ_DEBUG_MODE=ON` adds `FAIRMQ_DEBUG_MODE`. An installation with `FAIRMQ_CHANNEL_DEFAULT_AUTOBIND` adds `FAIRMQ_CHANNEL_DEFAULT_AUTOBIND` with the value `true` or `false`.
- **Libraries.** `FairLogger::FairLogger`, `Boost::boost`, `Boost::container`, `Boost::program_options`, `Boost::filesystem`, `Boost::regex`, `Threads::Threads`, `dl`, and `rt` on Linux.
ZeroMQ and PicoSHA2 are private dependencies of `libfairmq`. Your project does not find or link them.
@@ -162,9 +162,6 @@ After `find_package(FairMQ)`, these variables are set:
`find_package(FairMQ)` also puts `FairMQ_CMAKEMODDIR` at the front of `CMAKE_MODULE_PATH`. Then `include(FairMQTidy)` finds the module of FairMQ.
:::note
The variable `FairMQ_PACKAGE_COMPONENTS` is empty in this version of FairMQ. Use the variables `FairMQ_<component>_FOUND`.
:::
For all build options of FairMQ, see [CMake options and variables](/reference/cmake/).