fix build without QmlPrivate

Change-Id: Ibc333a07137b7afb39676d4d3bc89d0c4dadb11d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Oswald Buddenhagen
2022-02-27 12:51:30 +01:00
parent 2829412e15
commit 413c73b781

View File

@@ -21,20 +21,22 @@ extend_qtc_plugin(QmlPreview
tests/qmlpreviewplugin_test.cpp tests/qmlpreviewplugin_test.h tests/qmlpreviewplugin_test.cpp tests/qmlpreviewplugin_test.h
) )
# check if Qt version have_qml_debug_translation_protocol if(TARGET Qt${QT_VERSION_MAJOR}::QmlPrivate)
# will be introduced in Qt 6.2, but there are users # check if Qt version have_qml_debug_translation_protocol
# who needs it in older but special built Qt versions aswell # will be introduced in Qt 6.2, but there are users
string(REGEX MATCH "^[0-9]*" QT_VERSION_MAJOR ${Qt5_VERSION}) # who needs it in older but special built Qt versions aswell
get_target_property(qmldebugprivate_include_directories string(REGEX MATCH "^[0-9]*" QT_VERSION_MAJOR ${Qt5_VERSION})
get_target_property(qmldebugprivate_include_directories
Qt${QT_VERSION_MAJOR}::QmlPrivate Qt${QT_VERSION_MAJOR}::QmlPrivate
INTERFACE_INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES
) )
find_file(have_qml_debug_translation_protocol find_file(have_qml_debug_translation_protocol
NAMES private/qqmldebugtranslationprotocol_p.h NAMES private/qqmldebugtranslationprotocol_p.h
PATHS ${qmldebugprivate_include_directories} PATHS ${qmldebugprivate_include_directories}
) )
extend_qtc_plugin(QmlPreview extend_qtc_plugin(QmlPreview
CONDITION have_qml_debug_translation_protocol CONDITION have_qml_debug_translation_protocol
PUBLIC_DEPENDS Qt5::QmlPrivate PUBLIC_DEPENDS Qt5::QmlPrivate
PUBLIC_DEFINES "FOUND_QML_DEBUG_TRANSLATION_PROTOCOL" PUBLIC_DEFINES "FOUND_QML_DEBUG_TRANSLATION_PROTOCOL"
) )
endif()