2026-08-26 00:28:35 +02:00
|
|
|
cmake_minimum_required(VERSION 3.20)
|
|
|
|
|
project(photogallery_uploader LANGUAGES CXX)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2026-09-26 10:33:22 +02:00
|
|
|
set(CMAKE_AUTORCC ON)
|
2026-08-26 00:28:35 +02:00
|
|
|
|
2026-09-26 10:17:13 +02:00
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Widgets Network Concurrent)
|
2026-08-26 00:28:35 +02:00
|
|
|
find_package(Qt6Keychain REQUIRED)
|
|
|
|
|
|
|
|
|
|
add_executable(uploader
|
|
|
|
|
main.cpp
|
|
|
|
|
mainwindow.cpp
|
2026-09-26 10:17:13 +02:00
|
|
|
photoitemwidget.cpp
|
2026-08-26 00:28:35 +02:00
|
|
|
settings.cpp
|
|
|
|
|
uploadclient.cpp
|
|
|
|
|
imageprep.cpp
|
2026-09-26 10:33:22 +02:00
|
|
|
app.qrc
|
2026-08-26 00:28:35 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(uploader PRIVATE
|
|
|
|
|
Qt6::Widgets
|
|
|
|
|
Qt6::Network
|
2026-09-26 10:17:13 +02:00
|
|
|
Qt6::Concurrent
|
2026-08-26 00:28:35 +02:00
|
|
|
Qt6Keychain::Qt6Keychain
|
|
|
|
|
)
|
2026-09-26 10:33:22 +02:00
|
|
|
|
2026-09-26 10:51:39 +02:00
|
|
|
# The binary is "photog" (matching the app + package), so `nix run` and the
|
|
|
|
|
# desktop entry find it; the CMake target stays "uploader".
|
|
|
|
|
set_target_properties(uploader PROPERTIES OUTPUT_NAME photog)
|
|
|
|
|
|
2026-09-26 10:33:22 +02:00
|
|
|
# Installation — the binary, a desktop entry, and the app icon in the hicolor
|
|
|
|
|
# theme, so `nix profile install ./desktop` puts "Photog" in the app menu.
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
install(TARGETS uploader RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
install(FILES photog.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
|
|
|
|
foreach(sz 32 128 256 512)
|
|
|
|
|
install(FILES icons/app-${sz}.png
|
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${sz}x${sz}/apps
|
|
|
|
|
RENAME photog.png)
|
|
|
|
|
endforeach()
|