diff --git a/src/fortran/CMakeLists.txt b/src/fortran/CMakeLists.txt index cb298b5f..38d53861 100644 --- a/src/fortran/CMakeLists.txt +++ b/src/fortran/CMakeLists.txt @@ -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) diff --git a/src/structured/fortran/CMakeLists.txt b/src/structured/fortran/CMakeLists.txt index 41b80869..16e1c3ab 100644 --- a/src/structured/fortran/CMakeLists.txt +++ b/src/structured/fortran/CMakeLists.txt @@ -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)