|
| 1 | +# SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group |
| 2 | + |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only |
| 5 | + |
| 6 | +set(TARGET declarativewidgets) |
| 7 | + |
| 8 | +add_library( |
| 9 | + ${TARGET} MODULE |
| 10 | + abstractdeclarativeobject.cpp |
| 11 | + declarativeaction.cpp |
| 12 | + declarativeactionitem.cpp |
| 13 | + declarativeboxlayout.cpp |
| 14 | + declarativebuttongroupextension.cpp |
| 15 | + declarativecolordialog.cpp |
| 16 | + declarativecomboboxextension.cpp |
| 17 | + declarativefiledialog.cpp |
| 18 | + declarativefilesystemmodelextension.cpp |
| 19 | + declarativefontdialog.cpp |
| 20 | + declarativeformlayout.cpp |
| 21 | + declarativegridlayout.cpp |
| 22 | + declarativehboxlayout.cpp |
| 23 | + declarativeicon.cpp |
| 24 | + declarativeinputdialog.cpp |
| 25 | + declarativeitemviewextension.cpp |
| 26 | + declarativelabelextension.cpp |
| 27 | + declarativelayoutextension.cpp |
| 28 | + declarativeline.cpp |
| 29 | + declarativeloaderwidget.cpp |
| 30 | + declarativemessagebox.cpp |
| 31 | + declarativeobjectextension.cpp |
| 32 | + declarativepixmap.cpp |
| 33 | + declarativeqmlcontext.cpp |
| 34 | + declarativequickwidgetextension.cpp |
| 35 | + declarativeseparator.cpp |
| 36 | + declarativespaceritem.cpp |
| 37 | + declarativestackedlayout.cpp |
| 38 | + declarativestatusbar.cpp |
| 39 | + declarativestringlistmodelextension.cpp |
| 40 | + declarativetableviewextension.cpp |
| 41 | + declarativetabstops.cpp |
| 42 | + declarativetabwidget.cpp |
| 43 | + declarativetexteditextension.cpp |
| 44 | + declarativetreeviewextension.cpp |
| 45 | + declarativevboxlayout.cpp |
| 46 | + declarativewidgetextension.cpp |
| 47 | + declarativewidgets_plugin.cpp |
| 48 | + defaultobjectcontainer.cpp |
| 49 | + defaultwidgetcontainer.cpp |
| 50 | + mainwindowwidgetcontainer.cpp |
| 51 | + menubarwidgetcontainer.cpp |
| 52 | + menuwidgetcontainer.cpp |
| 53 | + objectadaptors.cpp |
| 54 | + scrollareawidgetcontainer.cpp |
| 55 | + stackedwidgetwidgetcontainer.cpp |
| 56 | + staticdialogmethodattached.cpp |
| 57 | + toolbarwidgetcontainer.cpp |
| 58 | + declarativesizepolicy.cpp) |
| 59 | + |
| 60 | +target_link_libraries( |
| 61 | + ${TARGET} |
| 62 | + PRIVATE Qt${QTMAJOR}::Core Qt${QTMAJOR}::CorePrivate Qt${QTMAJOR}::Qml |
| 63 | + Qt${QTMAJOR}::Widgets Qt${QTMAJOR}::QuickWidgets) |
| 64 | + |
| 65 | +if(Qt${QTMAJOR}WebEngineWidgets_FOUND) |
| 66 | + target_link_libraries(${TARGET} PRIVATE Qt${QTMAJOR}::WebEngineWidgets) |
| 67 | +endif() |
| 68 | + |
| 69 | +target_compile_definitions(${TARGET} PRIVATE BUILDING_DECLARATIVEWIDGETS) |
| 70 | + |
| 71 | +set(PLUGIN_DESTDIR ${CMAKE_BINARY_DIR}/qml) |
| 72 | + |
| 73 | +set_target_properties(${TARGET} PROPERTIES LIBRARY_OUTPUT_DIRECTORY |
| 74 | + "${PLUGIN_DESTDIR}/QtWidgets") |
| 75 | + |
| 76 | +if(NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL "${PLUGIN_DESTDIR}/QtWidgets") |
| 77 | + add_custom_command( |
| 78 | + TARGET ${TARGET} |
| 79 | + POST_BUILD |
| 80 | + COMMENT "Copy qmldir to build directory" |
| 81 | + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir |
| 82 | + ${PLUGIN_DESTDIR}/QtWidgets/qmldir) |
| 83 | +endif() |
| 84 | + |
| 85 | +install(TARGETS ${TARGET} |
| 86 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt${QTMAJOR}/qml/QtWidgets) |
| 87 | + |
| 88 | +install(FILES qmldir |
| 89 | + DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt${QTMAJOR}/qml/QtWidgets) |
0 commit comments