feat: initial qobuz-qt source
Lightweight Qt6 desktop client for Qobuz with a Rust audio backend (Symphonia/CPAL via staticlib FFI). Mirrors the spotify-qt layout: toolbar with playback controls, library/context docks on the left, tabbed search side panel on the right, queue panel, now-playing dock. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,16 +25,35 @@ if (USE_DBUS)
|
||||
find_package(Qt6 OPTIONAL_COMPONENTS DBus QUIET)
|
||||
endif ()
|
||||
|
||||
# ----- Rust backend via corrosion -----
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
Corrosion
|
||||
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
|
||||
GIT_TAG v0.5
|
||||
)
|
||||
FetchContent_MakeAvailable(Corrosion)
|
||||
# ----- Rust backend (cargo) -----
|
||||
# Don't use find_program — it caches a full path that may differ across machines.
|
||||
# 'cargo' is resolved via PATH at build time.
|
||||
set(CARGO_CMD cargo)
|
||||
|
||||
corrosion_import_crate(MANIFEST_PATH rust/Cargo.toml CRATES qobuz-backend)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set(CARGO_PROFILE release)
|
||||
set(CARGO_PROFILE_FLAG --release)
|
||||
else()
|
||||
set(CARGO_PROFILE debug)
|
||||
set(CARGO_PROFILE_FLAG "")
|
||||
endif()
|
||||
|
||||
set(RUST_LIB "${CMAKE_SOURCE_DIR}/target/${CARGO_PROFILE}/libqobuz_backend.a")
|
||||
|
||||
add_custom_target(rust_backend ALL
|
||||
COMMAND ${CARGO_CMD} build ${CARGO_PROFILE_FLAG}
|
||||
--manifest-path "${CMAKE_SOURCE_DIR}/Cargo.toml"
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
COMMENT "Building Rust backend (cargo ${CARGO_PROFILE})"
|
||||
BYPRODUCTS "${RUST_LIB}"
|
||||
)
|
||||
|
||||
# Imported static library so CMake knows it's a link input
|
||||
add_library(qobuz_backend_lib STATIC IMPORTED GLOBAL)
|
||||
set_target_properties(qobuz_backend_lib PROPERTIES
|
||||
IMPORTED_LOCATION "${RUST_LIB}"
|
||||
)
|
||||
add_dependencies(qobuz_backend_lib rust_backend)
|
||||
|
||||
# Create main executable
|
||||
add_executable(qobuz-qt res.qrc)
|
||||
@@ -42,6 +61,8 @@ add_executable(qobuz-qt res.qrc)
|
||||
# Source files
|
||||
add_subdirectory(src)
|
||||
|
||||
add_dependencies(qobuz-qt rust_backend)
|
||||
|
||||
# Include paths
|
||||
target_include_directories(qobuz-qt PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||
@@ -59,7 +80,7 @@ target_link_libraries(qobuz-qt PRIVATE
|
||||
Qt6::Network
|
||||
Qt6::Gui
|
||||
Qt6::Svg
|
||||
qobuz-backend
|
||||
qobuz_backend_lib
|
||||
)
|
||||
|
||||
# Platform-specific system libs needed by the Rust audio stack (cpal/ALSA)
|
||||
|
||||
Reference in New Issue
Block a user