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

@@ -32,17 +32,13 @@ set(TRACING_CPP_SOURCES
tracing_global.h tracing_global.h
) )
add_qtc_library(Tracing
FEATURE_INFO
DEPENDS Utils Qt5::Qml Qt5::Quick
PUBLIC_DEPENDS Qt5::Widgets
SOURCES
${TEST_SOURCES}
)
if(${Qt5_VERSION} VERSION_LESS "6.2.0") if(${Qt5_VERSION} VERSION_LESS "6.2.0")
extend_qtc_library(Tracing add_qtc_library(Tracing
FEATURE_INFO
DEPENDS Utils Qt5::Qml Qt5::Quick
PUBLIC_DEPENDS Qt5::Widgets
SOURCES SOURCES
${TEST_SOURCES}
${TRACING_CPP_SOURCES} ${TRACING_CPP_SOURCES}
qml/tracing.qrc qml/tracing.qrc
) )
@@ -51,6 +47,14 @@ else() # < Qt 6.2
return() return()
endif() endif()
add_qtc_library(Tracing
FEATURE_INFO
DEPENDS Utils Qt5::Qml Qt5::Quick
PUBLIC_DEPENDS Qt5::Widgets
SOURCES
${TEST_SOURCES}
)
set(TRACING_QML_FILES set(TRACING_QML_FILES
qml/ButtonsBar.qml qml/ButtonsBar.qml
qml/CategoryLabel.qml qml/CategoryLabel.qml

View File

@@ -38,16 +38,12 @@ set(PERFPROFILER_CPP_SOURCES
perftracepointdialog.cpp perftracepointdialog.h perftracepointdialog.ui perftracepointdialog.cpp perftracepointdialog.h perftracepointdialog.ui
) )
add_qtc_plugin(PerfProfiler
DEPENDS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
SOURCES
${TEST_SOURCES}
)
if(${Qt5_VERSION} VERSION_LESS "6.2.0") if(${Qt5_VERSION} VERSION_LESS "6.2.0")
extend_qtc_plugin(PerfProfiler add_qtc_plugin(PerfProfiler
DEPENDS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
SOURCES SOURCES
${TEST_SOURCES}
${PERFPROFILER_CPP_SOURCES} ${PERFPROFILER_CPP_SOURCES}
perfprofiler.qrc perfprofiler.qrc
) )
@@ -56,6 +52,13 @@ else() # < Qt 6.2
return() return()
endif() endif()
add_qtc_plugin(PerfProfiler
DEPENDS Tracing Qt5::QuickWidgets
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
SOURCES
${TEST_SOURCES}
)
qt_add_resources(PerfProfiler perfprofiler qt_add_resources(PerfProfiler perfprofiler
PREFIX "/perfprofiler" PREFIX "/perfprofiler"
tracepoints.sh tracepoints.sh

View File

@@ -69,16 +69,12 @@ set(QMLPROFILER_CPP_SOURCES
scenegraphtimelinemodel.cpp scenegraphtimelinemodel.h 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") 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 SOURCES
${TEST_SOURCES}
${QMLPROFILER_CPP_SOURCES} ${QMLPROFILER_CPP_SOURCES}
qml/qmlprofiler.qrc qml/qmlprofiler.qrc
) )
@@ -87,6 +83,13 @@ else() # < Qt 6.2
return() return()
endif() 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 set(QMLPROFILER_QML_FILES
qml/QmlProfilerFlameGraphView.qml qml/QmlProfilerFlameGraphView.qml
) )

View File

@@ -1,19 +1,20 @@
add_qtc_test(tst_tracing_flamegraphview
DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils
)
set(TSTFLAMEGRAPHVIEW_CPP_SOURCES set(TSTFLAMEGRAPHVIEW_CPP_SOURCES
testflamegraphmodel.h testflamegraphmodel.h
tst_flamegraphview.cpp tst_flamegraphview.cpp
) )
if(${Qt5_VERSION} VERSION_LESS "6.2.0") if(${Qt5_VERSION} VERSION_LESS "6.2.0")
extend_qtc_test(tst_tracing_flamegraphview add_qtc_test(tst_tracing_flamegraphview
DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils
SOURCES SOURCES
${TSTFLAMEGRAPHVIEW_CPP_SOURCES} ${TSTFLAMEGRAPHVIEW_CPP_SOURCES}
flamegraphview.qrc flamegraphview.qrc
) )
else() # < Qt 6.2 else() # < Qt 6.2
add_qtc_test(tst_tracing_flamegraphview
DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils
)
qt_add_qml_module(tst_tracing_flamegraphview qt_add_qml_module(tst_tracing_flamegraphview
URI "QtCreator.TstTracingFlameGraphView" URI "QtCreator.TstTracingFlameGraphView"
VERSION "1.0" VERSION "1.0"