From 0f7ed710b6784ec296f6ff7046a2acc62b6a8ac5 Mon Sep 17 00:00:00 2001 From: Liam Bindle Date: Fri, 7 Feb 2020 20:42:16 +0000 Subject: [PATCH 1/2] Updated CMakeLists to work with GEOS-ESM/ESMA_cmake#57 --- GMAO_pFIO/CMakeLists.txt | 4 +--- MAPL/CMakeLists.txt | 3 +-- MAPL_Base/CMakeLists.txt | 8 +++++--- MAPL_cfio/CMakeLists.txt | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/GMAO_pFIO/CMakeLists.txt b/GMAO_pFIO/CMakeLists.txt index 3b5a59e0d5b6..8438743b7e39 100644 --- a/GMAO_pFIO/CMakeLists.txt +++ b/GMAO_pFIO/CMakeLists.txt @@ -87,11 +87,9 @@ set (srcs ) esma_add_library (${this} SRCS ${srcs}) -target_link_libraries (${this} gftl gftl-shared ${NETCDF_LIBRARIES}) +target_link_libraries (${this} PUBLIC Baselibs) -target_compile_options (${this} PRIVATE $<$:${OpenMP_Fortran_FLAGS}>) set_target_properties (${this} PROPERTIES Fortran_MODULE_DIRECTORY ${include_${this}}) -target_link_libraries (${this} ${MPI_Fortran_LIBRARIES} ${OpenMP_Fortran_LIBRARIES}) # Kludge for OSX security and DYLD_LIBRARY_PATH ... foreach(dir ${OSX_EXTRA_LIBRARY_PATH}) target_link_libraries(${this} "-Xlinker -rpath -Xlinker ${dir}") diff --git a/MAPL/CMakeLists.txt b/MAPL/CMakeLists.txt index d4a8e61b379d..625b4b0a1268 100644 --- a/MAPL/CMakeLists.txt +++ b/MAPL/CMakeLists.txt @@ -3,8 +3,7 @@ esma_set_this() esma_add_library (${this} SRCS MAPL.F90 - DEPENDENCIES MAPL_Base GMAO_pFIO MAPL_cfio_r4 - INCLUDES ${INC_ESMF} + DEPENDENCIES MAPL_Base GMAO_pFIO MAPL_cfio_r4 ESMF ) diff --git a/MAPL_Base/CMakeLists.txt b/MAPL_Base/CMakeLists.txt index 15e162f0ab71..3b303ba56a67 100644 --- a/MAPL_Base/CMakeLists.txt +++ b/MAPL_Base/CMakeLists.txt @@ -22,7 +22,7 @@ set (srcs MAPL_GenericCplComp.F90 MAPL_Sort.F90 MAPL_Generic.F90 MAPL_sun_uc.F90 MAPL_SatVapor.F90 MAPL_HistoryCollection.F90 - MAPL_HistoryGridComp.F90 MAPL_CapOptions.F90 MAPL_FlapCapOptions.F90 + MAPL_HistoryGridComp.F90 MAPL_CapOptions.F90 $<$:MAPL_FlapCapOptions.F90> MAPL_Cap.F90 hash.c MAPL_CapGridComp.F90 MAPL_GridType.F90 @@ -63,8 +63,7 @@ set (srcs FileMetadataUtilities.F90 FileMetadataUtilitiesVector.F90 ) -esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_pFIO MAPL_cfio_r4 gftl-shared FLAP::FLAP) -target_compile_options (${this} PRIVATE $<$:${OpenMP_Fortran_FLAGS}>) +esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_pFIO MAPL_cfio_r4 gftl-shared $<$:FLAP::FLAP>) target_compile_definitions (${this} PRIVATE TWO_SIDED_COMM MAPL_MODE) # Kludge for OSX security and DYLD_LIBRARY_PATH ... @@ -89,6 +88,9 @@ endif() #-------------------- target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF}) target_link_libraries (${this} PUBLIC ${ESMF_LIBRARIES} ${MPI_Fortran_LIBRARIES}) +if(FLAP_FOUND) + target_compile_definitions(${this} PRIVATE USE_FLAP) +endif() #-------------------- # Copy include files that are used by other libraries. diff --git a/MAPL_cfio/CMakeLists.txt b/MAPL_cfio/CMakeLists.txt index 1da15c7b7a77..4551d29e5af8 100644 --- a/MAPL_cfio/CMakeLists.txt +++ b/MAPL_cfio/CMakeLists.txt @@ -31,7 +31,7 @@ esma_add_library (${lib} SRCS ${srcs} DEPENDENCIES ${ESMF_LIBRARIES} ) -target_include_directories (${lib} PUBLIC ${INC_NETCDF} ${INC_ESMF}) +target_link_libraries(${lib} PUBLIC Baselibs) if (precision MATCHES "r8") string (REPLACE " " ";" flags ${FREAL8}) From 2c7d66f79d0dfe5c97a0ac21585a1f7b42ad0186 Mon Sep 17 00:00:00 2001 From: Liam Bindle Date: Tue, 11 Feb 2020 15:24:24 -0600 Subject: [PATCH 2/2] Put generator expression wrapping MAPL_FlapCapOptions.F90 on its own line --- MAPL_Base/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAPL_Base/CMakeLists.txt b/MAPL_Base/CMakeLists.txt index 3b303ba56a67..87cdc4c6cdb9 100644 --- a/MAPL_Base/CMakeLists.txt +++ b/MAPL_Base/CMakeLists.txt @@ -22,7 +22,8 @@ set (srcs MAPL_GenericCplComp.F90 MAPL_Sort.F90 MAPL_Generic.F90 MAPL_sun_uc.F90 MAPL_SatVapor.F90 MAPL_HistoryCollection.F90 - MAPL_HistoryGridComp.F90 MAPL_CapOptions.F90 $<$:MAPL_FlapCapOptions.F90> + MAPL_HistoryGridComp.F90 MAPL_CapOptions.F90 + $<$:MAPL_FlapCapOptions.F90> MAPL_Cap.F90 hash.c MAPL_CapGridComp.F90 MAPL_GridType.F90