File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,22 @@ if(APPLE AND CMAKE_HOST_APPLE)
83
83
endif ()
84
84
endif ()
85
85
86
+ # If OpenMP wasn't found, try if we can find it in the default Homebrew location (for newer homebrew setups)
87
+ if ((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND) AND EXISTS "/opt/homebrew/opt/libomp/lib" )
88
+ set (OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" )
89
+ set (OpenMP_CXX_LIB_NAMES omp)
90
+ set (OpenMP_omp_LIBRARY /opt/homebrew/opt/libomp/lib)
91
+
92
+ find_package (OpenMP)
93
+
94
+ if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
95
+ message (VERBOSE "Found libomp in homebrew default location." )
96
+ else ()
97
+ message (FATAL_ERROR "Didn't find libomp. Tried homebrew default location but also didn't find it." )
98
+ endif ()
99
+ endif ()
100
+
101
+
86
102
set (Additional_OpenMP_Libraries_Workaround "" )
87
103
88
104
# Workaround because older cmake on apple doesn't support FindOpenMP
You can’t perform that action at this time.
0 commit comments