Fix RPATH handling in CMakeLists.txt

This commit is contained in:
casey langen 2018-02-01 19:12:28 -08:00
parent a630fa8ffa
commit 27d4696971
2 changed files with 7 additions and 3 deletions

View File

@ -67,6 +67,13 @@ include_directories (
"${musikcube_SOURCE_DIR}/src/3rdparty/include"
"${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include")
# ensure the binaries can find libmusikcore.so, which lives in the
# same directory.
if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
# "/usr/local" doesn't seem to be included by default on macOS 10.12+
# "/opt/local" is the default installation location for MacPorts
if (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")

View File

@ -7,10 +7,7 @@ if (NOT DEFINED musikcube_INSTALL_DIR)
set(musikcube_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
endif()
configure_file("musikcubed.in" "musikcubed" @ONLY)
add_executable(musikcubed ${DAEMON_SRCS})
set_target_properties(musikcubed PROPERTIES LINK_FLAGS "-Wl,-rpath,./")
if (${LINK_STATICALLY} MATCHES "true")
find_library(EVLIB NAMES libev.a ev)