Skip to content

CMake: improvements#325

Merged
arximboldi merged 1 commit into
arximboldi:masterfrom
timblechmann:feature/cmake-improvements
Feb 25, 2026
Merged

CMake: improvements#325
arximboldi merged 1 commit into
arximboldi:masterfrom
timblechmann:feature/cmake-improvements

Conversation

@timblechmann
Copy link
Copy Markdown
Contributor

  • by default enable tests/examples/docs only if the project is the top-level project
  • use CMAKE_XXX_LAUNCHER variables, as the RULE_LAUNCH properties are internal to cmake
  • add alias target, to make linking more robust
  • expose headers to IDEs via FILE_SET

* by default enable tests/examples/docs only if the project is the
top-level project
* use CMAKE_XXX_LAUNCHER variables, as the RULE_LAUNCH properties are
internal to cmake
* add alias target, to make linking more robust
* expose headers to IDEs via FILE_SET
Comment thread CMakeLists.txt
option(ENABLE_BOOST_COROUTINE "run benchmarks with boost coroutine" off)

option(immer_BUILD_TESTS "Build tests" ON)
option(immer_BUILD_TESTS "Build tests" "${PROJECT_IS_TOP_LEVEL}")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PROJECT_IS_TOP_LEVEL was introduced in 3.12. it could be emulated via CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME, but i wonder if that's worth the effort: cmake 3.21 is from 2021, so widely available already

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

Comment thread CMakeLists.txt

install(TARGETS immer EXPORT ImmerConfig)
target_sources(immer PUBLIC FILE_SET HEADERS
FILES
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exposing the headers to IDE project files ... quite a bit of a quality-of-life improvement

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if I forget to update it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaict it is mainly cosmetic, i.e. it will allow IDEs to populate targets with headers and aid indexers (at least that's how it's used with qtcreator/clangd). if a file is missing, it won't show up in IDEs, but afaict that's it ...

@arximboldi
Copy link
Copy Markdown
Owner

Looking good, thank you! Will merge this and the ones in zug and lager once CI is green.

@arximboldi arximboldi merged commit bd4fc74 into arximboldi:master Feb 25, 2026
39 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants