Skip to content

Commit 92ee621

Browse files
committed
fix openmp linking on macos
1 parent 7fab378 commit 92ee621

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

swmm-toolkit/extern/openmp.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ FetchContent_MakeAvailable(
6565
OpenMP
6666
)
6767

68+
set(OpenMP_AVAILABLE TRUE)
69+
70+
set(OPENMP_INCLUDE_DIR
71+
${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src
72+
)
73+
74+
target_include_directories(
75+
omp
76+
INTERFACE
77+
${OPENMP_INCLUDE_DIR}
78+
)
79+
6880
target_compile_options(
6981
omp
7082
INTERFACE
@@ -75,7 +87,7 @@ target_compile_options(
7587
target_link_directories(
7688
omp
7789
PUBLIC
78-
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/_deps/openmp-build/runtime/src>
90+
$<BUILD_INTERFACE:${OPENMP_INCLUDE_DIR}>
7991
$<INSTALL_INTERFACE:/include>
8092
)
8193

0 commit comments

Comments
 (0)