Skip to content
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

cmake: Overhaul downstream config to properly export version and dependencies #230

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tmadlener
Copy link
Contributor

@tmadlener tmadlener commented Sep 3, 2024

BEGINRELEASENOTES

  • Configure the k4FWCoreConfig.cmake to put a bit more information in there
    • Make sure all dependencies are also found for dependent packages
    • Make sure dependency versions are discovered again consistently
    • Make sure to export the current k4FWCore version for downstream consumers
  • Make sure that at least one version of podio is found

ENDRELEASENOTES

There are a few things that we could also address while we are here

Fixes #166

@tmadlener
Copy link
Contributor Author

I think we need at least podio 1.0 in any case.

After the discussion at todays meeting it looks like k4FWCore handles all the things also for older podio versions, so we can keep the compatibility for now.

Comment on lines 1 to 12
include(CMakePackageConfigHelpers)

configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/k4FWCoreConfig.cmake.in
${PROJECT_BINARY_DIR}/k4FWCoreConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/k4FWCore
PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put these in the main CMakeLists.txt, it's only a few more lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will become a few more once we start to also export version information properly. Since we have a usable tag already, should I add that as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, why not

CMakeLists.txt Outdated

gaudi_install(CMAKE ${PROJECT_BINARY_DIR}/k4FWCoreConfig.cmake)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
gaudi_install(CMAKE ${PROJECT_BINARY_DIR}/k4FWCoreConfig.cmake)
install(FILES ${PROJECT_BINARY_DIR}/k4FWCoreConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/k4FWCore)

It's a single cmake file, gaudi_install doesn't do anything special for us and this is clearer (and we can check that the paths here and given to configure_package_config_file match).

- Make sure all required dependencies are also detected in downstream
  users
- Add some legacy variables
Move all downstream related config to one file
@tmadlener tmadlener changed the title cmake: Overhaul downstream config and a few minor fixes cmake: Overhaul downstream config to properly export version and dependencies Oct 8, 2024
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.

Missing version information in CMake configuration
2 participants