Browse Source

Compile and link TEOS-10 library

interpolate
Michael Uleysky 1 year ago
parent
commit
a40e8c9cff
  1. 7
      CMakeLists.txt
  2. 2
      src/CMakeLists.txt

7
CMakeLists.txt

@ -13,12 +13,12 @@ if(${srcdir} STREQUAL ${bindir})
" Please remove them.") " Please remove them.")
endif() endif()
project(odm CXX) project(odm C CXX)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
include_directories(include) include_directories(include GSW-C)
add_compile_options(-Wall) add_compile_options(-Wall)
# Dwarf-4 support check # Dwarf-4 support check
@ -28,4 +28,7 @@ if(COMPILER_SUPPORTS_DWARF4 AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUIL
add_compile_options(-gdwarf-4) add_compile_options(-gdwarf-4)
endif() endif()
add_library(teos STATIC GSW-C/gsw_oceanographic_toolbox.c GSW-C/gsw_saar.c)
set_target_properties(teos PROPERTIES LINKER_LANGUAGE C)
add_subdirectory(src) add_subdirectory(src)

2
src/CMakeLists.txt

@ -8,6 +8,6 @@ include_directories(../michlib/michlib)
file(GLOB srcs *.cpp) file(GLOB srcs *.cpp)
add_executable(${EXENAME} ${srcs}) add_executable(${EXENAME} ${srcs})
target_link_libraries(${EXENAME} ${linker_options} ${netcdf} OpenMP::OpenMP_CXX) target_link_libraries(${EXENAME} ${linker_options} ${netcdf} OpenMP::OpenMP_CXX teos)
set_target_properties(${EXENAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(${EXENAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
install(TARGETS ${EXENAME}) install(TARGETS ${EXENAME})

Loading…
Cancel
Save