diff --git a/src/AppGPostProcess/CMakeLists.txt b/src/AppGPostProcess/CMakeLists.txt index ad59ecd5278..bdab23eb1fa 100644 --- a/src/AppGPostProcess/CMakeLists.txt +++ b/src/AppGPostProcess/CMakeLists.txt @@ -4,9 +4,9 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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" ) set(SRC AppGPostProcess.f90) @@ -35,7 +35,7 @@ elseif(UNIX) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") set(STATIC_EXE TRUE) endif() -else() # Windows +else() # Windows set(STATIC_EXE TRUE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") # Set release flags to be empty @@ -52,11 +52,12 @@ else() # Windows endif() set(SKIP_BUILD_RPATH TRUE) -add_executable(AppGPostProcess ${SRC}) +add_executable( AppGPostProcess ${SRC} ) set_target_properties(AppGPostProcess PROPERTIES FOLDER Auxiliary) -install(TARGETS AppGPostProcess DESTINATION PostProcess) +install( TARGETS AppGPostProcess DESTINATION PostProcess ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(AppGPostProcess PostProcess) + install_target_prereqs( AppGPostProcess PostProcess ) endif() + diff --git a/src/Basement/CMakeLists.txt b/src/Basement/CMakeLists.txt index c4cd5e540e5..79807ced457 100644 --- a/src/Basement/CMakeLists.txt +++ b/src/Basement/CMakeLists.txt @@ -4,20 +4,21 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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" ) set(SRC - 3DBasementHT.f90 - DataGlobals.f90 - DataStringGlobals.f90 - EPWRead.f90 - UtilityRoutines.f90 - DataPrecisionGlobals.f90 - EPWPrecisionGlobals.f90 - InputProcessor.f90 - BasementSimData.f90) + 3DBasementHT.f90 + DataGlobals.f90 + DataStringGlobals.f90 + EPWRead.f90 + UtilityRoutines.f90 + DataPrecisionGlobals.f90 + EPWPrecisionGlobals.f90 + InputProcessor.f90 + BasementSimData.f90 +) set(STATIC_EXE FALSE) @@ -25,25 +26,23 @@ 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") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffloat-store" ) 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} -ffloat-store") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffloat-store" ) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static" ) set(STATIC_EXE TRUE) endif() -else() # Windows +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-" - ) + 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") @@ -51,14 +50,17 @@ else() # Windows endif() set(SKIP_BUILD_RPATH TRUE) -add_executable(Basement ${SRC}) +add_executable( Basement ${SRC} ) -set_target_properties(Basement PROPERTIES COMPILE_FLAGS "-O1 -ffree-line-length-200 ${SHARED_FLAGS}") +set_target_properties(Basement PROPERTIES + COMPILE_FLAGS "-O1 -ffree-line-length-200 ${SHARED_FLAGS}" +) set_target_properties(Basement PROPERTIES FOLDER Auxiliary) -install(TARGETS Basement DESTINATION PreProcess/GrndTempCalc) +install( TARGETS Basement DESTINATION PreProcess/GrndTempCalc ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(Basement PreProcess/GrndTempCalc) + install_target_prereqs( Basement PreProcess/GrndTempCalc ) endif() install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../idd/BasementGHT.idd" DESTINATION "PreProcess/GrndTempCalc/") + diff --git a/src/CalcSoilSurfTemp/CMakeLists.txt b/src/CalcSoilSurfTemp/CMakeLists.txt index 3894fde90f2..1a0a66b34a6 100644 --- a/src/CalcSoilSurfTemp/CMakeLists.txt +++ b/src/CalcSoilSurfTemp/CMakeLists.txt @@ -4,62 +4,60 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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" ) set(SRC EPWRead.f90 SoilSurfTemp.f90) set(STATIC_EXE FALSE) -add_library(CalcSoilSurfTempOptions INTERFACE) - if(APPLE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") - target_compile_options(CalcSoilSurfTempOptions INTERFACE -fpp) - target_compile_options(CalcSoilSurfTempOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") else() if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(CalcSoilSurfTempOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(CalcSoilSurfTempOptions INTERFACE -ffree-line-length-200) + 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") - target_compile_options(CalcSoilSurfTempOptions INTERFACE -fpp) - target_compile_options(CalcSoilSurfTempOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") else() if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(CalcSoilSurfTempOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(CalcSoilSurfTempOptions INTERFACE -static) - target_compile_options(CalcSoilSurfTempOptions INTERFACE -ffree-line-length-200) + 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 +else() # Windows set(STATIC_EXE TRUE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") # Set release flags to be empty set(CMAKE_Fortran_FLAGS_RELEASE "") - target_compile_options(CalcSoilSurfTempOptions INTERFACE /libs:static) - target_compile_options(CalcSoilSurfTempOptions INTERFACE /fpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") else() - target_compile_options(CalcSoilSurfTempOptions INTERFACE -static) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(CalcSoilSurfTempOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(CalcSoilSurfTempOptions INTERFACE -ffree-line-length-200) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") endif() endif() set(SKIP_BUILD_RPATH TRUE) -add_executable(CalcSoilSurfTemp ${SRC}) -target_link_libraries(CalcSoilSurfTemp PRIVATE CalcSoilSurfTempOptions) +ADD_EXECUTABLE( CalcSoilSurfTemp ${SRC} ) set_target_properties(CalcSoilSurfTemp PROPERTIES FOLDER Auxiliary) -install(TARGETS CalcSoilSurfTemp DESTINATION PreProcess/CalcSoilSurfTemp) +install( TARGETS CalcSoilSurfTemp DESTINATION PreProcess/CalcSoilSurfTemp ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(CalcSoilSurfTemp PreProcess/CalcSoilSurfTemp) + install_target_prereqs( CalcSoilSurfTemp PreProcess/CalcSoilSurfTemp ) endif() + diff --git a/src/ConvertInputFormat/CMakeLists.txt b/src/ConvertInputFormat/CMakeLists.txt index 74a65562454..07009f6f79c 100644 --- a/src/ConvertInputFormat/CMakeLists.txt +++ b/src/ConvertInputFormat/CMakeLists.txt @@ -1,39 +1,45 @@ cmake_minimum_required(VERSION 3.5.1) project(ConvertInputFormat) +set(CMAKE_CXX_STANDARD 11) + # Set the CFLAGS and CXXFLAGS depending on the options the user specified. # Only GCC-like compilers support -Wextra, and other compilers give tons of # output for -Wall, so only -Wall and -Wextra on GCC. -#if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") -#endif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -# -if(APPLE OR UNIX) - add_executable(ConvertInputFormat main.cpp) -else() # windows - add_executable(ConvertInputFormat main.cpp) # "${CMAKE_CURRENT_BINARY_DIR}/energyplus.rc" ) -endif() - - -target_link_libraries(ConvertInputFormat PRIVATE project_options project_warnings) +if (CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") +endif (CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # Detect OpenMP support in a compiler. If the compiler supports OpenMP, the # flags to compile with OpenMP are returned and added. find_package(OpenMP) -if(OpenMP_CXX_FOUND) - target_link_libraries(ConvertInputFormat PRIVATE OpenMP::OpenMP_CXX) +if (OPENMP_FOUND) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +endif (OPENMP_FOUND) + +if (UNIX) + ADD_DEFINITIONS("-fPIC") endif() +if (APPLE OR UNIX) + add_executable( ConvertInputFormat main.cpp ) +else() # windows + add_executable( ConvertInputFormat main.cpp ) # "${CMAKE_CURRENT_BINARY_DIR}/energyplus.rc" ) +endif() + +target_link_libraries( ConvertInputFormat energyplusparser ) -target_link_libraries(ConvertInputFormat PRIVATE energyplusparser ${CMAKE_DL_LIBS}) +if(UNIX AND NOT APPLE) + target_link_libraries( ConvertInputFormat dl ) +endif() -if(WIN32) - target_link_libraries(ConvertInputFormat PRIVATE Shlwapi) +if (WIN32) + target_link_libraries( ConvertInputFormat Shlwapi ) endif() set_target_properties(ConvertInputFormat PROPERTIES VERSION ${ENERGYPLUS_VERSION}) set_target_properties(ConvertInputFormat PROPERTIES FOLDER Auxiliary) -install(TARGETS ConvertInputFormat DESTINATION ./) - +install( TARGETS ConvertInputFormat DESTINATION ./ ) diff --git a/src/ExpandObjects/CMakeLists.txt b/src/ExpandObjects/CMakeLists.txt index 1750eb33a31..0105e30b38d 100644 --- a/src/ExpandObjects/CMakeLists.txt +++ b/src/ExpandObjects/CMakeLists.txt @@ -4,71 +4,70 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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") + configure_file( ExpandObjects.rc.in "${CMAKE_CURRENT_BINARY_DIR}/ExpandObjects.rc" ) endif() set(SRC epfilter.f90) set(STATIC_EXE FALSE) -add_library(ExpandObjectsOptions INTERFACE) - if(APPLE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") - target_compile_options(ExpandObjectsOptions INTERFACE -fpp) - target_compile_options(ExpandObjectsOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") else() if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(ExpandObjectsOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(ExpandObjectsOptions INTERFACE -ffree-line-length-200) + 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") - target_compile_options(ExpandObjectsOptions INTERFACE -fpp) - target_compile_options(ExpandObjectsOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") else() if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(ExpandObjectsOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(ExpandObjectsOptions INTERFACE -static) - target_compile_options(ExpandObjectsOptions INTERFACE -ffree-line-length-200) + 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 +else() # Windows set(STATIC_EXE TRUE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") # Set release flags to be empty set(CMAKE_Fortran_FLAGS_RELEASE "") - target_compile_options(ExpandObjectsOptions INTERFACE /libs:static) - target_compile_options(ExpandObjectsOptions INTERFACE /fpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") else() - target_compile_options(ExpandObjectsOptions INTERFACE -static) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(ExpandObjectsOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(ExpandObjectsOptions INTERFACE -ffree-line-length-200) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-200") endif() endif() 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") +if (APPLE OR UNIX) + add_executable( ExpandObjects ${SRC} ) +else() # windows + add_executable( ExpandObjects ${SRC} "${CMAKE_CURRENT_BINARY_DIR}/ExpandObjects.rc" ) endif() -target_link_libraries(ExpandObjects ExpandObjectsOptions) set_target_properties(ExpandObjects PROPERTIES FOLDER Auxiliary) -install(TARGETS ExpandObjects DESTINATION "./") + +install( TARGETS ExpandObjects DESTINATION "./" ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(ExpandObjects "./") + install_target_prereqs( ExpandObjects "./" ) endif() + diff --git a/src/ParametricPreprocessor/CMakeLists.txt b/src/ParametricPreprocessor/CMakeLists.txt index dd32a28bdf1..209fe55bf35 100644 --- a/src/ParametricPreprocessor/CMakeLists.txt +++ b/src/ParametricPreprocessor/CMakeLists.txt @@ -4,9 +4,9 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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" ) set(SRC ParametricPreprocessor.f90) @@ -14,14 +14,14 @@ set(STATIC_EXE FALSE) if(APPLE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") + 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") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel" ) else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static" ) set(STATIC_EXE TRUE) endif() else() @@ -36,13 +36,16 @@ else() endif() set(SKIP_BUILD_RPATH true) -add_executable(ParametricPreprocessor ${SRC}) +add_executable( ParametricPreprocessor ${SRC} ) set_target_properties(ParametricPreprocessor PROPERTIES FOLDER Auxiliary) -set_target_properties(ParametricPreprocessor PROPERTIES COMPILE_FLAGS "-ffree-line-length-200 ${SHARED_FLAGS}") +set_target_properties(ParametricPreprocessor PROPERTIES + COMPILE_FLAGS "-ffree-line-length-200 ${SHARED_FLAGS}" +) -install(TARGETS ParametricPreprocessor DESTINATION PreProcess/ParametricPreprocessor) +install( TARGETS ParametricPreprocessor DESTINATION PreProcess/ParametricPreprocessor ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(ParametricPreprocessor PreProcess/ParametricPreprocessor) + install_target_prereqs( ParametricPreprocessor PreProcess/ParametricPreprocessor ) endif() + diff --git a/src/ReadVars/CMakeLists.txt b/src/ReadVars/CMakeLists.txt index b32d4499e08..bf5e1456c22 100644 --- a/src/ReadVars/CMakeLists.txt +++ b/src/ReadVars/CMakeLists.txt @@ -4,9 +4,9 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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" ) set(SRC ReadVarsESO.f90) @@ -14,14 +14,14 @@ set(STATIC_EXE FALSE) if(APPLE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") + 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") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel" ) else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static" ) set(STATIC_EXE TRUE) endif() else() @@ -36,11 +36,12 @@ else() endif() set(SKIP_BUILD_RPATH true) -add_executable(ReadVarsESO ${SRC}) +add_executable( ReadVarsESO ${SRC} ) set_target_properties(ReadVarsESO PROPERTIES FOLDER Auxiliary) -install(TARGETS ReadVarsESO DESTINATION PostProcess) +install( TARGETS ReadVarsESO DESTINATION PostProcess ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(ReadVarsESO PostProcess) + install_target_prereqs( ReadVarsESO PostProcess ) endif() + diff --git a/src/Slab/CMakeLists.txt b/src/Slab/CMakeLists.txt index 0aec91e3b1d..1f26f69658b 100644 --- a/src/Slab/CMakeLists.txt +++ b/src/Slab/CMakeLists.txt @@ -4,61 +4,62 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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" ) set(SRC - 3DSlabHT.f90 - DataGlobals.f90 - DataStringGlobals.f90 - EPWRead.f90 - General.f90 - MainProgram.f90 - UtilityRoutines.f90 - DataPrecisionGlobals.f90 - EPWPrecisionGlobals.f90 - EPWWeather.f90 - InputProcessor.f90 - SimData.f90) + 3DSlabHT.f90 + DataGlobals.f90 + DataStringGlobals.f90 + EPWRead.f90 + General.f90 + MainProgram.f90 + UtilityRoutines.f90 + DataPrecisionGlobals.f90 + EPWPrecisionGlobals.f90 + EPWWeather.f90 + InputProcessor.f90 + SimData.f90 +) set(STATIC_EXE FALSE) -add_library(SlabOptions INTERFACE) - if(APPLE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") - target_compile_options(SlabOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel" ) endif() elseif(UNIX) set(CMAKE_SKIP_RPATH TRUE) if(CMAKE_Fortran_COMPILER MATCHES "ifort") - target_compile_options(SlabOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel" ) else() - target_compile_options(SlabOptions INTERFACE -static) + 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 "") - target_compile_options(SlabOptions INTERFACE /libs:static) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") else() - target_compile_options(SlabOptions INTERFACE -static) + 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 SlabOptions) +add_executable( Slab ${SRC} ) set_target_properties(Slab PROPERTIES FOLDER Auxiliary) -set_target_properties(Slab PROPERTIES COMPILE_FLAGS "-ffree-line-length-200 ${SHARED_FLAGS}") +set_target_properties(Slab PROPERTIES + COMPILE_FLAGS "-ffree-line-length-200 ${SHARED_FLAGS}" +) -install(TARGETS Slab DESTINATION PreProcess/GrndTempCalc) +install( TARGETS Slab DESTINATION PreProcess/GrndTempCalc ) if(NOT ${STATIC_EXE}) include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") - install_target_prereqs(Slab PreProcess/GrndTempCalc) + install_target_prereqs( Slab PreProcess/GrndTempCalc ) endif() install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../idd/SlabGHT.idd" DESTINATION "PreProcess/GrndTempCalc/") + diff --git a/src/Transition/CMakeLists.txt b/src/Transition/CMakeLists.txt index a775b3da245..db7885961d5 100644 --- a/src/Transition/CMakeLists.txt +++ b/src/Transition/CMakeLists.txt @@ -4,123 +4,119 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0012 NEW) # if() recognizes boolean constants -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") +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) # first create a static library of shared stuff set(LIB_SRC - DataGlobals.f90 - DataStringGlobals.f90 - DataVCompareGlobals.f90 - DisplayRoutines.f90 - General.f90 - InputProcessor.f90 - platformDepUtilityRoutines.f90 - SortAndStringUtilities.f90 - UtilityRoutines.f90 - VCompareGlobalRoutines.f90 - VCompareUtilityRoutines.f90) -add_library(TransitionLib STATIC ${LIB_SRC}) -target_include_directories(TransitionLib PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) - - -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) - - -add_library(TransitionOptions INTERFACE) + DataGlobals.f90 + DataStringGlobals.f90 + DataVCompareGlobals.f90 + DisplayRoutines.f90 + General.f90 + InputProcessor.f90 + platformDepUtilityRoutines.f90 + 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 ) if(APPLE) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" ) if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(TransitionOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(TransitionOptions INTERFACE -ffree-line-length-none) - target_compile_options(TransitionOptions INTERFACE -fbounds-check) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check") else() - target_compile_options(TransitionOptions INTERFACE -fpp) - target_compile_options(TransitionOptions INTERFACE -static-intel) + 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") - target_compile_options(TransitionOptions INTERFACE -static) + if( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" ) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static" ) if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(TransitionOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(TransitionOptions INTERFACE -ffree-line-length-none) - target_compile_options(TransitionOptions INTERFACE -fbounds-check) + 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() - target_compile_options(TransitionOptions INTERFACE -fpp) - target_compile_options(TransitionOptions INTERFACE -static-intel) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-intel") endif() -else() # Windows +else() # Windows set(STATIC_EXE TRUE) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - target_compile_options(TransitionOptions INTERFACE -static) + if( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" ) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static") if(NOT "Ninja" STREQUAL ${CMAKE_GENERATOR}) - target_compile_options(TransitionOptions INTERFACE -cpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp") endif() - target_compile_options(TransitionOptions INTERFACE -ffree-line-length-none) - target_compile_options(TransitionOptions INTERFACE -fbounds-check) + 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 "") - target_compile_options(TransitionOptions INTERFACE /libs:static) - target_compile_options(TransitionOptions INTERFACE /fpp) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /libs:static") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp") endif() endif() -target_compile_options(TransitionLib PUBLIC TransitionOptions) - -list(LENGTH VERSIONS VERSIONS_SIZE) +list( LENGTH VERSIONS VERSIONS_SIZE) math(EXPR end "${VERSIONS_SIZE} - 1") include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/ProjectMacros.cmake") -foreach(i RANGE 1 ${end}) +foreach( i RANGE 1 ${end} ) math(EXPR ii "${i} - 1") @@ -128,22 +124,25 @@ foreach(i RANGE 1 ${end}) list(GET VERSIONS ${i} NEW_VERSION) # then create all the binaries using just the Transition source and the appropriate version of the main sub - set(SRC Transition.f90 CreateNewIDFUsingRulesV${NEW_VERSION}.f90) + set(SRC + Transition.f90 + CreateNewIDFUsingRulesV${NEW_VERSION}.f90 + ) - string(REPLACE _ - OLD-VERSION ${OLD_VERSION}) - string(REPLACE _ - NEW-VERSION ${NEW_VERSION}) + string( REPLACE _ - OLD-VERSION ${OLD_VERSION} ) + string( REPLACE _ - NEW-VERSION ${NEW_VERSION} ) - set(LAST_NAME "Transition-V${OLD-VERSION}-to-V${NEW-VERSION}") + set(LAST_NAME "Transition-V${OLD-VERSION}-to-V${NEW-VERSION}" ) - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${LAST_NAME}) - add_executable("${LAST_NAME}" ${SRC}) + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${LAST_NAME} ) + add_executable( "${LAST_NAME}" ${SRC} ) set_target_properties("${LAST_NAME}" PROPERTIES FOLDER Auxiliary) - target_link_libraries("${LAST_NAME}" TransitionLib) + target_link_libraries( "${LAST_NAME}" TransitionLib ) - if("${i}" GREATER "22") - install(TARGETS "${LAST_NAME}" DESTINATION PreProcess/IDFVersionUpdater) + if( "${i}" GREATER "22" ) + install( TARGETS "${LAST_NAME}" DESTINATION PreProcess/IDFVersionUpdater ) if(NOT ${STATIC_EXE}) - install_target_prereqs("${LAST_NAME}" PreProcess/IDFVersionUpdater) + install_target_prereqs( "${LAST_NAME}" PreProcess/IDFVersionUpdater ) endif() endif()