From 2383e1357f035ad53796b66bac03bef235efd3c6 Mon Sep 17 00:00:00 2001 From: Miles Buechler Date: Wed, 8 Jul 2026 08:23:55 -0600 Subject: [PATCH 1/2] only require library component if it is built --- config/singularity-eosConfig.cmake.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) From 88a81d0ff403c9493c7d7efa5a31f058cc28752f Mon Sep 17 00:00:00 2001 From: Miles Buechler Date: Wed, 8 Jul 2026 15:39:16 -0600 Subject: [PATCH 2/2] Add a changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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