summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
blob: 494a4a90f6a79b10800b3eff60c4c5abd86209d6 (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
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

#! [0]
qt_add_plugin(simplestyleplugin
    CLASS_NAME SimpleStylePlugin
    simplestyle.cpp simplestyle.h
    simplestyleplugin.cpp simplestyleplugin.h
)
#! [0]

if(QT_FEATURE_debug AND APPLE)
    set_property(TARGET simplestyleplugin
       APPEND_STRING PROPERTY OUTPUT_NAME "_debug")
endif()

get_target_property(is_bundle styleplugin MACOSX_BUNDLE)
if(APPLE AND is_bundle)
#! [1]
    set_target_properties(simplestyleplugin PROPERTIES
        LIBRARY_OUTPUT_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:styleplugin>/PlugIns/styles"
    )
#! [1]
else()
#! [2]
    set_target_properties(simplestyleplugin PROPERTIES
        LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:styleplugin>/styles"
    )
#! [2]
endif()

target_link_libraries(simplestyleplugin PRIVATE
    Qt6::Core
    Qt6::Gui
    Qt6::Widgets
)

install(TARGETS simplestyleplugin
    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)