109 lines
2.1 KiB
CMake
109 lines
2.1 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(potato-audio-router VERSION 1.0.0 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
# Export compile commands for IDE support
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
# Qt6 Components
|
|
find_package(Qt6 6.2 REQUIRED COMPONENTS
|
|
Core
|
|
Widgets
|
|
)
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
QtNodes
|
|
GIT_REPOSITORY https://github.com/paceholder/nodeeditor
|
|
GIT_TAG master
|
|
)
|
|
FetchContent_MakeAvailable(QtNodes)
|
|
|
|
# PipeWire
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3>=0.3.0)
|
|
pkg_check_modules(SPA REQUIRED libspa-0.2>=0.2)
|
|
|
|
# Compiler flags
|
|
add_compile_options(
|
|
-Wall
|
|
-Wextra
|
|
-Wno-pedantic
|
|
-Werror=return-type
|
|
)
|
|
|
|
# Include directories
|
|
include_directories(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
${PIPEWIRE_INCLUDE_DIRS}
|
|
${SPA_INCLUDE_DIRS}
|
|
)
|
|
|
|
# Source files for core library
|
|
set(CORE_SOURCES
|
|
src/pipewire/pipewirecontroller.cpp
|
|
src/pipewire/nodeinfo.cpp
|
|
src/pipewire/portinfo.cpp
|
|
)
|
|
|
|
set(CORE_HEADERS
|
|
src/pipewire/pipewirecontroller.h
|
|
src/pipewire/nodeinfo.h
|
|
src/pipewire/portinfo.h
|
|
)
|
|
|
|
# Core library (shared between test app and future GUI app)
|
|
add_library(potato-core STATIC
|
|
${CORE_SOURCES}
|
|
${CORE_HEADERS}
|
|
)
|
|
|
|
target_link_libraries(potato-core PUBLIC
|
|
Qt6::Core
|
|
${PIPEWIRE_LIBRARIES}
|
|
${SPA_LIBRARIES}
|
|
)
|
|
|
|
target_include_directories(potato-core PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
${PIPEWIRE_INCLUDE_DIRS}
|
|
${SPA_INCLUDE_DIRS}
|
|
)
|
|
|
|
# CLI test application for Milestone 1
|
|
add_executable(potato-test
|
|
src/main_test.cpp
|
|
)
|
|
|
|
target_link_libraries(potato-test PRIVATE
|
|
potato-core
|
|
Qt6::Core
|
|
)
|
|
|
|
add_executable(potato-gui
|
|
src/main_gui.cpp
|
|
src/gui/GraphEditorWidget.cpp
|
|
src/gui/PipeWireGraphModel.cpp
|
|
src/meters/AudioLevelMeter.cpp
|
|
src/presets/PresetManager.cpp
|
|
)
|
|
|
|
target_link_libraries(potato-gui PRIVATE
|
|
potato-core
|
|
Qt6::Widgets
|
|
QtNodes
|
|
)
|
|
|
|
# Install
|
|
install(TARGETS potato-test
|
|
RUNTIME DESTINATION bin
|
|
)
|
|
|
|
install(TARGETS potato-gui
|
|
RUNTIME DESTINATION bin
|
|
)
|