openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Modernize CMake packaging

Open ahnaf-tahmid-chowdhury opened this issue 1 month ago • 1 comments

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 avatar Nov 24 '25 07:11 ahnaf-tahmid-chowdhury

Tagging @pshriwise, @shimwell.

ahnaf-tahmid-chowdhury avatar Nov 25 '25 11:11 ahnaf-tahmid-chowdhury