initial commit
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
project(SubWave LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# ── Find Qt6 ─────────────────────────────────────────────────────────────────
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia)
|
||||
|
||||
# ── Find FFmpeg via pkg-config ───────────────────────────────────────────────
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
|
||||
libavformat
|
||||
libavcodec
|
||||
libavutil
|
||||
libswresample
|
||||
)
|
||||
|
||||
# Auto-generate MOC files from Q_OBJECT headers
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
# ── Sources (all located in src/ relative to this file) ──────────────────────
|
||||
set(SOURCES
|
||||
src/main.cpp
|
||||
src/MetadataReader.cpp
|
||||
src/Config.cpp
|
||||
src/AudioEngine.cpp
|
||||
src/MusicLibrary.cpp
|
||||
src/CoverArtWidget.cpp
|
||||
src/SpectrogramWidget.cpp
|
||||
src/EqualizerWidget.cpp
|
||||
src/TrackDelegate.cpp
|
||||
src/PlaylistModel.cpp
|
||||
src/MainWindow.cpp
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
src/Track.h
|
||||
src/MetadataReader.h
|
||||
src/Config.h
|
||||
src/AudioEngine.h
|
||||
src/MusicLibrary.h
|
||||
src/CoverArtWidget.h
|
||||
src/SpectrogramWidget.h
|
||||
src/EqualizerWidget.h
|
||||
src/TrackDelegate.h
|
||||
src/PlaylistModel.h
|
||||
src/MainWindow.h
|
||||
)
|
||||
|
||||
add_executable(SubWave ${SOURCES} ${HEADERS})
|
||||
|
||||
# ── Link libraries ───────────────────────────────────────────────────────────
|
||||
target_link_libraries(SubWave PRIVATE
|
||||
Qt6::Widgets
|
||||
Qt6::Multimedia
|
||||
PkgConfig::FFMPEG
|
||||
)
|
||||
|
||||
# ── (Optional) Copy FFmpeg shared libs next to the binary on Windows ─────────
|
||||
if(WIN32)
|
||||
add_custom_command(TARGET SubWave POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"$<TARGET_FILE:PkgConfig::FFMPEG>" "$<TARGET_FILE_DIR:SubWave>"
|
||||
)
|
||||
endif()
|
||||
Reference in New Issue
Block a user