1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

cmake: add support for building with OpenMP

This commit is contained in:
Manuel Pitz 2021-06-23 20:05:56 +02:00
parent 26238d5a51
commit eb97c92239
2 changed files with 7 additions and 0 deletions

View file

@ -82,6 +82,7 @@ endif()
# Check packages
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenMP)
find_package(Opal)
find_package(IBVerbs)
find_package(RDMACM)
@ -141,6 +142,7 @@ cmake_dependent_option(WITH_HOOKS "Build with support for processing h
cmake_dependent_option(WITH_WEB "Build with internal webserver" ON "LIBWEBSOCKETS_FOUND" OFF)
cmake_dependent_option(WITH_API "Build with remote control API" ON "" OFF)
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" ON "LIBCONFIG_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" ON "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_SRC "Build executables" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" ON "XIL_FOUND" OFF)
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" ON "TOPLEVEL_PROJECT" OFF)
@ -240,6 +242,7 @@ add_feature_info(PLUGINS WITH_PLUGINS "Build plugi
add_feature_info(CLIENTS WITH_CLIENTS "Build client applications")
add_feature_info(GRAPHVIZ WITH_GRAPHVIZ "Build with Graphviz support")
add_feature_info(LUA WITH_LUA "Build with Lua support")
add_feature_info(OPENMP WITH_OPENMP "Build with OpenMP support")
add_feature_info(DOC WITH_DOC "Build documentation")
add_feature_info(NODE_AMQP WITH_NODE_AMQP "Build with amqp node-type")

View file

@ -50,6 +50,10 @@ if(WITH_LUA)
list(APPEND HOOK_SRC lua.cpp)
endif()
if(WITH_OPENMP)
list(APPEND LIBRARIES OpenMP::OpenMP_CXX)
endif()
add_library(hooks STATIC ${HOOK_SRC})
target_include_directories(hooks PUBLIC ${INCLUDE_DIRS})
target_link_libraries(hooks PUBLIC ${LIBRARIES})