Skip to content

Commit

Permalink
fix(build): Fixed bundled plugins and samples build.
Browse files Browse the repository at this point in the history
  • Loading branch information
na2axl committed Mar 6, 2024
1 parent 5ef42f5 commit 0232292
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
14 changes: 10 additions & 4 deletions plugins/codec-flac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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}
Expand Down
14 changes: 10 additions & 4 deletions plugins/codec-vorbis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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}
Expand Down
10 changes: 8 additions & 2 deletions samples/sample_01/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions samples/sample_02/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0232292

Please sign in to comment.