Skip to content

Modernize cmake project files #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ClausKlein
Copy link
Contributor

@ClausKlein ClausKlein commented Mar 1, 2025

Update most packages used

With CMake 3.23 or later, a more powerful, more convenient way of handling headers is to use file sets. A file set can associate headers with a target, and the headers can be installed along with the target in an install(TARGETS) call. No separate install(FILES) or install(DIRECTORY) call is needed. In addition, a file set provides information about whether a header is private or public, and also about the header search paths a consumer of the target must use.

Use FILE_SET HEADERS and CMAKE_VERIFY_INTERFACE_HEADER_SETS

see too TheLartians/PackageProject.cmake#32
and TheLartians/PackageProject.cmake#31

CMakeLists.txt Outdated
# CPMAddPackage("gh:TheLartians/[email protected]")
include(cmake/PackageProject.cmake)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TheLartians NOTE: The original PackageProject.cmake can not use with FILE_SET HEADERS!

@ClausKlein ClausKlein force-pushed the feature/modernize-cmake-project branch 2 times, most recently from b701ada to ae4ac1d Compare March 6, 2025 05:59
Fix install target

Update cmake-format config file

Format all cmake files.

Update CPM.cmake version.

Use FILE_SET HEADER to verify and install the header files.

Prevent build problems caused by CPM_USE_LOCAL_PACKAGES

Prevent problems with doctest if local found
@ClausKlein ClausKlein force-pushed the feature/modernize-cmake-project branch from ae4ac1d to a3bc933 Compare March 6, 2025 06:01
@ClausKlein ClausKlein force-pushed the feature/modernize-cmake-project branch from 10509ba to 9547016 Compare March 6, 2025 06:15
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.

1 participant