Skip to content

Commit

Permalink
Check for ports, brew and fink, and add the prefixes as needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
grigorescu committed Apr 10, 2016
1 parent ae850ce commit 5c4b203
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions MacDependencyPaths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@
# default search prefix paths, but the nicer thing would be if they are
# prepended to the default, so that is fixed here.
if (APPLE AND "${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
list(INSERT CMAKE_PREFIX_PATH 0 /opt/local) # MacPorts
list(INSERT CMAKE_PREFIX_PATH 0 /usr/local) # Homebrew, if linked
list(INSERT CMAKE_PREFIX_PATH 0 /usr/local/opt/openssl) # Homebrew OpenSSL
list(INSERT CMAKE_PREFIX_PATH 0 /sw) # Fink
find_program(MAC_PORTS_BIN ports)
find_program(MAC_HBREW_BIN brew)
find_program(MAC_FINK_BIN fink)

if (MAC_PORTS_BIN)
list(INSERT CMAKE_PREFIX_PATH 0 ${MAC_PORTS_BIN}) # MacPorts
endif ()

if (MAC_HBREW_BIN)
list(INSERT CMAKE_PREFIX_PATH 0 /usr/local) # Homebrew, if linked
list(INSERT CMAKE_PREFIX_PATH 0 /usr/local/opt/openssl) # Homebrew OpenSSL
endif ()

if (MAC_FINK_BIN)
list(INSERT CMAKE_PREFIX_PATH 0 /sw) # Fink
endif ()

endif ()

0 comments on commit 5c4b203

Please sign in to comment.