From c3bcb301053aee04e027c075948a1e9e08123f6a Mon Sep 17 00:00:00 2001 From: Henry Le Berre Date: Wed, 26 Jul 2023 21:41:17 -0700 Subject: [PATCH] Workaround for a CMake regression (CMAKE_Fortran_PREPROCESS) See https://gitlab.kitware.com/cmake/cmake/-/issues/25123. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ebde586a..1e501572d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,12 +74,10 @@ find_program(FYPP_EXE fypp REQUIRED) # Miscellaneous Configuration: -# * Enable C-Preprocessor for Fortran files # * Explicitly link to -ldl (or system equivalent) # * Request that FIND_LIBRARY searches /lib/ and /lib64/ # * Let FindXXX use custom scripts from toolchain/cmake/. -set(CMAKE_Fortran_PREPROCESS ON) link_libraries("${CMAKE_DL_LIBS}") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake") @@ -290,6 +288,8 @@ function(MFC_SETUP_TARGET) add_executable(${ARGS_TARGET} ${ARGS_SOURCES}) + set_target_properties(${ARGS_TARGET} PROPERTIES Fortran_PREPROCESS ON) + target_include_directories(${ARGS_TARGET} PRIVATE "${CMAKE_SOURCE_DIR}/src/common" "${CMAKE_SOURCE_DIR}/src/common/include"