Skip to content

Commit

Permalink
fix: automatically find openmp based on homebrew prefix, close #110
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaoyilunnn committed Apr 18, 2024
1 parent cd904fb commit 8aa5b72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ set ( PRJ_INCLUDE_DIRS )
# openmp
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES Darwin)
execute_process(COMMAND brew install libomp)
list ( APPEND PRJ_LIBRARIES /usr/local/opt/libomp/lib )
list ( APPEND PRJ_INCLUDE_DIRS /usr/local/opt/libomp/include )
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE HOMEBREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
list ( APPEND PRJ_LIBRARIES ${HOMEBREW_PREFIX}/opt/libomp/lib )
list ( APPEND PRJ_INCLUDE_DIRS ${HOMEBREW_PREFIX}/opt/libomp/include )
else()
find_package ( OpenMP )
if ( OpenMP_FOUND )
Expand Down

0 comments on commit 8aa5b72

Please sign in to comment.