diff --git a/CMakeLists.txt b/CMakeLists.txt index 325d14e..892cf29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ endif() add_compile_options(-Wno-deprecated-declarations) CHECK_CXX_COMPILER_FLAG(-Wno-class-memaccess COMPILER_SUPPORTS_CLASSMEMACCESS) if(COMPILER_SUPPORTS_CLASSMEMACCESS) - add_compile_options(-Wno-class-memaccess) + add_compile_options($<$:-Wno-class-memaccess>) endif() add_library(teos STATIC GSW-C/gsw_oceanographic_toolbox.c GSW-C/gsw_saar.c) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e9b095d..fd69749 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,7 @@ set(DATALISTINC ${CMAKE_CURRENT_BINARY_DIR}/../include/datalist.h) # Include dat find_package(PkgConfig REQUIRED) find_library(netcdf netcdf REQUIRED) +find_library(udunits udunits2 REQUIRED) find_package(OpenMP REQUIRED) find_package(CURL REQUIRED) find_package(LibXml2 REQUIRED) @@ -20,7 +21,7 @@ file(GLOB srcs CONFIGURE_DEPENDS *.cpp) add_executable(${EXENAME} ${srcs} ${ACTIONLISTINC} ${SOURCELISTINC}) target_include_directories(${EXENAME} PRIVATE ../michlib/michlib ${CMAKE_CURRENT_BINARY_DIR}/../include) -target_link_libraries(${EXENAME} ${linker_options} ${netcdf} OpenMP::OpenMP_CXX CURL::libcurl ${JSONCPP_LINK_LIBRARIES} ${BLOSC_LINK_LIBRARIES} ${LIBPQ_LINK_LIBRARIES} LibXml2::LibXml2 SQLite::SQLite3 teos) +target_link_libraries(${EXENAME} ${linker_options} ${netcdf} ${udunits} OpenMP::OpenMP_CXX CURL::libcurl ${JSONCPP_LINK_LIBRARIES} ${BLOSC_LINK_LIBRARIES} ${LIBPQ_LINK_LIBRARIES} LibXml2::LibXml2 SQLite::SQLite3 teos) set_target_properties(${EXENAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) install(TARGETS ${EXENAME})