Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks for found and target in singularity-eosConfig.cmake #183

Merged
merged 3 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [[PR181]](https://github.com/lanl/singularity-eos/pull/181) change from manual dependecy handling to using hdf5 interface targets

### Fixed (Repair bugs, etc)
- [[PR183]](https://github.com/lanl/singularity-eos/pull/183) fortify cmake export config to always have interface targets of dependencies that need them
- [[PR174]](https://github.com/lanl/singularity-eos/pull/174) fix build configuration when closures are disabled
- [[PR157]](https://github.com/lanl/singularity-eos/pull/157) fix root finders in Gruneisen, Davis, and JWL
- [[PR151]](https://github.com/lanl/singularity-eos/pull/151) fix module install
Expand Down
3 changes: 3 additions & 0 deletions cmake/dependency.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ macro(singularity_import_dependency)
if(dep_COMPONENTS)
list(APPEND SINGULARITY_DEP_PKGS_${dep_PKG} "${dep_COMPONENTS}")
endif()
if(dep_TARGET)
set(SINGULARITY_DEP_TARGET_${dep_PKG} ${dep_TARGET})
endif()
unset(_SMSG_PREFIX)
endmacro() # singularity_import_dependency

Expand Down
14 changes: 13 additions & 1 deletion cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ include(GNUInstallDirs)
# Generate config file
#----------------------------------------------------------------------------#

#TODO: Try to use the built-in cmake procedure for this

# get all available `SINGULARITY_` cmake variables set during configuration
get_cmake_property(_variableNames VARIABLES)
string (REGEX MATCHALL "(^|;)SINGULARITY_[A-Za-z0-9_]*"
Expand All @@ -37,11 +39,21 @@ endforeach()
# package install path
foreach(_depName ${SINGULARITY_DEP_PKGS})
set(_components "")
set(_target "")
if(SINGULARITY_DEP_PKGS_${_depName})
set(_components "COMPONENTS ${SINGULARITY_DEP_PKGS_${_depName}}")
endif()
if(SINGULARITY_DEP_TARGET_${_depName})
set(_target "${SINGULARITY_DEP_TARGET_${_depName}}")
endif()
set(SINGULARITY_CONFIG_DEPENDENCIES
"${SINGULARITY_CONFIG_DEPENDENCIES}\nif(NOT ${_depName}_FOUND")
if(NOT "${_target}" STREQUAL "")
set(SINGULARITY_CONFIG_DEPENDENCIES
"${SINGULARITY_CONFIG_DEPENDENCIES} OR NOT TARGET ${_target}")
endif()
set(SINGULARITY_CONFIG_DEPENDENCIES
"${SINGULARITY_CONFIG_DEPENDENCIES}\nif(NOT ${_depName}_FOUND)\n\tfind_package(${_depName} ${_components} REQUIRED)\nendif()")
"${SINGULARITY_CONFIG_DEPENDENCIES})\n\tfind_package(${_depName} ${_components} REQUIRED)\nendif()")
endforeach()

# generate the configuration file
Expand Down