Files
ocr-screenshot-gallery/CMakeLists.txt
T
yzinchuk 55454d7ef6 rebrand to orc-gallery and optimise search/thumbnail responsiveness
Rebrand:
- Rename project, binary, desktop file, and icons from screenshot-gallery/orcs-gallery to orc-gallery
- Update display name to "ORC Gallery" throughout (window title, .desktop, README, plan.md)
- Config dir changed from ScreenshotOCRGallery to OrcGallery

Performance:
- cancelSearch() is now non-blocking; new searches start immediately instead of waiting for the previous thread to drain
- Remove double-emit from QFutureWatcher::finished handler; results emitted once directly from background thread
- SQLite WAL mode + NORMAL sync + 20 MB page cache + memory temp store + 256 MB mmap applied on init and per-thread connections
- Typing inactivity timer reduced from 500 ms to 150 ms
- COUNT(*) OVER() window function folds total-count into the main SELECT, eliminating a separate COUNT round-trip per search
- ImageThumbnail::paintEvent draws the filename overlay; removes 3 child QObjects (QFrame + QLabel + QHBoxLayout) per thumbnail
- loadThumbnailAsync posts QImage load+scale to QThreadPool; QPixmap::fromImage called on main thread via Qt::QueuedConnection invokeMethod; QPointer guards against use-after-free on gallery clear

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 03:53:07 -04:00

64 lines
1.8 KiB
CMake

cmake_minimum_required(VERSION 3.16)
project(orc-gallery 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)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Sql Concurrent)
# Add resources file
set(RESOURCE_FILES
resources.qrc
)
set(PROJECT_SOURCES
src/main.cpp
src/mainwindow.cpp
src/mainwindow.h
src/imagegallery.cpp
src/imagegallery.h
src/databasemanager.cpp
src/databasemanager.h
src/settingsdialog.cpp
src/settingsdialog.h
src/updatedatabasedialog.cpp
src/updatedatabasedialog.h
)
add_executable(orc-gallery ${PROJECT_SOURCES} ${RESOURCE_FILES})
# Install icons to standard system locations
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/orc-gallery-64.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps"
RENAME "orc-gallery.png")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/orc-gallery-128.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128/apps"
RENAME "orc-gallery.png")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/orc-gallery-256.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps"
RENAME "orc-gallery.png")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/icons/orc-gallery-512.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/512x512/apps"
RENAME "orc-gallery.png")
target_link_libraries(orc-gallery PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Sql
Qt6::Concurrent
)
install(TARGETS orc-gallery
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Install desktop file
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/orc-gallery.desktop"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")