Skip to content

Commit c3bcb30

Browse files
committed
Workaround for a CMake regression (CMAKE_Fortran_PREPROCESS)
See https://gitlab.kitware.com/cmake/cmake/-/issues/25123.
1 parent 1311211 commit c3bcb30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,10 @@ find_program(FYPP_EXE fypp REQUIRED)
7474

7575

7676
# Miscellaneous Configuration:
77-
# * Enable C-Preprocessor for Fortran files
7877
# * Explicitly link to -ldl (or system equivalent)
7978
# * Request that FIND_LIBRARY searches <prefix>/lib/ and <prefix>/lib64/
8079
# * Let FindXXX use custom scripts from toolchain/cmake/.
8180

82-
set(CMAKE_Fortran_PREPROCESS ON)
8381
link_libraries("${CMAKE_DL_LIBS}")
8482
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
8583
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake")
@@ -290,6 +288,8 @@ function(MFC_SETUP_TARGET)
290288

291289
add_executable(${ARGS_TARGET} ${ARGS_SOURCES})
292290

291+
set_target_properties(${ARGS_TARGET} PROPERTIES Fortran_PREPROCESS ON)
292+
293293
target_include_directories(${ARGS_TARGET} PRIVATE
294294
"${CMAKE_SOURCE_DIR}/src/common"
295295
"${CMAKE_SOURCE_DIR}/src/common/include"

0 commit comments

Comments
 (0)