diff --git a/CMakeLists.txt b/CMakeLists.txt index f229c8df619..859c71c73ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,12 +326,8 @@ add_subdirectory(src/ConvertInputFormat) if(BUILD_FORTRAN) include(CMakeAddFortranSubdirectory) - if (UNIX) - # Define a top-level target `fortran_project_options` - # It seems that CMakeAddFortranSubdirectory] doesn't know about the target `fortran_project_option` on Windows only. - # On Unix it is seen and detected as multiple targets defined with the same name (CMP0002) - include(cmake/Fortran.cmake) - endif() + # Define a top-level target `fortran_project_options` + include(cmake/Fortran.cmake) cmake_add_fortran_subdirectory( src/ExpandObjects PROJECT ExpandObjects diff --git a/src/AppGPostProcess/CMakeLists.txt b/src/AppGPostProcess/CMakeLists.txt index b73311344ef..8082e09aaeb 100644 --- a/src/AppGPostProcess/CMakeLists.txt +++ b/src/AppGPostProcess/CMakeLists.txt @@ -16,7 +16,7 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(AppGPostProcess ${SRC}) set_target_properties(AppGPostProcess PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/Basement/CMakeLists.txt b/src/Basement/CMakeLists.txt index ee37d3605e3..5955320ca70 100644 --- a/src/Basement/CMakeLists.txt +++ b/src/Basement/CMakeLists.txt @@ -58,7 +58,7 @@ add_executable(Basement ${SRC}) target_compile_options(Basement PRIVATE -O1) set_target_properties(Basement PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/CalcSoilSurfTemp/CMakeLists.txt b/src/CalcSoilSurfTemp/CMakeLists.txt index 89bc4f54c29..083fba6532c 100644 --- a/src/CalcSoilSurfTemp/CMakeLists.txt +++ b/src/CalcSoilSurfTemp/CMakeLists.txt @@ -16,7 +16,7 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(CalcSoilSurfTemp ${SRC}) set_target_properties(CalcSoilSurfTemp PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/ConvertESOMTR/CMakeLists.txt b/src/ConvertESOMTR/CMakeLists.txt index 49bb8cf2394..bef67247a12 100644 --- a/src/ConvertESOMTR/CMakeLists.txt +++ b/src/ConvertESOMTR/CMakeLists.txt @@ -16,7 +16,7 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(convertESOMTR ${SRC}) set_target_properties(convertESOMTR PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/ExpandObjects/CMakeLists.txt b/src/ExpandObjects/CMakeLists.txt index 768c6805cbf..b3045d0fe2d 100644 --- a/src/ExpandObjects/CMakeLists.txt +++ b/src/ExpandObjects/CMakeLists.txt @@ -22,7 +22,7 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(ExpandObjects ${SRC}) target_link_libraries(ExpandObjects PRIVATE fortran_project_options) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/HVAC-Diagram/CMakeLists.txt b/src/HVAC-Diagram/CMakeLists.txt index 369fe8658c4..dc4e813b076 100644 --- a/src/HVAC-Diagram/CMakeLists.txt +++ b/src/HVAC-Diagram/CMakeLists.txt @@ -16,7 +16,7 @@ set(SKIP_BUILD_RPATH true) add_executable(HVAC-Diagram ${SRC}) set_target_properties(HVAC-Diagram PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/ParametricPreprocessor/CMakeLists.txt b/src/ParametricPreprocessor/CMakeLists.txt index 28369fa5157..52283ffbbba 100644 --- a/src/ParametricPreprocessor/CMakeLists.txt +++ b/src/ParametricPreprocessor/CMakeLists.txt @@ -16,7 +16,7 @@ set(SKIP_BUILD_RPATH true) add_executable(ParametricPreprocessor ${SRC}) set_target_properties(ParametricPreprocessor PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/ReadVars/CMakeLists.txt b/src/ReadVars/CMakeLists.txt index 068a8b01573..81be6b3973c 100644 --- a/src/ReadVars/CMakeLists.txt +++ b/src/ReadVars/CMakeLists.txt @@ -16,7 +16,7 @@ set(SKIP_BUILD_RPATH true) add_executable(ReadVarsESO ${SRC}) set_target_properties(ReadVarsESO PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/Slab/CMakeLists.txt b/src/Slab/CMakeLists.txt index 9fbc9fdd8b7..5d22146150a 100644 --- a/src/Slab/CMakeLists.txt +++ b/src/Slab/CMakeLists.txt @@ -28,7 +28,7 @@ set(SKIP_BUILD_RPATH true) add_executable(Slab ${SRC}) set_target_properties(Slab PROPERTIES FOLDER Auxiliary) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) diff --git a/src/Transition/CMakeLists.txt b/src/Transition/CMakeLists.txt index 14d4a5e6553..df0468d78a4 100644 --- a/src/Transition/CMakeLists.txt +++ b/src/Transition/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(TransitionLib STATIC ${LIB_SRC}) target_include_directories(TransitionLib PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_compile_options(TransitionLib PUBLIC -fbounds-check) -if(NOT UNIX) # Defined as top-level target on Unix only +if(NOT UNIX) # Need to reinclude it on Windows include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") endif() get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS)