Reworks the example into a pure desktop-pet: the cat wanders, sits, grooms, stretches, dashes and naps, reacts to petting and dragging, and follows the cursor with its eyes. The window-scanning and Accessibility code is gone. The cat is drawn from rounded primitives plus Shape paths in a fixed 100x90 design space, so it scales cleanly to any size. Linux/X11 is the primary target: the tray is optional, Wayland gets a warning, and WORKCAT_X11_BYPASS / WORKCAT_OPAQUE cover uncooperative window managers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
65 lines
2.0 KiB
CMake
65 lines
2.0 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(Workcat
|
|
VERSION 0.2.0
|
|
DESCRIPTION "A cute desktop cat that wanders along the bottom of your screen"
|
|
LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
find_package(Qt6 6.8 REQUIRED COMPONENTS Core Gui Quick QuickControls2 Widgets)
|
|
qt_standard_project_setup(REQUIRES 6.8)
|
|
|
|
qt_add_executable(workcat
|
|
src/main.cpp
|
|
src/catcontroller.h src/catcontroller.cpp
|
|
src/traycontroller.h src/traycontroller.cpp
|
|
src/appsettings.h src/appsettings.cpp
|
|
src/platforminfo.h src/platforminfo.cpp
|
|
)
|
|
|
|
target_include_directories(workcat PRIVATE src)
|
|
|
|
# QML files live in qml/ but register at the module root (Workcat.Main etc.)
|
|
set(WORKCAT_QML Main Cat SettingsWindow)
|
|
foreach(qmlfile IN LISTS WORKCAT_QML)
|
|
set_source_files_properties(qml/${qmlfile}.qml PROPERTIES QT_RESOURCE_ALIAS ${qmlfile}.qml)
|
|
list(APPEND WORKCAT_QML_FILES qml/${qmlfile}.qml)
|
|
endforeach()
|
|
|
|
qt_add_qml_module(workcat
|
|
URI Workcat
|
|
VERSION 1.0
|
|
QML_FILES ${WORKCAT_QML_FILES}
|
|
)
|
|
|
|
target_link_libraries(workcat PRIVATE
|
|
Qt6::Core Qt6::Gui Qt6::Quick Qt6::QuickControls2 Qt6::Widgets)
|
|
|
|
set_target_properties(workcat PROPERTIES
|
|
MACOSX_BUNDLE TRUE
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/Info.plist.in
|
|
MACOSX_BUNDLE_GUI_IDENTIFIER app.workcat.example
|
|
MACOSX_BUNDLE_BUNDLE_NAME Workcat
|
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
WIN32_EXECUTABLE TRUE)
|
|
|
|
include(GNUInstallDirs)
|
|
install(TARGETS workcat
|
|
BUNDLE DESTINATION .
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
install(FILES linux/workcat.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
|
endif()
|
|
|
|
qt_generate_deploy_qml_app_script(
|
|
TARGET workcat
|
|
OUTPUT_SCRIPT deploy_script
|
|
MACOS_BUNDLE_POST_BUILD
|
|
NO_UNSUPPORTED_PLATFORM_ERROR
|
|
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM)
|
|
install(SCRIPT ${deploy_script})
|