Enables OpenMP support for cfMesh in cmake-build

This commit is contained in:
Henrik Rusche 2018-06-01 19:35:39 +02:00
parent fc7de48319
commit 2874c5e775
2 changed files with 8 additions and 1 deletions

View file

@ -72,6 +72,8 @@ find_package(FLEX REQUIRED)
find_package(Git REQUIRED) find_package(Git REQUIRED)
find_package(OpenMP)
# Path to ParaViewConfig.cmake # Path to ParaViewConfig.cmake
set(ParaView_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/packages/ParaView-4.4.0/platforms/linux64GccDPOpt/lib/cmake/paraview-4.4) set(ParaView_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/packages/ParaView-4.4.0/platforms/linux64GccDPOpt/lib/cmake/paraview-4.4)
find_package(ParaView REQUIRED) find_package(ParaView REQUIRED)

View file

@ -422,5 +422,10 @@ list(APPEND SOURCES
) )
add_foam_library(cfMesh SHARED ${SOURCES}) add_foam_library(cfMesh SHARED ${SOURCES})
target_link_libraries(cfMesh PUBLIC meshTools edgeMesh) target_link_libraries(cfMesh PUBLIC meshTools edgeMesh)
if(OPENMP_FOUND)
target_compile_definitions(cfMesh PUBLIC USE_OMP)
target_compile_options(cfMesh PUBLIC ${OpenMP_CXX_FLAGS})
target_link_libraries(cfMesh PUBLIC ${OpenMP_CXX_FLAGS})
endif()