From a328efb3a2f8ea4b47cf0f7b581d983a570a1ffd Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Fri, 8 Mar 2024 14:47:19 +0000 Subject: [PATCH] Add include_directories for OpenMP (#110) * Add include_directories for OpenMP This is needed on systems (such as clang on MacOS) that use non-standard locations of `omp.h`. Fixes https://github.com/KCL-BMEIS/niftyreg/issues/109 * only use include_directories if OpenMP dirs non-empty --- CMakeLists.txt | 8 +++++++- niftyreg_build_version.txt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a510dbe3..b2b72dbf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,12 @@ if(USE_OPENMP) message(STATUS "Found OpenMP") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + if (OpenMP_CXX_INCLUDE_DIRS) + include_directories("${OpenMP_CXX_INCLUDE_DIRS}") + endif() + if (OpenMP_C_INCLUDE_DIRS) + include_directories("${OpenMP_C_INCLUDE_DIRS}") + endif() endif(NOT OPENMP_FOUND) endif(USE_OPENMP) #----------------------------------------------------------------------------- @@ -226,4 +232,4 @@ if(DOXYGEN_FOUND) ) message(STATUS "Found doxygen") endif(DOXYGEN_FOUND) -#----------------------------------------------------------------------------- \ No newline at end of file +#----------------------------------------------------------------------------- diff --git a/niftyreg_build_version.txt b/niftyreg_build_version.txt index dd475631..987e7ca9 100644 --- a/niftyreg_build_version.txt +++ b/niftyreg_build_version.txt @@ -1 +1 @@ -76 +77