Main.qml declared both layouts at once: the small per-object windows and the full-screen overlay. Both of them write the controller's catCenter, which is where the eyes look for the cursor. Two bindings on one property overwrite each other, so catCenter alternated every frame between the cat window's real centre and the hidden overlay's, whose height is zero. look.y flipped between -0.495 and 1.0 sixty times a second and the pupils jumped with it. Each layout now sits behind its own Loader and only the one the platform needs is built. The small windows moved into Desktop.qml so a single component can hold all three of them. Measured in the running app while walking, the eye's vertical travel went from 2.6 px to 0.40 px, and look.y is now a single steady value. It also stops a second, invisible cat from animating in the background. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
68 lines
2.2 KiB
CMake
68 lines
2.2 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(TNCat
|
|
VERSION 0.3.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)
|
|
|
|
# No Qt Quick Controls and no Qt Widgets: the whole interface is plain Qt Quick.
|
|
find_package(Qt6 6.5 REQUIRED COMPONENTS Core Gui Quick QuickShapes)
|
|
qt_standard_project_setup(REQUIRES 6.5)
|
|
|
|
qt_add_executable(tncat
|
|
src/main.cpp
|
|
src/catcontroller.h src/catcontroller.cpp
|
|
src/appsettings.h src/appsettings.cpp
|
|
src/platforminfo.h src/platforminfo.cpp
|
|
)
|
|
|
|
target_include_directories(tncat PRIVATE src)
|
|
|
|
# QML files live in qml/ but register at the module root (TNCat.Main etc.)
|
|
set(TNCAT_QML Main Desktop Cat Chip Cup CatWindow ChipWindow CupWindow OverlayWindow
|
|
SettingsWindow AppButton AppSlider AppToggle SettingsGroup CatDefs)
|
|
foreach(qmlfile IN LISTS TNCAT_QML)
|
|
set_source_files_properties(qml/${qmlfile}.qml PROPERTIES QT_RESOURCE_ALIAS ${qmlfile}.qml)
|
|
list(APPEND TNCAT_QML_FILES qml/${qmlfile}.qml)
|
|
endforeach()
|
|
|
|
set_source_files_properties(qml/CatDefs.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE)
|
|
|
|
qt_add_qml_module(tncat
|
|
URI TNCat
|
|
VERSION 1.0
|
|
QML_FILES ${TNCAT_QML_FILES}
|
|
)
|
|
|
|
target_link_libraries(tncat PRIVATE
|
|
Qt6::Core Qt6::Gui Qt6::Quick Qt6::QuickShapes)
|
|
|
|
set_target_properties(tncat PROPERTIES
|
|
MACOSX_BUNDLE TRUE
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/Info.plist.in
|
|
MACOSX_BUNDLE_GUI_IDENTIFIER app.tncat.example
|
|
MACOSX_BUNDLE_BUNDLE_NAME TNCat
|
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
WIN32_EXECUTABLE TRUE)
|
|
|
|
include(GNUInstallDirs)
|
|
install(TARGETS tncat
|
|
BUNDLE DESTINATION .
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
install(FILES linux/tncat.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
|
endif()
|
|
|
|
qt_generate_deploy_qml_app_script(
|
|
TARGET tncat
|
|
OUTPUT_SCRIPT deploy_script
|
|
MACOS_BUNDLE_POST_BUILD
|
|
NO_UNSUPPORTED_PLATFORM_ERROR
|
|
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM)
|
|
install(SCRIPT ${deploy_script})
|