diff options
Diffstat (limited to 'examples/widgets/desktop/systray/CMakeLists.txt')
-rw-r--r-- | examples/widgets/desktop/systray/CMakeLists.txt | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt index b83a567dd4..c42469bf59 100644 --- a/examples/widgets/desktop/systray/CMakeLists.txt +++ b/examples/widgets/desktop/systray/CMakeLists.txt @@ -4,16 +4,10 @@ cmake_minimum_required(VERSION 3.16) project(systray LANGUAGES CXX) -set(CMAKE_AUTOMOC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/desktop/systray") - find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) +qt_standard_project_setup() + qt_add_executable(systray main.cpp window.cpp window.h @@ -24,10 +18,10 @@ set_target_properties(systray PROPERTIES MACOSX_BUNDLE TRUE ) -target_link_libraries(systray PUBLIC - Qt::Core - Qt::Gui - Qt::Widgets +target_link_libraries(systray PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Widgets ) # Resources: @@ -45,7 +39,14 @@ qt_add_resources(systray "systray" ) install(TARGETS systray - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +qt_generate_deploy_app_script( + TARGET systray + OUTPUT_SCRIPT deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR ) +install(SCRIPT ${deploy_script}) |