musikcube/.cmake/ConfigureBsdPaths.cmake

31 lines
946 B
CMake
Raw Normal View History

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")
endif()
2022-02-08 08:20:55 +00:00
message(STATUS "[configure-bsd-paths] resolved BSD_PATH_PREFIX to: '${BSD_PATH_PREFIX}'")
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()