Restore support for CMake < 3.11

Prior to CMake 3.11, the SOURCES could not be omitted when
calling add_executable.

This change ensures that SOURCES are passed, at least when
building against Qt < 6.2.

Change-Id: I83bd82fe12364523ce6954d145b632df7210d118
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2021-07-06 14:00:45 +02:00
parent 9857985013
commit f29d7b896f
4 changed files with 41 additions and 30 deletions

View File

@@ -69,16 +69,12 @@ set(QMLPROFILER_CPP_SOURCES
scenegraphtimelinemodel.cpp scenegraphtimelinemodel.h
)
add_qtc_plugin(QmlProfiler
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
SOURCES
${TEST_SOURCES}
)
if(${Qt5_VERSION} VERSION_LESS "6.2.0")
extend_qtc_plugin(QmlProfiler
add_qtc_plugin(QmlProfiler
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
SOURCES
${TEST_SOURCES}
${QMLPROFILER_CPP_SOURCES}
qml/qmlprofiler.qrc
)
@@ -87,6 +83,13 @@ else() # < Qt 6.2
return()
endif()
add_qtc_plugin(QmlProfiler
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
SOURCES
${TEST_SOURCES}
)
set(QMLPROFILER_QML_FILES
qml/QmlProfilerFlameGraphView.qml
)