set(EXENAME odm) set(ACTIONLIST ../include/actionlist.h) set(GENALIST ${CMAKE_SOURCE_DIR}/scripts/genactionslist) find_library(netcdf netcdf REQUIRED) find_package(OpenMP REQUIRED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") 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$, -I>" ${ACTIONLIST} ${EXCLUDE_ACTIONS} DEPENDS ${GENALIST} ${actfiles}) target_link_libraries(${EXENAME} ${linker_options} ${netcdf} OpenMP::OpenMP_CXX teos) set_target_properties(${EXENAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) install(TARGETS ${EXENAME})