From 2874c5e775fcd58da6f6c9b95093f852dac3ab7e Mon Sep 17 00:00:00 2001 From: Henrik Rusche Date: Fri, 1 Jun 2018 19:35:39 +0200 Subject: [PATCH] Enables OpenMP support for cfMesh in cmake-build --- cmake/compileFOAM.cmake | 2 ++ src/mesh/cfMesh/CMakeLists.txt | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/compileFOAM.cmake b/cmake/compileFOAM.cmake index 609033fc8..7be3cb456 100644 --- a/cmake/compileFOAM.cmake +++ b/cmake/compileFOAM.cmake @@ -72,6 +72,8 @@ find_package(FLEX REQUIRED) find_package(Git REQUIRED) +find_package(OpenMP) + # Path to ParaViewConfig.cmake set(ParaView_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/packages/ParaView-4.4.0/platforms/linux64GccDPOpt/lib/cmake/paraview-4.4) find_package(ParaView REQUIRED) diff --git a/src/mesh/cfMesh/CMakeLists.txt b/src/mesh/cfMesh/CMakeLists.txt index 897797a62..99572189a 100644 --- a/src/mesh/cfMesh/CMakeLists.txt +++ b/src/mesh/cfMesh/CMakeLists.txt @@ -422,5 +422,10 @@ list(APPEND SOURCES ) add_foam_library(cfMesh SHARED ${SOURCES}) - 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()