Skip to content

Modernize CMake packaging#3653

Merged
paulromano merged 12 commits into
openmc-dev:developfrom
ahnaf-tahmid-chowdhury:better-cmake-config
May 21, 2026
Merged

Modernize CMake packaging#3653
paulromano merged 12 commits into
openmc-dev:developfrom
ahnaf-tahmid-chowdhury:better-cmake-config

Conversation

@ahnaf-tahmid-chowdhury
Copy link
Copy Markdown
Contributor

This pull request modernizes the CMake packaging of OpenMC by leveraging the CMakePackageConfigHelpers module.
This change ensures that OpenMC's CMake configuration is more robust, relocatable, and aligns with modern CMake
best practices.

Specifically, the following changes were made:

  • Replaced manual configuration of OpenMCConfig.cmake and OpenMCConfigVersion.cmake with
    configure_package_config_file and write_basic_package_version_file respectively.
  • The OpenMCConfigVersion.cmake.in is no longer needed and has been removed.
  • Switched to using find_dependency in OpenMCConfig.cmake.in to properly propagate dependency requirements to
    downstream projects.

These changes make it easier for other projects to find and use OpenMC in their own CMake builds.

@ahnaf-tahmid-chowdhury
Copy link
Copy Markdown
Contributor Author

Tagging @pshriwise, @shimwell.

Copy link
Copy Markdown
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks for the CMake improvements @ahnaf-tahmid-chowdhury. One comment below:

Comment thread cmake/OpenMCConfig.cmake.in
@ahnaf-tahmid-chowdhury
Copy link
Copy Markdown
Contributor Author

@paulromano, this PR is ready for review.

Copy link
Copy Markdown
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks @ahnaf-tahmid-chowdhury! Sorry for the delay on this one but happy that we're able to get it merged in.

@paulromano paulromano enabled auto-merge (squash) May 21, 2026 19:37
@paulromano paulromano merged commit dfb6c56 into openmc-dev:develop May 21, 2026
16 checks passed
@paulromano paulromano mentioned this pull request May 22, 2026
5 tasks
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