From 039639b3416bf857a9c8d34fa5b9318b3d6cdd6e Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 26 Mar 2026 17:23:27 +0100 Subject: [PATCH] Fix bug in CMakeLists: now installs modules correctly --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b265b69..86f810f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -848,11 +848,12 @@ endif() # Set the Fortran module output directory for all targets -#set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/modules) +set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/modules) +#set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/include") -set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MODULDIR}") -message(STATUS "fortran module directory ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MODULDIR}") + +message(STATUS "fortran module directory ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") include_directories(${MPI_Fortran_INCLUDE_PATH}) @@ -1273,7 +1274,7 @@ install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ # Install module files install(DIRECTORY ${CMAKE_BINARY_DIR}/modules/ - DESTINATION "${CMAKE_Fortran_MODULE_DIRECTORY}" # This will place .mod files in /modules + DESTINATION "${CMAKE_INSTALL_MODULDIR}" # This will place .mod files in /modules FILES_MATCHING PATTERN "*.mod" )