Skip to content

Commit

Permalink
Add include_directories for OpenMP (#110)
Browse files Browse the repository at this point in the history
* Add include_directories for OpenMP

This is needed on systems (such as clang on MacOS) that use non-standard locations of `omp.h`.

Fixes #109

* only use include_directories if OpenMP dirs non-empty
  • Loading branch information
KrisThielemans authored Mar 8, 2024
1 parent 6db8b16 commit a328efb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -226,4 +232,4 @@ if(DOXYGEN_FOUND)
)
message(STATUS "Found doxygen")
endif(DOXYGEN_FOUND)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion niftyreg_build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
76
77

0 comments on commit a328efb

Please sign in to comment.