diff --git a/plugins/codec-flac/CMakeLists.txt b/plugins/codec-flac/CMakeLists.txt index 600cc876..c1798516 100644 --- a/plugins/codec-flac/CMakeLists.txt +++ b/plugins/codec-flac/CMakeLists.txt @@ -34,9 +34,15 @@ elseif(APPLE) set(RUNTIME_OUTPUT_DIRECTORY "osx") set(CMAKE_MACOSX_RPATH 1) list(APPEND CMAKE_INSTALL_RPATH "@executable_path" "@loader_path/../shared/") -else() +elseif(UNIX AND NOT ANDROID) set(RUNTIME_OUTPUT_DIRECTORY "linux") - list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../shared/) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ORIGIN/../shared/") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + else() + list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../shared/) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + endif() endif() # Setup Plugin dependencies @@ -45,7 +51,7 @@ find_package(FLAC CONFIG REQUIRED) # Setup Amplitude # ------------------------------------------------------------------------------ -set(AM_SDK_PATH "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE PATH "The path to Amplitude Audio SDK libraries.") +set(AM_SDK_PATH "${CMAKE_CURRENT_LIST_DIR}/../../sdk" CACHE PATH "The path to Amplitude Audio SDK libraries.") find_package(AmplitudeAudioSDK REQUIRED) # Setup project source files. @@ -77,7 +83,7 @@ set(AM_INC_DESTINATION "include") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_LIB_DESTINATION}") -set(CMAKE_INSTALL_PREFIX "${AM_SDK_PATH}/sdk/") +set(CMAKE_INSTALL_PREFIX ${AM_SDK_PATH}) install( TARGETS ${PROJECT_NAME} diff --git a/plugins/codec-vorbis/CMakeLists.txt b/plugins/codec-vorbis/CMakeLists.txt index b6996a0b..72e067fa 100644 --- a/plugins/codec-vorbis/CMakeLists.txt +++ b/plugins/codec-vorbis/CMakeLists.txt @@ -34,9 +34,15 @@ elseif(APPLE) set(RUNTIME_OUTPUT_DIRECTORY "osx") set(CMAKE_MACOSX_RPATH 1) list(APPEND CMAKE_INSTALL_RPATH "@executable_path" "@loader_path/../shared/") -else() +elseif(UNIX AND NOT ANDROID) set(RUNTIME_OUTPUT_DIRECTORY "linux") - list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../shared/) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ORIGIN/../shared/") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + else() + list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../shared/) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + endif() endif() # Setup Plugin dependencies @@ -45,7 +51,7 @@ find_package(Vorbis CONFIG REQUIRED) # Setup Amplitude # ------------------------------------------------------------------------------ -set(AM_SDK_PATH "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE PATH "The path to Amplitude Audio SDK libraries.") +set(AM_SDK_PATH "${CMAKE_CURRENT_LIST_DIR}/../../sdk" CACHE PATH "The path to Amplitude Audio SDK libraries.") find_package(AmplitudeAudioSDK REQUIRED) # Setup project source files. @@ -77,7 +83,7 @@ set(AM_INC_DESTINATION "include") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${AM_LIB_DESTINATION}") -set(CMAKE_INSTALL_PREFIX "${AM_SDK_PATH}/sdk/") +set(CMAKE_INSTALL_PREFIX ${AM_SDK_PATH}) install( TARGETS ${PROJECT_NAME} diff --git a/samples/sample_01/CMakeLists.txt b/samples/sample_01/CMakeLists.txt index 6f408218..af72d25e 100644 --- a/samples/sample_01/CMakeLists.txt +++ b/samples/sample_01/CMakeLists.txt @@ -24,9 +24,15 @@ elseif(APPLE) set(RUNTIME_OUTPUT_DIRECTORY "osx") set(CMAKE_MACOSX_RPATH 1) list(APPEND CMAKE_INSTALL_RPATH "@executable_path" "@executable_path/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/") -else() +elseif(UNIX AND NOT ANDROID) set(RUNTIME_OUTPUT_DIRECTORY "linux") - list(APPEND CMAKE_INSTALL_RPATH "${ORIGIN}" "${ORIGIN}/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/") + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ORIGIN/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + else() + list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + endif() endif() set(ss_amplitude_audio_sample_01_SRCS diff --git a/samples/sample_02/CMakeLists.txt b/samples/sample_02/CMakeLists.txt index 2a44d8e1..9d984f76 100644 --- a/samples/sample_02/CMakeLists.txt +++ b/samples/sample_02/CMakeLists.txt @@ -24,9 +24,15 @@ elseif(APPLE) set(RUNTIME_OUTPUT_DIRECTORY "osx") set(CMAKE_MACOSX_RPATH 1) list(APPEND CMAKE_INSTALL_RPATH "@executable_path" "@executable_path/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/") -else() +elseif(UNIX AND NOT ANDROID) set(RUNTIME_OUTPUT_DIRECTORY "linux") - list(APPEND CMAKE_INSTALL_RPATH "${ORIGIN}" "${ORIGIN}/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/") + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ORIGIN/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + else() + list(APPEND CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../../../lib/${RUNTIME_OUTPUT_DIRECTORY}/shared/) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + endif() endif() find_package(SDL2 CONFIG REQUIRED)