Skip to content

Commit

Permalink
Fix installation of fortran modules
Browse files Browse the repository at this point in the history
  • Loading branch information
pghysels committed Mar 3, 2022
1 parent 13c455d commit e974522
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
target_sources(strumpack
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/strumpack.f90)

install(DIRECTORY ${CMAKE_BINARY_DIR}/
DESTINATION include FILES_MATCHING PATTERN *.mod)
# This is really a problem. Using a wildcard to install the mod makes
# CMake install a bunch of empty directories, which leads to an
# infinite recursion when building in the src tree, which we do for
# testing.
# install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# DESTINATION include FILES #_MATCHING PATTERN
# strumpack.mod STRUMPACK.mod STRUMPACK.MOD)

install(FILES
${CMAKE_BINARY_DIR}/strumpack.mod
${CMAKE_BINARY_DIR}/STRUMPACK.mod
${CMAKE_BINARY_DIR}/STRUMPACK.MOD
DESTINATION include OPTIONAL)
15 changes: 13 additions & 2 deletions src/structured/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
target_sources(strumpack
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/strumpack_dense.f90)

install(DIRECTORY ${CMAKE_BINARY_DIR}/
DESTINATION include FILES_MATCHING PATTERN *.mod)
# This is really a problem. Using a wildcard to install the mod makes
# CMake install a bunch of empty directories, which leads to an
# infinite recursion when building in the src tree, which we do for
# testing.
# install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# DESTINATION include FILES #_MATCHING PATTERN
# strumpack_dense.mod STRUMPACK_DENSE.mod STRUMPACK_DENSE.MOD)

install(FILES
${CMAKE_BINARY_DIR}/strumpack_dense.mod
${CMAKE_BINARY_DIR}/STRUMPACK_DENSE.mod
${CMAKE_BINARY_DIR}/STRUMPACK_DENSE.MOD
DESTINATION include OPTIONAL)

0 comments on commit e974522

Please sign in to comment.