Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Adjust the download directory and name of external dependencies Pt. 2 #4514

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1870,9 +1870,10 @@ endif()
# Denon Engine Prime library export support (using libdjinterop)
option(ENGINEPRIME "Support for library export to Denon Engine Prime" ON)
if(ENGINEPRIME)
set(LIBDJINTEROP_VERSION 0.16.0)
# Look for an existing installation of libdjinterop and use that if available.
# Otherwise, download and build from GitHub.
find_package(DjInterop)
find_package(DjInterop ${LIBDJINTEROP_VERSION})
if(DjInterop_FOUND)
# An existing installation of djinterop is available.
message(STATUS "Using existing system installation of libdjinterop")
Expand All @@ -1893,18 +1894,19 @@ if(ENGINEPRIME)

set(DJINTEROP_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/lib/libdjinterop-install")
set(DJINTEROP_LIBRARY "lib/${CMAKE_STATIC_LIBRARY_PREFIX}djinterop${CMAKE_STATIC_LIBRARY_SUFFIX}")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/download")

# CMake does not pass lists of paths properly to external projects.
# This is worked around by changing the list separator.
string(REPLACE ";" "|" PIPE_DELIMITED_CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}")

# External project sources must be downloaded as an archive into DOWNLOAD_DIR
# from an URL to keep offline builds like for Fedora/RPM Fusion working!
# For offline builds download the archive file from the URL and
# copy it into DOWNLOAD_DIR under DOWNLOAD_NAME prior to starting
# the configuration.
ExternalProject_Add(libdjinterop
URL "https://github.com/xsco/libdjinterop/archive/0.16.0.tar.gz"
URL "https://github.com/xsco/libdjinterop/archive/refs/tags/${LIBDJINTEROP_VERSION}.tar.gz"
URL_HASH SHA256=c998831fe4d3cc80c5c031491204244c9ed0c61575dd529260304b95d79db588
DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/download/libdjinterop"
DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads"
DOWNLOAD_NAME "libdjinterop-${LIBDJINTEROP_VERSION}.tar.gz"
INSTALL_DIR ${DJINTEROP_INSTALL_DIR}
LIST_SEPARATOR "|"
CMAKE_ARGS
Expand Down