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()