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..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 @@ -63,8 +64,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 +89,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})