2022-02-08 01:22:51 +00:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
|
|
set(BSD_PATH_PREFIX "/usr/local")
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
execute_process(
|
|
|
|
COMMAND brew config
|
|
|
|
COMMAND grep -i HOMEBREW_PREFIX
|
|
|
|
COMMAND awk "{print $2}"
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
OUTPUT_VARIABLE BSD_PATH_PREFIX)
|
2023-04-15 06:04:35 +00:00
|
|
|
else()
|
|
|
|
include_directories("${BSD_PATH_PREFIX}/include")
|
|
|
|
link_directories("${BSD_PATH_PREFIX}/lib")
|
2022-02-08 01:22:51 +00:00
|
|
|
endif()
|
2022-02-08 21:02:18 +00:00
|
|
|
|
2022-02-08 08:20:55 +00:00
|
|
|
message(STATUS "[configure-bsd-paths] resolved BSD_PATH_PREFIX to: '${BSD_PATH_PREFIX}'")
|
2022-02-08 21:02:18 +00:00
|
|
|
|
2023-06-17 19:33:32 +00:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT(${BUILD_STANDALONE} MATCHES "true"))
|
|
|
|
message(STATUS "[configure-bsd-paths] standalone *not* detected, adding Homebrew ${BSD_PATH_PREFIX} to include/lib dirs")
|
|
|
|
include_directories("${BSD_PATH_PREFIX}/include")
|
|
|
|
link_directories("${BSD_PATH_PREFIX}/lib")
|
|
|
|
endif()
|
|
|
|
|
2022-02-08 21:02:18 +00:00
|
|
|
list(
|
|
|
|
APPEND
|
|
|
|
VENDOR_INCLUDE_DIRECTORIES
|
|
|
|
"${BSD_PATH_PREFIX}/include"
|
|
|
|
"${BSD_PATH_PREFIX}/opt/openssl/include"
|
|
|
|
"${BSD_PATH_PREFIX}/opt/ncurses/include")
|
2022-02-09 02:57:30 +00:00
|
|
|
|
2022-02-08 08:20:55 +00:00
|
|
|
list(
|
|
|
|
APPEND
|
|
|
|
VENDOR_LINK_DIRECTORIES
|
|
|
|
"${BSD_PATH_PREFIX}/lib"
|
|
|
|
"${BSD_PATH_PREFIX}/opt/openssl/lib"
|
|
|
|
"${BSD_PATH_PREFIX}/opt/ncurses/lib")
|
2023-04-15 06:04:35 +00:00
|
|
|
endif()
|