summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/completer
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/tools/completer')
-rw-r--r--examples/widgets/tools/completer/CMakeLists.txt31
-rw-r--r--examples/widgets/tools/completer/main.cpp2
2 files changed, 16 insertions, 17 deletions
diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt
index fa2bce8505..a4ad8055b9 100644
--- a/examples/widgets/tools/completer/CMakeLists.txt
+++ b/examples/widgets/tools/completer/CMakeLists.txt
@@ -4,16 +4,10 @@
cmake_minimum_required(VERSION 3.16)
project(completer LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/completer")
-
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(completer
fsmodel.cpp fsmodel.h
main.cpp
@@ -25,10 +19,10 @@ set_target_properties(completer PROPERTIES
MACOSX_BUNDLE TRUE
)
-target_link_libraries(completer PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+target_link_libraries(completer PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
@@ -45,7 +39,14 @@ qt_add_resources(completer "completer"
)
install(TARGETS completer
- 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 completer
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})
diff --git a/examples/widgets/tools/completer/main.cpp b/examples/widgets/tools/completer/main.cpp
index 4ea6bc1ac9..060dfe5bd8 100644
--- a/examples/widgets/tools/completer/main.cpp
+++ b/examples/widgets/tools/completer/main.cpp
@@ -7,8 +7,6 @@
//! [0]
int main(int argc, char *argv[])
{
- Q_INIT_RESOURCE(completer);
-
QApplication app(argc, argv);
MainWindow window;
window.show();