rtaudio hello world
This commit is contained in:
@@ -5,6 +5,33 @@ project(sonobulus LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# get dependencies
|
||||
include(FetchContent)
|
||||
set(RTAUDIO_BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
set(RTMIDI_BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
set(RTAUDIO_TARGETNAME_UNINSTALL rtaudio-uninstall CACHE STRING "" FORCE)
|
||||
set(RTMIDI_TARGETNAME_UNINSTALL rtmidi-uninstall CACHE STRING "" FORCE)
|
||||
FetchContent_Declare(
|
||||
rtaudio
|
||||
GIT_REPOSITORY https://github.com/thestk/rtaudio.git
|
||||
GIT_TAG 6.0.1
|
||||
)
|
||||
FetchContent_Declare(
|
||||
rtmidi
|
||||
GIT_REPOSITORY https://github.com/thestk/rtmidi.git
|
||||
GIT_TAG 6.0.0
|
||||
)
|
||||
# FetchContent_Declare(
|
||||
# libconfig
|
||||
# GIT_REPOSITORY https://github.com/hyperrealm/libconfig.git
|
||||
# GIT_TAG v1.8.2
|
||||
# )
|
||||
FetchContent_MakeAvailable(rtaudio)
|
||||
FetchContent_MakeAvailable(rtmidi)
|
||||
# FetchContent_MakeAvailable(libconfig)
|
||||
|
||||
# needs to be preinstalled
|
||||
find_package(Qt6 REQUIRED COMPONENTS
|
||||
Core
|
||||
Quick
|
||||
@@ -13,11 +40,20 @@ find_package(Qt6 REQUIRED COMPONENTS
|
||||
qt_standard_project_setup()
|
||||
|
||||
add_library(sonobulus_core STATIC
|
||||
src/synth/AudioEngine.cpp
|
||||
src/TimerComponent.cpp
|
||||
)
|
||||
target_link_libraries(sonobulus_core PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Quick
|
||||
rtaudio
|
||||
rtmidi
|
||||
)
|
||||
|
||||
message(STATUS "Looking for compiler dependencies: ${rtaudio_SOURCE_DIR}...")
|
||||
|
||||
target_include_directories(sonobulus_core PRIVATE
|
||||
${rtaudio_SOURCE_DIR}
|
||||
)
|
||||
|
||||
qt_add_executable(sonobulus
|
||||
@@ -30,6 +66,10 @@ qt_add_qml_module(sonobulus
|
||||
QML_FILES ui/Main.qml
|
||||
)
|
||||
|
||||
target_include_directories(sonobulus PRIVATE
|
||||
${rtaudio_SOURCE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(sonobulus PRIVATE
|
||||
sonobulus_core
|
||||
Qt6::Core
|
||||
@@ -45,6 +85,12 @@ if (WIN32)
|
||||
COMMENT "windeployqt..."
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET sonobulus POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
$<TARGET_FILE:rtaudio>
|
||||
$<TARGET_FILE_DIR:sonobulus>
|
||||
)
|
||||
endif()
|
||||
|
||||
# add_subdirectory(src)
|
||||
|
||||
Reference in New Issue
Block a user