qt5base-lts/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
Axel Spoerl 2ae75c2e6a Fix CMakeLists.txt of Style Plugin Example (broken on macOS)
Add TARGET instruction in property setter, used in debug mode on macOS.

Task-number: QTBUG-107842
Task-number: QTBUG-109227
Change-Id: I8704b7009c36ea8ddbf8773abfaf2b5f34f728ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-19 10:50:04 +00:00

42 lines
1016 B
CMake

# 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}"
)