summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/cmake-macros/examples.cmake
blob: 685b29db019903656ef5978d94b351d90295f2f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#! [qt5_wrap_cpp]
set(SOURCES myapp.cpp main.cpp)
qt5_wrap_cpp(SOURCES myapp.h)
add_executable(myapp ${SOURCES})
#! [qt5_wrap_cpp]

#! [qt_wrap_cpp]
set(SOURCES myapp.cpp main.cpp)
qt_wrap_cpp(SOURCES myapp.h)
add_executable(myapp ${SOURCES})
#! [qt_wrap_cpp]

#! [qt5_add_resources]
set(SOURCES main.cpp)
qt5_add_resources(SOURCES example.qrc)
add_executable(myapp ${SOURCES})
#! [qt5_add_resources]

#! [qt_add_resources]
set(SOURCES main.cpp)
qt_add_resources(SOURCES example.qrc)
add_executable(myapp ${SOURCES})
#! [qt_add_resources]

#! [qt5_add_big_resources]
set(SOURCES main.cpp)
qt5_add_big_resources(SOURCES big_resource.qrc)
add_executable(myapp ${SOURCES})
#! [qt5_add_big_resources]

#! [qt_add_big_resources]
set(SOURCES main.cpp)
qt_add_big_resources(SOURCES big_resource.qrc)
add_executable(myapp ${SOURCES})
#! [qt_add_big_resources]

#! [qt5_add_binary_resources]
qt5_add_binary_resources(resources project.qrc OPTIONS -no-compress)
add_dependencies(myapp resources)
#! [qt5_add_binary_resources]

#! [qt_add_binary_resources]
qt_add_binary_resources(resources project.qrc OPTIONS -no-compress)
add_dependencies(myapp resources)
#! [qt_add_binary_resources]

#! [qt5_generate_moc]
qt5_generate_moc(main.cpp main.moc TARGET myapp)
#! [qt5_generate_moc]

#! [qt_generate_moc]
qt_generate_moc(main.cpp main.moc TARGET myapp)
#! [qt_generate_moc]

#! [qt5_import_plugins]
add_executable(myapp main.cpp)
target_link_libraries(myapp Qt5::Gui Qt5::Sql)
qt5_import_plugins(myapp
    INCLUDE Qt5::QCocoaIntegrationPlugin
    EXCLUDE Qt5::QMinimalIntegrationPlugin
    INCLUDE_BY_TYPE imageformats Qt5::QGifPlugin Qt5::QJpegPlugin
    EXCLUDE_BY_TYPE sqldrivers
)
#! [qt5_import_plugins]

#! [qt_import_plugins]
add_executable(myapp main.cpp)
target_link_libraries(myapp Qt5::Gui Qt5::Sql)
qt_import_plugins(myapp
    INCLUDE Qt5::QCocoaIntegrationPlugin
    EXCLUDE Qt5::QMinimalIntegrationPlugin
    INCLUDE_BY_TYPE imageformats Qt5::QGifPlugin Qt5::QJpegPlugin
    EXCLUDE_BY_TYPE sqldrivers
)
#! [qt_import_plugins]

#! [qt_add_executable_simple]
qt_add_executable(simpleapp main.cpp)
#! [qt_add_executable_simple]

#! [qt_add_executable_deferred]
qt_add_executable(complexapp MANUAL_FINALIZATION complex.cpp)
set_target_properties(complexapp PROPERTIES OUTPUT_NAME Complexify)
qt_finalize_target(complexapp)
#! [qt_add_executable_deferred]

#! [qt_android_deploy_basic]
qt_android_generate_deployment_settings(myapp)
qt_android_add_apk_target(myapp)
#! [qt_android_deploy_basic]