Skip to content

Commit

Permalink
Merge pull request #163 from Zhaoyilunnn/master
Browse files Browse the repository at this point in the history
fix: automatically find openmp based on homebrew prefix, close #110
  • Loading branch information
ScQ-Cloud committed Apr 18, 2024
2 parents ec3a3ba + 8aa5b72 commit 3527d0c
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 3527d0c

Please sign in to comment.