Commit 4d4855f0 authored by Praetorius, Simon's avatar Praetorius, Simon

update MTL cmake find module to support openMP

parent dc6aa48e
Pipeline #5089 passed with stage
in 41 minutes and 5 seconds
......@@ -27,7 +27,7 @@ find_path(MTL_INCLUDE_DIR boost/numeric/mtl/mtl.hpp
mtl mtl4
)
set(MTL_COMPILE_DEFINITIONS MTL_ASSERT_FOR_THROW=1)
set(MTL_COMPILE_DEFINITIONS "MTL_ASSERT_FOR_THROW")
foreach(feature "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
list(APPEND MTL_COMPILE_DEFINITIONS MTL_WITH_${feature})
endforeach(feature)
......@@ -56,6 +56,12 @@ if(MTL_FOUND AND NOT TARGET MTL::MTL)
target_link_libraries(MTL::MTL INTERFACE HYPRE::HYPRE)
endif ()
find_package(OpenMP)
if (OpenMP_CXX_FOUND)
list(APPEND MTL_COMPILE_DEFINITIONS "MTL_WITH_OPENMP")
target_link_libraries(MTL::MTL INTERFACE OpenMP::OpenMP_CXX)
endif ()
set_target_properties(MTL::MTL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MTL_INCLUDE_DIR}"
INTERFACE_COMPILE_DEFINITIONS "${MTL_COMPILE_DEFINITIONS}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment