Skip to content

Commit

Permalink
CMakeLists.txt: Set LIBS
Browse files Browse the repository at this point in the history
  • Loading branch information
harshula committed Nov 4, 2024
1 parent 903379d commit f07294f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,24 @@ set(FCFLAGS "${CMAKE_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}}")
set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")

set(VERSION ${PROJECT_VERSION})
#set(LIBS ?)

# https://cmake.org/cmake/help/latest/module/FindMPI.html
string(REPLACE ";" " " LIBS "${MPI_C_LIBRARIES};${MPI_Fortran_LIBRARIES} ")

if(NOT ${NetCDF_Fortran_LIBRARY_SHARED})
# autotools: Libs.private: -lnetcdff -lnetcdf
string(APPEND LIBS ${NetCDF_Fortran_LIBRARIES})
endif()

if (OPENMP)
# https://cmake.org/cmake/help/latest/module/FindOpenMP.html
string(REPLACE ";" " " TMP_LIBS "${OPENMP_C_LIBRARIES};${OPENMP_Fortran_LIBRARIES} ")
string(APPEND LIBS ${TMP_LIBS})
endif()

if (WITH_YAML)
string(APPEND LIBS ${LIBYAML_LIBRARIES})
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FMS.pc.in
${CMAKE_CURRENT_BINARY_DIR}/FMS.pc @ONLY)
Expand Down

0 comments on commit f07294f

Please sign in to comment.