openmc
openmc copied to clipboard
Modernize CMake packaging
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.
Tagging @pshriwise, @shimwell.