Modernize CMake packaging#3653
Open
ahnaf-tahmid-chowdhury wants to merge 7 commits intoopenmc-dev:developfrom
Open
Modernize CMake packaging#3653ahnaf-tahmid-chowdhury wants to merge 7 commits intoopenmc-dev:developfrom
ahnaf-tahmid-chowdhury wants to merge 7 commits intoopenmc-dev:developfrom
Conversation
Contributor
Author
|
Tagging @pshriwise, @shimwell. |
paulromano
requested changes
Dec 2, 2025
Contributor
paulromano
left a comment
There was a problem hiding this comment.
Thanks for the CMake improvements @ahnaf-tahmid-chowdhury. One comment below:
| find_package(pugixml CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) | ||
| find_package(xtl CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) | ||
| find_package(xtensor CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) | ||
| find_dependency(fmt CONFIG REQUIRED HINTS ${PACKAGE_PREFIX_DIR}) |
Contributor
There was a problem hiding this comment.
It looks like PACKAGE_PREFIX_DIR was added in CMake 3.30, whereas we need to support 3.22+. Is there any way to update this to support 3.22?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
configure_package_config_file and write_basic_package_version_file respectively.
downstream projects.
These changes make it easier for other projects to find and use OpenMC in their own CMake builds.