mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Update CMake scripts to be compatible with different Homebrew install paths.
This commit is contained in:
parent
70a35adf39
commit
bd870de626
@ -1,10 +1,17 @@
|
|||||||
function(ensure_library_exists libname)
|
function(ensure_library_exists libname)
|
||||||
unset(__TEMP_ENSURE_LIBRARY CACHE)
|
get_property(ALL_LINK_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY LINK_DIRECTORIES)
|
||||||
find_library(__TEMP_ENSURE_LIBRARY ${libname})
|
foreach(CURRENT_LINK_DIR ${ALL_LINK_DIRS})
|
||||||
if(NOT __TEMP_ENSURE_LIBRARY)
|
unset(__TEMP_ENSURE_LIBRARY CACHE)
|
||||||
message(FATAL_ERROR "\n\n[check-dependencies] ${libname} not found\n\n")
|
find_library(
|
||||||
else()
|
__TEMP_ENSURE_LIBRARY
|
||||||
message(STATUS "[check-dependencies] ${libname} found at ${__TEMP_ENSURE_LIBRARY}")
|
NAMES ${libname}
|
||||||
endif()
|
PATHS ${CURRENT_LINK_DIR})
|
||||||
unset(__TEMP_ENSURE_LIBRARY CACHE)
|
if(NOT __TEMP_ENSURE_LIBRARY)
|
||||||
|
#message(STATUS "[check-dependencies] ${libname} not found")
|
||||||
|
else()
|
||||||
|
message(STATUS "[check-dependencies] ${libname} found at ${__TEMP_ENSURE_LIBRARY}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
message(FATAL_ERROR "\n\n[check-dependencies] ${libname} not found\n\n")
|
||||||
endfunction(ensure_library_exists)
|
endfunction(ensure_library_exists)
|
||||||
|
@ -38,12 +38,22 @@ link_directories ("${musikcube_SOURCE_DIR}/bin/plugins")
|
|||||||
|
|
||||||
# custom include/library directories for BSDs
|
# custom include/library directories for BSDs
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||||
link_directories ("/usr/local/lib")
|
set(BSD_PATH_PREFIX "/usr/local")
|
||||||
link_directories ("/usr/local/opt/openssl/lib")
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
link_directories ("/usr/local/opt/ncurses/lib")
|
execute_process(
|
||||||
include_directories("/usr/local/include")
|
COMMAND brew config
|
||||||
include_directories("/usr/local/opt/openssl/include")
|
COMMAND grep -i HOMEBREW_PREFIX
|
||||||
include_directories("/usr/local/opt/ncurses/include")
|
COMMAND awk "{print $2}"
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
OUTPUT_VARIABLE BSD_PATH_PREFIX)
|
||||||
|
endif()
|
||||||
|
message(STATUS "resolved BSD_PATH_PREFIX to: '${BSD_PATH_PREFIX}'")
|
||||||
|
link_directories ("${BSD_PATH_PREFIX}/lib")
|
||||||
|
link_directories ("${BSD_PATH_PREFIX}/opt/openssl/lib")
|
||||||
|
link_directories ("${BSD_PATH_PREFIX}/opt/ncurses/lib")
|
||||||
|
include_directories("${BSD_PATH_PREFIX}/include")
|
||||||
|
include_directories("${BSD_PATH_PREFIX}/opt/openssl/include")
|
||||||
|
include_directories("${BSD_PATH_PREFIX}/opt/ncurses/include")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (${LINK_STATICALLY} MATCHES "true")
|
if (${LINK_STATICALLY} MATCHES "true")
|
||||||
|
Loading…
Reference in New Issue
Block a user