diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a4400cc4b532a08349900fb1b1e5ec5e0eab134..869716f25313a8b315851da53e70808bf3b70e46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,7 @@ option(ENABLE_NETGEN "Enable Netgen mesh generator" ${DEFAULT}) option(ENABLE_OCC "Enable Open CASCADE geometrical models" ${DEFAULT}) option(ENABLE_ONELAB "Enable OneLab solver interface" ${DEFAULT}) option(ENABLE_ONELAB_METAMODEL "Enable OneLab metamodel" ${DEFAULT}) +option(ENABLE_OPENMP "Enable OpenMP" OFF) option(ENABLE_OS_SPECIFIC_INSTALL "Use OS-specific (e.g. app bundle) install" ${DEFAULT}) option(ENABLE_OSMESA "Use OSMesa for offscreen rendering" OFF) option(ENABLE_PARSER "Build the GEO file parser" ${DEFAULT}) @@ -182,6 +183,14 @@ if(MSVC) endif(ENABLE_MSVC_STATIC_RUNTIME) endif(MSVC) +if(ENABLE_OPENMP) + find_package(OpenMP) + if(OPENMP_FOUND) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + endif(OPENMP_FOUND) +endif(ENABLE_OPENMP) + macro(append_gmsh_src DIRNAME FILES) foreach(FILE ${FILES}) list(APPEND LIST ${DIRNAME}/${FILE})