From ef6b9e7a59a9c886d08762097e81639f46d26845 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 20 May 2021 09:42:58 +0200 Subject: [PATCH 1/8] Use global cmake settings for Fortran Similar to what https://github.com/NREL/EnergyPlus/pull/8425/commits/b059d346a72e3e7e10a8a67b60c72100c190d8e3 did --- CMakeLists.txt | 1 + src/AppGPostProcess/CMakeLists.txt | 46 +-------- src/Basement/CMakeLists.txt | 61 ++++++------ src/CalcSoilSurfTemp/CMakeLists.txt | 46 +-------- src/ConvertESOMTR/CMakeLists.txt | 30 +----- src/ExpandObjects/CMakeLists.txt | 57 ++--------- src/HVAC-Diagram/CMakeLists.txt | 43 ++------- src/ParametricPreprocessor/CMakeLists.txt | 32 +------ src/ReadVars/CMakeLists.txt | 30 +----- src/Slab/CMakeLists.txt | 30 +----- src/Transition/CMakeLists.txt | 110 ++++------------------ 11 files changed, 90 insertions(+), 396 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0949fc93fa9..18107bcf44c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,6 +326,7 @@ add_subdirectory(src/ConvertInputFormat) if(BUILD_FORTRAN) include(CMakeAddFortranSubdirectory) + 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 ad59ecd5278..7f3d3e6c4c4 100644 --- a/src/AppGPostProcess/CMakeLists.txt +++ b/src/AppGPostProcess/CMakeLists.txt @@ -10,53 +10,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(SRC AppGPostProcess.f90) -set(STATIC_EXE FALSE) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - set(STATIC_EXE TRUE) - endif() -else() # Windows - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - endif() -endif() - +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) + add_executable(AppGPostProcess ${SRC}) +target_link_libraries(AppGPostProcess PRIVATE fortran_project_options) set_target_properties(AppGPostProcess PROPERTIES FOLDER Auxiliary) install(TARGETS AppGPostProcess DESTINATION PostProcess) -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(AppGPostProcess PostProcess) endif() diff --git a/src/Basement/CMakeLists.txt b/src/Basement/CMakeLists.txt index c4cd5e540e5..a360293df93 100644 --- a/src/Basement/CMakeLists.txt +++ b/src/Basement/CMakeLists.txt @@ -19,45 +19,48 @@ set(SRC InputProcessor.f90 BasementSimData.f90) -set(STATIC_EXE FALSE) +add_library(BasementOptions INTERFACE) +if(NOT CMAKE_Fortran_COMPILER MATCHES "ifort") + target_compile_options(BasementOptions INTERFACE -ffloat-store) +endif() -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffloat-store") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) +if(NOT APPLE AND NOT UNIX) # Windows if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffloat-store") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(STATIC_EXE TRUE) - endif() -else() # Windows - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS - "/nologo /debug:minimal /O2 /Oy- /assume:buffered_io /noaltparam /fpscomp:nolibs /fpe:0 /fp:fast=2 /traceback /check:uninit /libs:static /threads /c /assume:protect-parens /Qprec-div /Qprec-sqrt /Qimf-precision:high /Qimf-arch-consistency:true /Qvec-" - ) - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffloat-store") + target_compile_options( + BasementOptions + INTERFACE /nologo + /debug:minimal + /O2 + /Oy- + /assume:buffered_io + /noaltparam + /fpscomp:nolibs + /fpe:0 + /fp:fast=2 + /traceback + /check:uninit + /libs:static + /threads + /c + /assume:protect-parens + /Qprec-div + /Qprec-sqrt + /Qimf-precision:high + /Qimf-arch-consistency:true + /Qvec-) endif() endif() +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) -add_executable(Basement ${SRC}) -set_target_properties(Basement PROPERTIES COMPILE_FLAGS "-O1 -ffree-line-length-200 ${SHARED_FLAGS}") +add_executable(Basement ${SRC}) +set_target_properties(Basement PROPERTIES COMPILE_FLAGS "-O1") set_target_properties(Basement PROPERTIES FOLDER Auxiliary) +target_link_libraries(Basement PRIVATE BasementOptions fortran_project_options) install(TARGETS Basement DESTINATION PreProcess/GrndTempCalc) -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(Basement PreProcess/GrndTempCalc) endif() diff --git a/src/CalcSoilSurfTemp/CMakeLists.txt b/src/CalcSoilSurfTemp/CMakeLists.txt index 0a96b843285..7b23b8ad5db 100644 --- a/src/CalcSoilSurfTemp/CMakeLists.txt +++ b/src/CalcSoilSurfTemp/CMakeLists.txt @@ -10,53 +10,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(SRC EPWRead.f90 SoilSurfTemp.f90) -set(STATIC_EXE FALSE) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - set(STATIC_EXE TRUE) - endif() -else() # Windows - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - endif() -endif() - +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) + add_executable(CalcSoilSurfTemp ${SRC}) +target_link_libraries(CalcSoilSurfTemp PRIVATE fortran_project_options) set_target_properties(CalcSoilSurfTemp PROPERTIES FOLDER Auxiliary) install(TARGETS CalcSoilSurfTemp DESTINATION PreProcess/CalcSoilSurfTemp) -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(CalcSoilSurfTemp PreProcess/CalcSoilSurfTemp) endif() diff --git a/src/ConvertESOMTR/CMakeLists.txt b/src/ConvertESOMTR/CMakeLists.txt index a6ece070176..f4f9f34ee7d 100644 --- a/src/ConvertESOMTR/CMakeLists.txt +++ b/src/ConvertESOMTR/CMakeLists.txt @@ -10,37 +10,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(SRC mainModule.f90) -set(STATIC_EXE FALSE) - +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) + add_executable(convertESOMTR ${SRC}) set_target_properties(convertESOMTR PROPERTIES FOLDER Auxiliary) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(STATIC_EXE TRUE) - endif() -else() - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - endif() -endif() +target_link_libraries(convertESOMTR PRIVATE fortran_project_options) install(TARGETS convertESOMTR DESTINATION "PostProcess/convertESOMTRpgm/") -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(convertESOMTR "PostProcess/convertESOMTRpgm/") endif() diff --git a/src/ExpandObjects/CMakeLists.txt b/src/ExpandObjects/CMakeLists.txt index d9f9b920978..f7a61c6712f 100644 --- a/src/ExpandObjects/CMakeLists.txt +++ b/src/ExpandObjects/CMakeLists.txt @@ -8,64 +8,23 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") -if(WIN32) - configure_file(ExpandObjects.rc.in "${CMAKE_CURRENT_BINARY_DIR}/ExpandObjects.rc") -endif() - set(SRC epfilter.f90) -set(STATIC_EXE FALSE) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - set(STATIC_EXE TRUE) - endif() -else() # Windows - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") - endif() +if(WIN32) + # Include manifest + configure_file(ExpandObjects.rc.in "${CMAKE_CURRENT_BINARY_DIR}/ExpandObjects.rc") + list(APPEND SRC "${CMAKE_CURRENT_BINARY_DIR}/ExpandObjects.rc") endif() +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) -if(APPLE OR UNIX) - add_executable(ExpandObjects ${SRC}) -else() # windows - add_executable(ExpandObjects ${SRC} "${CMAKE_CURRENT_BINARY_DIR}/ExpandObjects.rc") -endif() +add_executable(ExpandObjects ${SRC}) +target_link_libraries(ExpandObjects PRIVATE fortran_project_options) set_target_properties(ExpandObjects PROPERTIES FOLDER Auxiliary) install(TARGETS ExpandObjects DESTINATION "./") -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(ExpandObjects "./") endif() diff --git a/src/HVAC-Diagram/CMakeLists.txt b/src/HVAC-Diagram/CMakeLists.txt index 3f8ce8aa84d..deee451c200 100644 --- a/src/HVAC-Diagram/CMakeLists.txt +++ b/src/HVAC-Diagram/CMakeLists.txt @@ -10,47 +10,18 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(SRC HVAC-Diagram-Main.f90) -set(STATIC_EXE TRUE) - -add_library(HVAC-Diagram-Options INTERFACE) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - target_compile_options(HVAC-Diagram-Options INTERFACE -static-intel) - else() - target_compile_options(HVAC-Diagram-Options INTERFACE -std=legacy) - target_compile_options(HVAC-Diagram-Options INTERFACE -ffree-line-length-200) - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - target_compile_options(HVAC-Diagram-Options INTERFACE -static-intel) - else() - target_compile_options(HVAC-Diagram-Options INTERFACE -static) - target_compile_options(HVAC-Diagram-Options INTERFACE -std=legacy) - target_compile_options(HVAC-Diagram-Options INTERFACE -ffree-line-length-200) - set(STATIC_EXE TRUE) - endif() -else() - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - target_compile_options(HVAC-Diagram-Options INTERFACE /libs:static) - else() - target_compile_options(HVAC-Diagram-Options INTERFACE -static) - target_compile_options(HVAC-Diagram-Options INTERFACE -std=legacy) - target_compile_options(HVAC-Diagram-Options INTERFACE -ffree-line-length-200) - set(STATIC_EXE TRUE) - endif() -endif() - +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH true) + add_executable(HVAC-Diagram ${SRC}) -target_link_libraries(HVAC-Diagram PRIVATE HVAC-Diagram-Options) +target_link_libraries(HVAC-Diagram PRIVATE fortran_project_options) set_target_properties(HVAC-Diagram PROPERTIES FOLDER Auxiliary) +if(NOT CMAKE_Fortran_COMPILER MATCHES "ifort") + target_compile_options(HVAC-Diagram PRIVATE -std=legacy) +endif() install(TARGETS HVAC-Diagram DESTINATION PostProcess) -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(HVAC-Diagram PostProcess) endif() diff --git a/src/ParametricPreprocessor/CMakeLists.txt b/src/ParametricPreprocessor/CMakeLists.txt index dd32a28bdf1..1efcb06767e 100644 --- a/src/ParametricPreprocessor/CMakeLists.txt +++ b/src/ParametricPreprocessor/CMakeLists.txt @@ -10,39 +10,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(SRC ParametricPreprocessor.f90) -set(STATIC_EXE FALSE) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(STATIC_EXE TRUE) - endif() -else() - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - endif() -endif() - +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH true) + add_executable(ParametricPreprocessor ${SRC}) +target_link_libraries(ParametricPreprocessor PRIVATE fortran_project_options) set_target_properties(ParametricPreprocessor PROPERTIES FOLDER Auxiliary) -set_target_properties(ParametricPreprocessor PROPERTIES COMPILE_FLAGS "-ffree-line-length-200 ${SHARED_FLAGS}") - install(TARGETS ParametricPreprocessor DESTINATION PreProcess/ParametricPreprocessor) -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(ParametricPreprocessor PreProcess/ParametricPreprocessor) endif() diff --git a/src/ReadVars/CMakeLists.txt b/src/ReadVars/CMakeLists.txt index b32d4499e08..5607c31f5ee 100644 --- a/src/ReadVars/CMakeLists.txt +++ b/src/ReadVars/CMakeLists.txt @@ -10,37 +10,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(SRC ReadVarsESO.f90) -set(STATIC_EXE FALSE) - -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(STATIC_EXE TRUE) - endif() -else() - set(STATIC_EXE TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - endif() -endif() - +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH true) + add_executable(ReadVarsESO ${SRC}) set_target_properties(ReadVarsESO PROPERTIES FOLDER Auxiliary) +target_link_libraries(ReadVarsESO PRIVATE fortran_project_options) install(TARGETS ReadVarsESO DESTINATION PostProcess) -if(NOT ${STATIC_EXE}) +if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") install_target_prereqs(ReadVarsESO PostProcess) endif() diff --git a/src/Slab/CMakeLists.txt b/src/Slab/CMakeLists.txt index 0199fe4984d..40b91b43f9d 100644 --- a/src/Slab/CMakeLists.txt +++ b/src/Slab/CMakeLists.txt @@ -22,37 +22,13 @@ set(SRC InputProcessor.f90 SimData.f90) -set(STATIC_EXE FALSE) +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) +set(SKIP_BUILD_RPATH true) -if(APPLE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(STATIC_EXE TRUE) - endif() -else() - if(CMAKE_Fortran_COMPILER MATCHES "ifort") - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - set(STATIC_EXE TRUE) - endif() -endif() - -set(SKIP_BUILD_RPATH TRUE) add_executable(Slab ${SRC}) +target_link_libraries(Slab PRIVATE fortran_project_options) set_target_properties(Slab PROPERTIES FOLDER Auxiliary) -set_target_properties(Slab PROPERTIES COMPILE_FLAGS "-ffree-line-length-200 ${SHARED_FLAGS}") - install(TARGETS Slab DESTINATION PreProcess/GrndTempCalc) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") diff --git a/src/Transition/CMakeLists.txt b/src/Transition/CMakeLists.txt index fbd370455bf..03a95f4afb7 100644 --- a/src/Transition/CMakeLists.txt +++ b/src/Transition/CMakeLists.txt @@ -8,9 +8,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../Products") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -set(STATIC_EXE FALSE) +set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) # first create a static library of shared stuff set(LIB_SRC @@ -24,94 +22,21 @@ set(LIB_SRC SortAndStringUtilities.f90 UtilityRoutines.f90 VCompareGlobalRoutines.f90 - VCompareUtilityRoutines.f90) -add_library(TransitionLib STATIC ${LIB_SRC}) - -list(APPEND VERSIONS 1_0_0) -list(APPEND VERSIONS 1_0_1) -list(APPEND VERSIONS 1_0_2) -list(APPEND VERSIONS 1_0_3) -list(APPEND VERSIONS 1_1_0) -list(APPEND VERSIONS 1_1_1) -list(APPEND VERSIONS 1_2_0) -list(APPEND VERSIONS 1_2_1) -list(APPEND VERSIONS 1_2_2) -list(APPEND VERSIONS 1_2_3) -list(APPEND VERSIONS 1_3_0) -list(APPEND VERSIONS 1_4_0) -list(APPEND VERSIONS 2_0_0) -list(APPEND VERSIONS 2_1_0) -list(APPEND VERSIONS 2_2_0) -list(APPEND VERSIONS 3_0_0) -list(APPEND VERSIONS 3_1_0) -list(APPEND VERSIONS 4_0_0) -list(APPEND VERSIONS 5_0_0) -list(APPEND VERSIONS 6_0_0) -list(APPEND VERSIONS 7_0_0) -list(APPEND VERSIONS 7_1_0) -list(APPEND VERSIONS 7_2_0) -list(APPEND VERSIONS 8_0_0) -list(APPEND VERSIONS 8_1_0) -list(APPEND VERSIONS 8_2_0) -list(APPEND VERSIONS 8_3_0) -list(APPEND VERSIONS 8_4_0) -list(APPEND VERSIONS 8_5_0) -list(APPEND VERSIONS 8_6_0) -list(APPEND VERSIONS 8_7_0) -list(APPEND VERSIONS 8_8_0) -list(APPEND VERSIONS 8_9_0) -list(APPEND VERSIONS 9_0_0) -list(APPEND VERSIONS 9_1_0) -list(APPEND VERSIONS 9_2_0) -list(APPEND VERSIONS 9_3_0) -list(APPEND VERSIONS 9_4_0) -list(APPEND VERSIONS 9_5_0) -list(APPEND VERSIONS 9_6_0) - -if(APPLE) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - endif() -elseif(UNIX) - set(CMAKE_SKIP_RPATH TRUE) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check") - set(STATIC_EXE TRUE) - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") - endif() -else() # Windows - set(STATIC_EXE TRUE) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") - if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") - endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check") - else() - # Set release flags to be empty - set(CMAKE_Fortran_FLAGS_RELEASE "") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") - endif() -endif() + VCompareUtilityRoutines.f90 +) +add_library(TransitionLib STATIC ${LIB_SRC}) +target_include_directories(TransitionLib PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_compile_options(TransitionLib PUBLIC -fbounds-check) +target_link_libraries(TransitionLib PUBLIC fortran_project_options) # ffree-line-length-none + +set(VERSIONS + 1_0_0 1_0_1 1_0_2 1_0_3 1_1_0 1_1_1 1_2_0 1_2_1 1_2_2 1_2_3 1_3_0 1_4_0 + 2_0_0 2_1_0 2_2_0 3_0_0 3_1_0 4_0_0 5_0_0 6_0_0 7_0_0 7_1_0 7_2_0 + 8_0_0 8_1_0 8_2_0 8_3_0 8_4_0 8_5_0 8_6_0 8_7_0 8_8_0 8_9_0 + 9_0_0 9_1_0 9_2_0 9_3_0 9_4_0 9_5_0 9_6_0 +) list(LENGTH VERSIONS VERSIONS_SIZE) - math(EXPR end "${VERSIONS_SIZE} - 1") include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") @@ -138,14 +63,17 @@ foreach(i RANGE 1 ${end}) if("${i}" GREATER "22") install(TARGETS "${LAST_NAME}" DESTINATION PreProcess/IDFVersionUpdater) - if(NOT ${STATIC_EXE}) + if(NOT ${FORTRAN_STATIC_EXE}) install_target_prereqs("${LAST_NAME}" PreProcess/IDFVersionUpdater) endif() endif() endforeach() -# then install all the support files + +####################################################################### +# I N S T A L L S U P P O R T F I L E S # +####################################################################### install(FILES "InputRulesFiles/Rules7-2-0-to-8-0-0.xls" DESTINATION "PreProcess/IDFVersionUpdater") install(FILES "InputRulesFiles/Rules8-0-0-to-8-1-0.xls" DESTINATION "PreProcess/IDFVersionUpdater") From 875c10826e923fad11ccc27b7409945e5a69ac8f Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 20 May 2021 18:24:18 +0200 Subject: [PATCH 2/8] fotran -static or -static-intel is a linker flag --- cmake/Fortran.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/Fortran.cmake b/cmake/Fortran.cmake index c5fffcc3b54..c3210944202 100644 --- a/cmake/Fortran.cmake +++ b/cmake/Fortran.cmake @@ -5,7 +5,7 @@ set(FORTRAN_SKIP_RPATH FALSE) if(APPLE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") target_compile_options(fortran_project_options INTERFACE -fpp) - target_compile_options(fortran_project_options INTERFACE -static-intel) + target_link_options(fortran_project_options INTERFACE -static-intel) else() if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) target_compile_options(fortran_project_options INTERFACE -cpp) @@ -15,26 +15,26 @@ elseif(UNIX) set(FORTRAN_SKIP_RPATH TRUE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") target_compile_options(fortran_project_options INTERFACE -fpp) - target_compile_options(fortran_project_options INTERFACE -static-intel) + target_link_options(fortran_project_options INTERFACE -static-intel) else() if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) target_compile_options(fortran_project_options INTERFACE -cpp) endif() - target_compile_options(fortran_project_options INTERFACE -static) set(FORTRAN_STATIC_EXE TRUE) + target_link_options(fortran_project_options INTERFACE -static) endif() else() # Windows set(FORTRAN_STATIC_EXE TRUE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") # Set release flags to be empty set(CMAKE_Fortran_FLAGS_RELEASE "") - target_compile_options(fortran_project_options INTERFACE /libs:static) target_compile_options(fortran_project_options INTERFACE /fpp) + target_link_options(fortran_project_options INTERFACE /libs:static) else() - target_compile_options(fortran_project_options INTERFACE -static) if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) target_compile_options(fortran_project_options INTERFACE -cpp) endif() + target_link_options(fortran_project_options INTERFACE -static) endif() endif() target_compile_options(fortran_project_options INTERFACE -ffree-line-length-275) From 73746f4ef7edbb965adff439219746d7e6f380b5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 15 Jun 2021 15:47:38 +0200 Subject: [PATCH 3/8] Need to include cmake/Fortran.cmake in any fortran subdir, as the CMakeAddFortranSubdirectory doesn't have parent context --- src/AppGPostProcess/CMakeLists.txt | 4 +++- src/Basement/CMakeLists.txt | 2 ++ src/CalcSoilSurfTemp/CMakeLists.txt | 4 +++- src/ConvertESOMTR/CMakeLists.txt | 2 ++ src/ExpandObjects/CMakeLists.txt | 2 ++ src/HVAC-Diagram/CMakeLists.txt | 5 ++++- src/ParametricPreprocessor/CMakeLists.txt | 4 +++- src/ReadVars/CMakeLists.txt | 2 ++ src/Slab/CMakeLists.txt | 4 +++- src/Transition/CMakeLists.txt | 2 ++ 10 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/AppGPostProcess/CMakeLists.txt b/src/AppGPostProcess/CMakeLists.txt index 7f3d3e6c4c4..f47b9310e99 100644 --- a/src/AppGPostProcess/CMakeLists.txt +++ b/src/AppGPostProcess/CMakeLists.txt @@ -14,9 +14,11 @@ set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) add_executable(AppGPostProcess ${SRC}) -target_link_libraries(AppGPostProcess PRIVATE fortran_project_options) set_target_properties(AppGPostProcess PROPERTIES FOLDER Auxiliary) +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +target_link_libraries(AppGPostProcess PRIVATE fortran_project_options) + install(TARGETS AppGPostProcess DESTINATION PostProcess) if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") diff --git a/src/Basement/CMakeLists.txt b/src/Basement/CMakeLists.txt index a360293df93..cd90888f61c 100644 --- a/src/Basement/CMakeLists.txt +++ b/src/Basement/CMakeLists.txt @@ -57,6 +57,8 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(Basement ${SRC}) set_target_properties(Basement PROPERTIES COMPILE_FLAGS "-O1") set_target_properties(Basement PROPERTIES FOLDER Auxiliary) + +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") target_link_libraries(Basement PRIVATE BasementOptions fortran_project_options) install(TARGETS Basement DESTINATION PreProcess/GrndTempCalc) diff --git a/src/CalcSoilSurfTemp/CMakeLists.txt b/src/CalcSoilSurfTemp/CMakeLists.txt index 7b23b8ad5db..0dc919aafcf 100644 --- a/src/CalcSoilSurfTemp/CMakeLists.txt +++ b/src/CalcSoilSurfTemp/CMakeLists.txt @@ -14,9 +14,11 @@ set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) add_executable(CalcSoilSurfTemp ${SRC}) -target_link_libraries(CalcSoilSurfTemp PRIVATE fortran_project_options) set_target_properties(CalcSoilSurfTemp PROPERTIES FOLDER Auxiliary) +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +target_link_libraries(CalcSoilSurfTemp PRIVATE fortran_project_options) + install(TARGETS CalcSoilSurfTemp DESTINATION PreProcess/CalcSoilSurfTemp) if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") diff --git a/src/ConvertESOMTR/CMakeLists.txt b/src/ConvertESOMTR/CMakeLists.txt index f4f9f34ee7d..64e6355a295 100644 --- a/src/ConvertESOMTR/CMakeLists.txt +++ b/src/ConvertESOMTR/CMakeLists.txt @@ -15,6 +15,8 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(convertESOMTR ${SRC}) set_target_properties(convertESOMTR PROPERTIES FOLDER Auxiliary) + +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") target_link_libraries(convertESOMTR PRIVATE fortran_project_options) install(TARGETS convertESOMTR DESTINATION "PostProcess/convertESOMTRpgm/") diff --git a/src/ExpandObjects/CMakeLists.txt b/src/ExpandObjects/CMakeLists.txt index f7a61c6712f..ff6e555e8cc 100644 --- a/src/ExpandObjects/CMakeLists.txt +++ b/src/ExpandObjects/CMakeLists.txt @@ -21,6 +21,8 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(ExpandObjects ${SRC}) target_link_libraries(ExpandObjects PRIVATE fortran_project_options) + +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") set_target_properties(ExpandObjects PROPERTIES FOLDER Auxiliary) install(TARGETS ExpandObjects DESTINATION "./") diff --git a/src/HVAC-Diagram/CMakeLists.txt b/src/HVAC-Diagram/CMakeLists.txt index deee451c200..53ec763feb0 100644 --- a/src/HVAC-Diagram/CMakeLists.txt +++ b/src/HVAC-Diagram/CMakeLists.txt @@ -14,8 +14,11 @@ set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH true) add_executable(HVAC-Diagram ${SRC}) -target_link_libraries(HVAC-Diagram PRIVATE fortran_project_options) set_target_properties(HVAC-Diagram PROPERTIES FOLDER Auxiliary) + +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +target_link_libraries(HVAC-Diagram PRIVATE fortran_project_options) + if(NOT CMAKE_Fortran_COMPILER MATCHES "ifort") target_compile_options(HVAC-Diagram PRIVATE -std=legacy) endif() diff --git a/src/ParametricPreprocessor/CMakeLists.txt b/src/ParametricPreprocessor/CMakeLists.txt index 1efcb06767e..3df9a308f4b 100644 --- a/src/ParametricPreprocessor/CMakeLists.txt +++ b/src/ParametricPreprocessor/CMakeLists.txt @@ -14,9 +14,11 @@ set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH true) add_executable(ParametricPreprocessor ${SRC}) -target_link_libraries(ParametricPreprocessor PRIVATE fortran_project_options) set_target_properties(ParametricPreprocessor PROPERTIES FOLDER Auxiliary) +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +target_link_libraries(ParametricPreprocessor PRIVATE fortran_project_options) + install(TARGETS ParametricPreprocessor DESTINATION PreProcess/ParametricPreprocessor) if(NOT ${FORTRAN_STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") diff --git a/src/ReadVars/CMakeLists.txt b/src/ReadVars/CMakeLists.txt index 5607c31f5ee..507b3285426 100644 --- a/src/ReadVars/CMakeLists.txt +++ b/src/ReadVars/CMakeLists.txt @@ -15,6 +15,8 @@ set(SKIP_BUILD_RPATH true) add_executable(ReadVarsESO ${SRC}) set_target_properties(ReadVarsESO PROPERTIES FOLDER Auxiliary) + +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") target_link_libraries(ReadVarsESO PRIVATE fortran_project_options) install(TARGETS ReadVarsESO DESTINATION PostProcess) diff --git a/src/Slab/CMakeLists.txt b/src/Slab/CMakeLists.txt index 40b91b43f9d..c1e82c60eff 100644 --- a/src/Slab/CMakeLists.txt +++ b/src/Slab/CMakeLists.txt @@ -26,9 +26,11 @@ set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH true) add_executable(Slab ${SRC}) -target_link_libraries(Slab PRIVATE fortran_project_options) set_target_properties(Slab PROPERTIES FOLDER Auxiliary) +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +target_link_libraries(Slab PRIVATE fortran_project_options) + install(TARGETS Slab DESTINATION PreProcess/GrndTempCalc) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") diff --git a/src/Transition/CMakeLists.txt b/src/Transition/CMakeLists.txt index 03a95f4afb7..f74075075e0 100644 --- a/src/Transition/CMakeLists.txt +++ b/src/Transition/CMakeLists.txt @@ -28,6 +28,8 @@ set(LIB_SRC add_library(TransitionLib STATIC ${LIB_SRC}) target_include_directories(TransitionLib PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_compile_options(TransitionLib PUBLIC -fbounds-check) + +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") target_link_libraries(TransitionLib PUBLIC fortran_project_options) # ffree-line-length-none set(VERSIONS From be18e32655c09a5e9562eecd9eec7886cae4e8d5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 15 Jun 2021 17:02:12 +0200 Subject: [PATCH 4/8] modernize this one for -O1 in Basement. --- src/Basement/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Basement/CMakeLists.txt b/src/Basement/CMakeLists.txt index cd90888f61c..d0f65493574 100644 --- a/src/Basement/CMakeLists.txt +++ b/src/Basement/CMakeLists.txt @@ -55,7 +55,7 @@ set(CMAKE_SKIP_RPATH ${FORTRAN_SKIP_RPATH}) set(SKIP_BUILD_RPATH TRUE) add_executable(Basement ${SRC}) -set_target_properties(Basement PROPERTIES COMPILE_FLAGS "-O1") +target_compile_options(Basement PRIVATE -O1) set_target_properties(Basement PROPERTIES FOLDER Auxiliary) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") From 92fbf394e25f328dd2fee3281114db226c7748df Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 15 Jun 2021 17:50:18 +0200 Subject: [PATCH 5/8] Try to unbreak unix --- CMakeLists.txt | 7 ++++++- src/AppGPostProcess/CMakeLists.txt | 6 +++++- src/Basement/CMakeLists.txt | 6 +++++- src/CalcSoilSurfTemp/CMakeLists.txt | 6 +++++- src/ConvertESOMTR/CMakeLists.txt | 6 +++++- src/ExpandObjects/CMakeLists.txt | 6 +++++- src/HVAC-Diagram/CMakeLists.txt | 6 +++++- src/ParametricPreprocessor/CMakeLists.txt | 6 +++++- src/ReadVars/CMakeLists.txt | 6 +++++- src/Slab/CMakeLists.txt | 6 +++++- src/Transition/CMakeLists.txt | 6 +++++- 11 files changed, 56 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18107bcf44c..f229c8df619 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,7 +326,12 @@ add_subdirectory(src/ConvertInputFormat) if(BUILD_FORTRAN) include(CMakeAddFortranSubdirectory) - include(cmake/Fortran.cmake) + 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() cmake_add_fortran_subdirectory( src/ExpandObjects PROJECT ExpandObjects diff --git a/src/AppGPostProcess/CMakeLists.txt b/src/AppGPostProcess/CMakeLists.txt index f47b9310e99..b73311344ef 100644 --- a/src/AppGPostProcess/CMakeLists.txt +++ b/src/AppGPostProcess/CMakeLists.txt @@ -16,7 +16,11 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(AppGPostProcess ${SRC}) set_target_properties(AppGPostProcess PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "AppGPostProcess: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(AppGPostProcess PRIVATE fortran_project_options) install(TARGETS AppGPostProcess DESTINATION PostProcess) diff --git a/src/Basement/CMakeLists.txt b/src/Basement/CMakeLists.txt index d0f65493574..ee37d3605e3 100644 --- a/src/Basement/CMakeLists.txt +++ b/src/Basement/CMakeLists.txt @@ -58,7 +58,11 @@ add_executable(Basement ${SRC}) target_compile_options(Basement PRIVATE -O1) set_target_properties(Basement PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "Basement: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(Basement PRIVATE BasementOptions fortran_project_options) install(TARGETS Basement DESTINATION PreProcess/GrndTempCalc) diff --git a/src/CalcSoilSurfTemp/CMakeLists.txt b/src/CalcSoilSurfTemp/CMakeLists.txt index 0dc919aafcf..89bc4f54c29 100644 --- a/src/CalcSoilSurfTemp/CMakeLists.txt +++ b/src/CalcSoilSurfTemp/CMakeLists.txt @@ -16,7 +16,11 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(CalcSoilSurfTemp ${SRC}) set_target_properties(CalcSoilSurfTemp PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "CalcSoilSurfTemp: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(CalcSoilSurfTemp PRIVATE fortran_project_options) install(TARGETS CalcSoilSurfTemp DESTINATION PreProcess/CalcSoilSurfTemp) diff --git a/src/ConvertESOMTR/CMakeLists.txt b/src/ConvertESOMTR/CMakeLists.txt index 64e6355a295..49bb8cf2394 100644 --- a/src/ConvertESOMTR/CMakeLists.txt +++ b/src/ConvertESOMTR/CMakeLists.txt @@ -16,7 +16,11 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(convertESOMTR ${SRC}) set_target_properties(convertESOMTR PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "ConvertESOMTR: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(convertESOMTR PRIVATE fortran_project_options) install(TARGETS convertESOMTR DESTINATION "PostProcess/convertESOMTRpgm/") diff --git a/src/ExpandObjects/CMakeLists.txt b/src/ExpandObjects/CMakeLists.txt index ff6e555e8cc..768c6805cbf 100644 --- a/src/ExpandObjects/CMakeLists.txt +++ b/src/ExpandObjects/CMakeLists.txt @@ -22,7 +22,11 @@ set(SKIP_BUILD_RPATH TRUE) add_executable(ExpandObjects ${SRC}) target_link_libraries(ExpandObjects PRIVATE fortran_project_options) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "ExpandObjects: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") set_target_properties(ExpandObjects PROPERTIES FOLDER Auxiliary) install(TARGETS ExpandObjects DESTINATION "./") diff --git a/src/HVAC-Diagram/CMakeLists.txt b/src/HVAC-Diagram/CMakeLists.txt index 53ec763feb0..369fe8658c4 100644 --- a/src/HVAC-Diagram/CMakeLists.txt +++ b/src/HVAC-Diagram/CMakeLists.txt @@ -16,7 +16,11 @@ set(SKIP_BUILD_RPATH true) add_executable(HVAC-Diagram ${SRC}) set_target_properties(HVAC-Diagram PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "HVAC-Diagram: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(HVAC-Diagram PRIVATE fortran_project_options) if(NOT CMAKE_Fortran_COMPILER MATCHES "ifort") diff --git a/src/ParametricPreprocessor/CMakeLists.txt b/src/ParametricPreprocessor/CMakeLists.txt index 3df9a308f4b..28369fa5157 100644 --- a/src/ParametricPreprocessor/CMakeLists.txt +++ b/src/ParametricPreprocessor/CMakeLists.txt @@ -16,7 +16,11 @@ set(SKIP_BUILD_RPATH true) add_executable(ParametricPreprocessor ${SRC}) set_target_properties(ParametricPreprocessor PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "ParametricPreprocessor: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(ParametricPreprocessor PRIVATE fortran_project_options) install(TARGETS ParametricPreprocessor DESTINATION PreProcess/ParametricPreprocessor) diff --git a/src/ReadVars/CMakeLists.txt b/src/ReadVars/CMakeLists.txt index 507b3285426..068a8b01573 100644 --- a/src/ReadVars/CMakeLists.txt +++ b/src/ReadVars/CMakeLists.txt @@ -16,7 +16,11 @@ set(SKIP_BUILD_RPATH true) add_executable(ReadVarsESO ${SRC}) set_target_properties(ReadVarsESO PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "ReadVars: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(ReadVarsESO PRIVATE fortran_project_options) install(TARGETS ReadVarsESO DESTINATION PostProcess) diff --git a/src/Slab/CMakeLists.txt b/src/Slab/CMakeLists.txt index c1e82c60eff..9fbc9fdd8b7 100644 --- a/src/Slab/CMakeLists.txt +++ b/src/Slab/CMakeLists.txt @@ -28,7 +28,11 @@ set(SKIP_BUILD_RPATH true) add_executable(Slab ${SRC}) set_target_properties(Slab PROPERTIES FOLDER Auxiliary) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "Slab: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(Slab PRIVATE fortran_project_options) install(TARGETS Slab DESTINATION PreProcess/GrndTempCalc) diff --git a/src/Transition/CMakeLists.txt b/src/Transition/CMakeLists.txt index f74075075e0..14d4a5e6553 100644 --- a/src/Transition/CMakeLists.txt +++ b/src/Transition/CMakeLists.txt @@ -29,7 +29,11 @@ add_library(TransitionLib STATIC ${LIB_SRC}) target_include_directories(TransitionLib PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_compile_options(TransitionLib PUBLIC -fbounds-check) -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +if(NOT UNIX) # Defined as top-level target on Unix only + include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Fortran.cmake") +endif() +get_target_property(F_INTERFACE_COMPILE_FLAGS fortran_project_options INTERFACE_COMPILE_OPTIONS) +message(DEBUG "Transition: F_INTERFACE_COMPILE_FLAGS=${F_INTERFACE_COMPILE_FLAGS}") target_link_libraries(TransitionLib PUBLIC fortran_project_options) # ffree-line-length-none set(VERSIONS From 6670e3106cd01fefe19a91c660caed889da64955 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 15 Jun 2021 18:07:11 +0200 Subject: [PATCH 6/8] Apparently on windows I need to define it both at top level and in each fortran subdirectory On Unix it is seen and detected as multiple targets defined with the same name (CMP0002), so only do it once at top level. --- CMakeLists.txt | 8 ++------ src/AppGPostProcess/CMakeLists.txt | 2 +- src/Basement/CMakeLists.txt | 2 +- src/CalcSoilSurfTemp/CMakeLists.txt | 2 +- src/ConvertESOMTR/CMakeLists.txt | 2 +- src/ExpandObjects/CMakeLists.txt | 2 +- src/HVAC-Diagram/CMakeLists.txt | 2 +- src/ParametricPreprocessor/CMakeLists.txt | 2 +- src/ReadVars/CMakeLists.txt | 2 +- src/Slab/CMakeLists.txt | 2 +- src/Transition/CMakeLists.txt | 2 +- 11 files changed, 12 insertions(+), 16 deletions(-) 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) From c4083f043b583aad0bfaa2b96d1c83f1c52eed51 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 15 Jun 2021 19:03:46 +0200 Subject: [PATCH 7/8] Missing a target_include_directory for Unix I changed a `include_directory()` to a target_include_directory but forgot to do it for each Transition lib as well. --- src/Transition/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Transition/CMakeLists.txt b/src/Transition/CMakeLists.txt index df0468d78a4..06f18f8f798 100644 --- a/src/Transition/CMakeLists.txt +++ b/src/Transition/CMakeLists.txt @@ -64,6 +64,7 @@ foreach(i RANGE 1 ${end}) set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${LAST_NAME}) add_executable("${LAST_NAME}" ${SRC}) + target_include_directories("${LAST_NAME}" PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) set_target_properties("${LAST_NAME}" PROPERTIES FOLDER Auxiliary) target_link_libraries("${LAST_NAME}" TransitionLib) From db130e24323bb7764dd7a05f64552258fef07a3f Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 18 Jun 2021 16:35:05 +0200 Subject: [PATCH 8/8] Fix #8496 - Install GraphHints.csv on linux as well. --- cmake/Install.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 9376ef4d8c5..8e7b8696042 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -531,6 +531,7 @@ elseif(UNIX) "/usr/local/${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}-${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}") install(PROGRAMS "${PROJECT_SOURCE_DIR}/bin/EP-Compare/Run-Linux/EP-Compare" DESTINATION "PostProcess/EP-Compare/") + install(FILES "${PROJECT_SOURCE_DIR}/bin/EP-Compare/GraphHints.csv" DESTINATION "PostProcess/EP-Compare/") install(FILES "${PROJECT_SOURCE_DIR}/bin/EP-Compare/Run-Linux/EP-Compare Libs/EHInterfaces5001.so" DESTINATION "PostProcess/EP-Compare/EP-Compare Libs/") install(FILES "${PROJECT_SOURCE_DIR}/bin/EP-Compare/Run-Linux/EP-Compare Libs/EHObjectArray5001.so"