From a77270f772375990a356d2cd22cc80771abb0245 Mon Sep 17 00:00:00 2001 From: Christopher Mauney Date: Thu, 7 Jul 2022 16:47:53 -0600 Subject: [PATCH 1/2] fix to install fortran mod files --- CMakeLists.txt | 4 ++++ cmake/install.cmake | 7 +++++++ singularity-eos/CMakeLists.txt | 3 +++ 3 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1923e57e67..7d942cde7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,6 +347,10 @@ foreach(_header ${EOS_HEADERS}) list(APPEND _headers singularity-eos/${_header}) endforeach() +foreach(_mod ${EOS_MODS}) + list(APPEND _install_mods ${CMAKE_CURRENT_BINARY_DIR}/${_mod}) +endforeach() + foreach(_src ${EOS_SRCS}) list(APPEND _srcs singularity-eos/${_src}) endforeach() diff --git a/cmake/install.cmake b/cmake/install.cmake index faee554ffd..37863c6ae6 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -84,6 +84,13 @@ foreach(file ${_install_headers}) ) endforeach() # file +# install the fortran modules +# NB: cmake doesn't provide a clean way to handle mods +install( + FILES ${_install_mods} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/singularity-eos/eos +) + # install the generated config file install( FILES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/singularity-eosConfig.cmake diff --git a/singularity-eos/CMakeLists.txt b/singularity-eos/CMakeLists.txt index f044efcca2..f53c0122c4 100644 --- a/singularity-eos/CMakeLists.txt +++ b/singularity-eos/CMakeLists.txt @@ -46,8 +46,11 @@ endif() if (SINGULARITY_USE_FORTRAN) list(APPEND EOS_SRCS eos/singularity_eos.f90) + # would rather handle this more robustly, being sloppy for now + list(APPEND EOS_MODS singularity_eos.mod singularity_eos_types.mod) endif() # export to parent scope set(EOS_HEADERS ${EOS_HEADERS} PARENT_SCOPE) set(EOS_SRCS ${EOS_SRCS} PARENT_SCOPE) +set(EOS_MODS ${EOS_MODS} PARENT_SCOPE) From 6ffca2646600a550370fa802e0648b3c0c70026a Mon Sep 17 00:00:00 2001 From: Christopher Mauney Date: Thu, 7 Jul 2022 16:53:54 -0600 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc7e76401..a1a2214ffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Current develop +### Fixed cmake code to properly install fortran module files in include path +- [[PR151]](https://github.com/lanl/singularity-eos/pull/151) fix module install + ### Added (new features/APIs/variables/...) - [[PR150]](https://github.com/lanl/singularity-eos/pull/150) This changelog