diff --git a/CHANGELOG.md b/CHANGELOG.md index 54e8a6ac7d9..71f298d1e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Current develop ### Added (new features/APIs/variables/...) +- [[PR634]](https://github.com/lanl/singularity-eos/pull/643) Fixed `find_package(singularity-eos)` failures when built without closure variant. The CMake config now automatically detects which components were built and only requires those that exist, enabling header-only usage without the compiled library. - [[PR632]](https://github.com/lanl/singularity-eos/pull/632) Added generic constructors to SpinerEOSDependsRhoSie and SpinerEOSDependsRhoT that build tables from any EOS object. - [[PR623]](https://github.com/lanl/singularity-eos/pull/623) Expanded the sesame2spiner syntax to support multiple material definitions in one input file. - [[PR618]](https://github.com/lanl/singularity-eos/pull/618) Add PTDerivativesFromPreferred for computing derivatives of a mixture in a cell diff --git a/config/singularity-eosConfig.cmake.in b/config/singularity-eosConfig.cmake.in index b8d70a6c823..4ef4768d6d4 100644 --- a/config/singularity-eosConfig.cmake.in +++ b/config/singularity-eosConfig.cmake.in @@ -31,6 +31,13 @@ endif() # ------------------------------------------------------------------------------# # check for selected components # ------------------------------------------------------------------------------# + +# Determine which components were actually built and installed +set(${CMAKE_FIND_PACKAGE_NAME}_available_components Interface) +if(@SINGULARITY_BUILD_CLOSURE@) + list(APPEND ${CMAKE_FIND_PACKAGE_NAME}_available_components Library) +endif() + if(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) set(${CMAKE_FIND_PACKAGE_NAME}_known_components Interface Library) foreach(comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) @@ -42,7 +49,8 @@ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) endforeach() set(${CMAKE_FIND_PACKAGE_NAME}_comps ${${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS}) else() - set(${CMAKE_FIND_PACKAGE_NAME}_comps Interface Library) + # Default to all available components (only what was actually built) + set(${CMAKE_FIND_PACKAGE_NAME}_comps ${${CMAKE_FIND_PACKAGE_NAME}_available_components}) endif() foreach(comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_comps)