You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
933 B

2 years ago
set(EXENAME odm)
set(ACTIONLIST ../include/actionlist.h)
set(GENALIST ${CMAKE_SOURCE_DIR}/scripts/genactionslist)
2 years ago
find_library(netcdf netcdf REQUIRED)
find_package(OpenMP REQUIRED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
2 years ago
file(GLOB srcs CONFIGURE_DEPENDS *.cpp)
add_executable(${EXENAME} ${srcs} ${ACTIONLIST})
target_include_directories(${EXENAME} PRIVATE ../michlib/michlib ${CMAKE_CURRENT_BINARY_DIR}/../include)
file(GLOB actfiles CONFIGURE_DEPENDS ../actions/action*.h ../actions-add/action*.h)
add_custom_command(OUTPUT ${ACTIONLIST} COMMAND ${GENALIST} ARGS "${CMAKE_CXX_COMPILER} -I$<JOIN:$<TARGET_PROPERTY:${EXENAME},INCLUDE_DIRECTORIES>, -I>" ${ACTIONLIST} ${EXCLUDE_ACTIONS} DEPENDS ${GENALIST} ${actfiles})
2 years ago
target_link_libraries(${EXENAME} ${linker_options} ${netcdf} OpenMP::OpenMP_CXX teos)
2 years ago
set_target_properties(${EXENAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
install(TARGETS ${EXENAME})