From 44920e7fb272f49423c925555e8ae3bc38ffd8a4 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Thu, 3 Sep 2020 15:01:05 +0100 Subject: CMake: Fix building with -DQT_FEATURE_gui=OFF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some CMake files currently assume that QtGui is always enabled and we get a configure-time failure without these changes. Task-number: QTBUG-86053 Change-Id: I28e32c180c32221f32519017bac6b518a19d5983 Reviewed-by: Tor Arne Vestbø Reviewed-by: Qt CI Bot --- tests/auto/.prev_CMakeLists.txt | 4 ---- tests/auto/CMakeLists.txt | 6 +++++- .../corelib/io/qprocess/testExitCodes/.prev_CMakeLists.txt | 13 +++++++++++++ tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt | 4 ++-- .../io/qprocess/testForwardingHelper/.prev_CMakeLists.txt | 13 +++++++++++++ .../corelib/io/qprocess/testForwardingHelper/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessCrash/.prev_CMakeLists.txt | 13 +++++++++++++ .../corelib/io/qprocess/testProcessCrash/CMakeLists.txt | 4 ++-- .../testProcessDeadWhileReading/.prev_CMakeLists.txt | 13 +++++++++++++ .../io/qprocess/testProcessDeadWhileReading/CMakeLists.txt | 4 ++-- .../corelib/io/qprocess/testProcessEOF/.prev_CMakeLists.txt | 13 +++++++++++++ .../auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessEcho/.prev_CMakeLists.txt | 13 +++++++++++++ .../auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessEcho2/.prev_CMakeLists.txt | 13 +++++++++++++ .../corelib/io/qprocess/testProcessEcho2/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessEcho3/.prev_CMakeLists.txt | 13 +++++++++++++ .../corelib/io/qprocess/testProcessEcho3/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessEnvironment/.prev_CMakeLists.txt | 13 +++++++++++++ .../io/qprocess/testProcessEnvironment/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessHang/.prev_CMakeLists.txt | 13 +++++++++++++ .../auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt | 4 ++-- .../io/qprocess/testProcessSpacesArgs/CMakeLists.txt | 12 ++++++------ tests/auto/corelib/kernel/CMakeLists.txt | 4 ++-- tests/auto/corelib/kernel/kernel.pro | 4 +++- 25 files changed, 166 insertions(+), 34 deletions(-) create mode 100644 tests/auto/corelib/io/qprocess/testExitCodes/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testForwardingHelper/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessCrash/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessEOF/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessEcho/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessEcho2/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessEcho3/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessEnvironment/.prev_CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocess/testProcessHang/.prev_CMakeLists.txt (limited to 'tests/auto') diff --git a/tests/auto/.prev_CMakeLists.txt b/tests/auto/.prev_CMakeLists.txt index 21b6c2aff2..8a5e002e84 100644 --- a/tests/auto/.prev_CMakeLists.txt +++ b/tests/auto/.prev_CMakeLists.txt @@ -11,10 +11,6 @@ endif() if(QT_FEATURE_process AND NOT CMAKE_CROSSCOMPILING) add_subdirectory(tools) endif() -if(NOT CMAKE_CROSSCOMPILING) - add_subdirectory(cmake) - add_subdirectory(installed_cmake) -endif() if(TARGET Qt::Concurrent) add_subdirectory(concurrent) endif() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 49c2ff4a2c..2452e1a5d8 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -17,7 +17,11 @@ if (NOT CMAKE_CROSSCOMPILE AND QT_FEATURE_process) add_subdirectory(tools) endif() add_subdirectory(corelib) -add_subdirectory(cmake) +# special case begin +if (TARGET Qt::Xml AND TARGET Qt::Sql AND TARGET Qt::Network) + add_subdirectory(cmake) +endif() +# special case end if (TARGET Qt::Concurrent) add_subdirectory(concurrent) endif() diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testExitCodes/.prev_CMakeLists.txt new file mode 100644 index 0000000000..cf3f6f4e64 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testExitCodes/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testExitCodes.pro. + +##################################################################### +## testExitCodes Binary: +##################################################################### + +qt_add_executable(testExitCodes + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt index cf3f6f4e64..5ad0ab05df 100644 --- a/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testExitCodes OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testForwardingHelper/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testForwardingHelper/.prev_CMakeLists.txt new file mode 100644 index 0000000000..9197f96e10 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testForwardingHelper/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testForwardingHelper.pro. + +##################################################################### +## testForwardingHelper Binary: +##################################################################### + +qt_add_executable(testForwardingHelper + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt index 9197f96e10..0024b006ed 100644 --- a/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testForwardingHelper OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessCrash/.prev_CMakeLists.txt new file mode 100644 index 0000000000..d09e1364fb --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessCrash.pro. + +##################################################################### +## testProcessCrash Binary: +##################################################################### + +qt_add_executable(testProcessCrash + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt index d09e1364fb..1b2ab3eac5 100644 --- a/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessCrash OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/.prev_CMakeLists.txt new file mode 100644 index 0000000000..aade19fa91 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessDeadWhileReading.pro. + +##################################################################### +## testProcessDeadWhileReading Binary: +##################################################################### + +qt_add_executable(testProcessDeadWhileReading + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt index aade19fa91..50407cbc7a 100644 --- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessDeadWhileReading OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEOF/.prev_CMakeLists.txt new file mode 100644 index 0000000000..7fe205c5d4 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessEOF.pro. + +##################################################################### +## testProcessEOF Binary: +##################################################################### + +qt_add_executable(testProcessEOF + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt index 7fe205c5d4..b30249caa9 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessEOF OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho/.prev_CMakeLists.txt new file mode 100644 index 0000000000..0db956d16c --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessEcho.pro. + +##################################################################### +## testProcessEcho Binary: +##################################################################### + +qt_add_executable(testProcessEcho + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt index 0db956d16c..db46ca06cb 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessEcho OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho2/.prev_CMakeLists.txt new file mode 100644 index 0000000000..abe80a3cff --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessEcho2.pro. + +##################################################################### +## testProcessEcho2 Binary: +##################################################################### + +qt_add_executable(testProcessEcho2 + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt index abe80a3cff..87acd13c16 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessEcho2 OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho3/.prev_CMakeLists.txt new file mode 100644 index 0000000000..8b7a8b3a51 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessEcho3.pro. + +##################################################################### +## testProcessEcho3 Binary: +##################################################################### + +qt_add_executable(testProcessEcho3 + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt index 8b7a8b3a51..f0905360f4 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessEcho3 OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEnvironment/.prev_CMakeLists.txt new file mode 100644 index 0000000000..63d7767b60 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessEnvironment.pro. + +##################################################################### +## testProcessEnvironment Binary: +##################################################################### + +qt_add_executable(testProcessEnvironment + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt index 63d7767b60..89c41b6446 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessEnvironment OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessHang/.prev_CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessHang/.prev_CMakeLists.txt new file mode 100644 index 0000000000..77e39937b0 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testProcessHang/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessHang.pro. + +##################################################################### +## testProcessHang Binary: +##################################################################### + +qt_add_executable(testProcessHang + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt index 77e39937b0..c3f4857225 100644 --- a/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt @@ -8,6 +8,6 @@ qt_add_executable(testProcessHang OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt index 8512c7545b..3c0033a01f 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt @@ -10,8 +10,8 @@ qt_add_executable(nospace main.cpp DEFINES QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) # special case begin @@ -21,8 +21,8 @@ qt_add_executable(onespace main.cpp DEFINES QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) set_target_properties(onespace PROPERTIES OUTPUT_NAME "one space") @@ -32,8 +32,8 @@ qt_add_executable(twospaces main.cpp DEFINES QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Gui + #PUBLIC_LIBRARIES # special case remove + #Qt::Gui # special case remove ) set_target_properties(twospaces PROPERTIES OUTPUT_NAME "two space s") # special case end diff --git a/tests/auto/corelib/kernel/CMakeLists.txt b/tests/auto/corelib/kernel/CMakeLists.txt index 154cc8e766..85d80e7a3d 100644 --- a/tests/auto/corelib/kernel/CMakeLists.txt +++ b/tests/auto/corelib/kernel/CMakeLists.txt @@ -10,19 +10,19 @@ add_subdirectory(qmetaobject) add_subdirectory(qmetaobjectbuilder) add_subdirectory(qmetamethod) add_subdirectory(qmetaproperty) -add_subdirectory(qmetatype) add_subdirectory(qmetaenum) add_subdirectory(qpointer) add_subdirectory(qsignalblocker) add_subdirectory(qsignalmapper) add_subdirectory(qtimer) add_subdirectory(qtranslator) -add_subdirectory(qvariant) if(TARGET Qt::Network) add_subdirectory(qeventloop) endif() if(TARGET Qt::Gui) + add_subdirectory(qmetatype) add_subdirectory(qmimedata) + add_subdirectory(qvariant) endif() if(TARGET Qt::Network AND NOT ANDROID AND NOT UIKIT) add_subdirectory(qobject) diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro index ba39070933..627407b0e4 100644 --- a/tests/auto/corelib/kernel/kernel.pro +++ b/tests/auto/corelib/kernel/kernel.pro @@ -28,7 +28,9 @@ SUBDIRS=\ qproperty !qtHaveModule(gui): SUBDIRS -= \ - qmimedata + qmimedata \ + qvariant \ + qmetatype !qtHaveModule(network): SUBDIRS -= \ qeventloop \ -- cgit v1.2.3