From 93c05752155491f5afd667aa50a838e185d24bf8 Mon Sep 17 00:00:00 2001 From: pierrepebay Date: Sat, 30 Sep 2023 13:24:01 +0200 Subject: [PATCH] #18: cmake: add openmp loading --- cmake/load_openmp.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cmake/load_openmp.cmake diff --git a/cmake/load_openmp.cmake b/cmake/load_openmp.cmake new file mode 100644 index 0000000000..3247c615ad --- /dev/null +++ b/cmake/load_openmp.cmake @@ -0,0 +1,10 @@ +if(NOT APPLE) + find_package(OpenMP) + if (OPENMP_FOUND) + message(STATUS "Found OpenMP") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") + set(openmp_enabled ON) + endif() +endif()