summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-10-04 11:10:56 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-10-04 11:10:57 (GMT)
commita7420884723c4fb09e6370fb25710a2172c10a0c (patch)
tree7d1d5cd434ca27e8b038457c784bf08af7f36c2f /Tests/QtAutogen
parentb3a0bddc4e1c8f1f86078cdffaebbc4c493e4409 (diff)
downloadCMake-a7420884723c4fb09e6370fb25710a2172c10a0c.zip
CMake-a7420884723c4fb09e6370fb25710a2172c10a0c.tar.gz
CMake-a7420884723c4fb09e6370fb25710a2172c10a0c.tar.bz2
Tests: Add support for testing Qt6
The minimum CMake version for Qt6 is 3.16, so all the calls to cmake_minimum_required() are updated here to enforce that minimum. This will avoid any CMake version-related warnings from Qt. Avoid hard-coding Qt5 where the tests could now be using Qt5 or Qt6. Fixes: #22188
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/AutogenCoreTest.cmake16
-rw-r--r--Tests/QtAutogen/AutogenGuiTest.cmake16
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Complex/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/Complex/codeeditor.cpp4
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/MacOsFW/CMakeLists.txt22
-rw-r--r--Tests/QtAutogen/MacOsFW/src/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/MacOsFW/test/CMakeLists.txt12
-rw-r--r--Tests/QtAutogen/ManySources/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocCMP0071/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/MocCMP0100/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/MocInclude/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/MocMacroName/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocOnly/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocOptions/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocOsMacros/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/MocSkipSource/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/ObjectLibrary/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel1/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel2/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel3/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel4/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/ParallelAUTO/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccEmpty/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt8
-rw-r--r--Tests/QtAutogen/RccOnly/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccSkipSource/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocBasic/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in2
-rw-r--r--Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt9
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunRccDepends/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in2
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/TestMacros.cmake11
-rw-r--r--Tests/QtAutogen/UicInclude/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/UicInterface/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/UicNoGui/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/UicOnly/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/UicSkipSource/CMakeLists.txt2
58 files changed, 119 insertions, 101 deletions
diff --git a/Tests/QtAutogen/AutogenCoreTest.cmake b/Tests/QtAutogen/AutogenCoreTest.cmake
index 5803859..e62a6aa 100644
--- a/Tests/QtAutogen/AutogenCoreTest.cmake
+++ b/Tests/QtAutogen/AutogenCoreTest.cmake
@@ -21,27 +21,27 @@ if (QT_TEST_VERSION EQUAL 4)
qt4_generate_moc(${ARGN})
endmacro()
-elseif(QT_TEST_VERSION EQUAL 5)
+elseif(QT_TEST_VERSION GREATER_EQUAL 5)
- find_package(Qt5Core REQUIRED)
+ find_package(Qt${QT_TEST_VERSION}Core REQUIRED)
- set(QT_QTCORE_TARGET Qt5::Core)
- set(QT_LIBRARIES Qt5::Core)
+ set(QT_QTCORE_TARGET Qt${QT_TEST_VERSION}::Core)
+ set(QT_LIBRARIES Qt${QT_TEST_VERSION}::Core)
# Include directories
- include_directories(${Qt5Core_INCLUDE_DIRS})
+ include_directories(${Qt${QT_TEST_VERSION}Core_INCLUDE_DIRS})
# Definitions
- if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
+ if(Qt${QT_TEST_VERSION}_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
endif()
# Qt macros
macro(qtx_wrap_cpp)
- qt5_wrap_cpp(${ARGN})
+ cmake_language(CALL qt${QT_TEST_VERSION}_wrap_cpp ${ARGN})
endmacro()
macro(qtx_generate_moc)
- qt5_generate_moc(${ARGN})
+ cmake_language(CALL qt${QT_TEST_VERSION}_generate_moc ${ARGN})
endmacro()
else()
diff --git a/Tests/QtAutogen/AutogenGuiTest.cmake b/Tests/QtAutogen/AutogenGuiTest.cmake
index b76d341..e5eb751 100644
--- a/Tests/QtAutogen/AutogenGuiTest.cmake
+++ b/Tests/QtAutogen/AutogenGuiTest.cmake
@@ -21,27 +21,27 @@ if (QT_TEST_VERSION EQUAL 4)
qt4_generate_moc(${ARGN})
endmacro()
-elseif(QT_TEST_VERSION EQUAL 5)
+elseif(QT_TEST_VERSION GREATER_EQUAL 5)
- find_package(Qt5Widgets REQUIRED)
+ find_package(Qt${QT_TEST_VERSION}Widgets REQUIRED)
- set(QT_QTCORE_TARGET Qt5::Core)
- set(QT_LIBRARIES Qt5::Widgets)
+ set(QT_QTCORE_TARGET Qt${QT_TEST_VERSION}::Core)
+ set(QT_LIBRARIES Qt${QT_TEST_VERSION}::Widgets)
# Include directories
- include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ include_directories(${Qt${QT_TEST_VERSION}Widgets_INCLUDE_DIRS})
# Definitions
- if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
+ if(Qt${QT_TEST_VERSION}_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
endif()
# Qt macros
macro(qtx_wrap_cpp)
- qt5_wrap_cpp(${ARGN})
+ cmake_language(CALL qt${QT_TEST_VERSION}_wrap_cpp ${ARGN})
endmacro()
macro(qtx_generate_moc)
- qt5_generate_moc(${ARGN})
+ cmake_language(CALL qt${QT_TEST_VERSION}_generate_moc ${ARGN})
endmacro()
else()
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
index 17855ff..cac680f 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.11)
+cmake_minimum_required(VERSION 3.16)
project(AutogenOriginDependsOff)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt
index 5aabe0e..37ce90b 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(AutogenOriginDependsOn)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt
index 492b5db..cf3f155 100644
--- a/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(AutogenTargetDepends)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/Complex/CMakeLists.txt b/Tests/QtAutogen/Complex/CMakeLists.txt
index d9fdf5c..8a9a5d2 100644
--- a/Tests/QtAutogen/Complex/CMakeLists.txt
+++ b/Tests/QtAutogen/Complex/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(Complex)
include("../AutogenGuiTest.cmake")
@@ -16,6 +16,8 @@ add_library(privateSlot OBJECT private_slot.cpp)
# Pass Qt compiler features to targets that don't link against Qt
target_compile_features(codeeditorLib PRIVATE ${QT_COMPILE_FEATURES})
target_compile_features(privateSlot PRIVATE ${QT_COMPILE_FEATURES})
+target_link_libraries(codeeditorLib PRIVATE ${QT_LIBRARIES})
+target_link_libraries(privateSlot PRIVATE ${QT_LIBRARIES})
configure_file(generated_resource.qrc.in generated_resource.qrc @ONLY)
add_custom_command(
diff --git a/Tests/QtAutogen/Complex/codeeditor.cpp b/Tests/QtAutogen/Complex/codeeditor.cpp
index 80d6a55..9c9dbc3 100644
--- a/Tests/QtAutogen/Complex/codeeditor.cpp
+++ b/Tests/QtAutogen/Complex/codeeditor.cpp
@@ -70,7 +70,11 @@ int CodeEditor::lineNumberAreaWidth()
++digits;
}
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
+ int space = 3 + fontMetrics().horizontalAdvance(QLatin1Char('9')) * digits;
+#else
int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits;
+#endif
return space;
}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
index e95c626..5c70e43 100644
--- a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
+++ b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.12)
+cmake_minimum_required(VERSION 3.16)
project(GlobalAutogenTarget)
include("../AutogenCoreTest.cmake")
@@ -74,6 +74,7 @@ execute_process(
-T "${CMAKE_GENERATOR_TOOLSET}"
"-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
WORKING_DIRECTORY "${GAT_BDIR}"
OUTPUT_VARIABLE output
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
index 3925197..0e3df6f 100644
--- a/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.12)
+cmake_minimum_required(VERSION 3.16)
project(GAT)
include("../../AutogenCoreTest.cmake")
@@ -9,7 +9,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
-# Disable ORIGN_DEPENDS and enable AUTOGEN global targets
+# Disable ORIGIN_DEPENDS and enable AUTOGEN global targets
set(CMAKE_AUTOGEN_ORIGIN_DEPENDS OFF)
set(CMAKE_GLOBAL_AUTOGEN_TARGET ON)
set(CMAKE_GLOBAL_AUTORCC_TARGET ON)
diff --git a/Tests/QtAutogen/MacOsFW/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/CMakeLists.txt
index c08efc4..27c5f43 100644
--- a/Tests/QtAutogen/MacOsFW/CMakeLists.txt
+++ b/Tests/QtAutogen/MacOsFW/CMakeLists.txt
@@ -1,21 +1,23 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MacOsFW)
include("../AutogenGuiTest.cmake")
-find_package(Qt5Test REQUIRED)
+find_package(Qt${QT_TEST_VERSION}Test REQUIRED)
+
+if(QT_TEST_VERSION EQUAL 5)
+ set(CMAKE_CXX_STANDARD 11)
+elseif(QT_TEST_VERSION EQUAL 6)
+ set(CMAKE_CXX_STANDARD 17)
+else()
+ message(FATAL_ERROR "Unsupported Qt version: ${QT_TEST_VERSION}")
+endif()
-set(CMAKE_CXX_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_BINARY_DIR}/output/lib)
-if(POLICY CMP0042) # in CMake 3.0.0+
- set (CMAKE_MACOSX_RPATH OFF) # otherwise ON by default
-endif(POLICY CMP0042)
-
-if(POLICY CMP0068) # in CMake 3.9+
- cmake_policy(SET CMP0068 NEW)
-endif(POLICY CMP0068)
+set (CMAKE_MACOSX_RPATH OFF) # otherwise ON by default
+cmake_policy(SET CMP0068 NEW)
add_subdirectory(src)
add_subdirectory(test)
diff --git a/Tests/QtAutogen/MacOsFW/src/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/src/CMakeLists.txt
index a02be00..67e2c8a 100644
--- a/Tests/QtAutogen/MacOsFW/src/CMakeLists.txt
+++ b/Tests/QtAutogen/MacOsFW/src/CMakeLists.txt
@@ -9,7 +9,7 @@ set(MACOS_FW_LIB_HDRS
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ${Qt5Core_INCLUDE_DIRS}
+ ${Qt${QT_TEST_VERSION}Core_INCLUDE_DIRS}
)
add_library(macos_fw_lib SHARED
@@ -28,6 +28,4 @@ set_target_properties(macos_fw_lib PROPERTIES
POSITION_INDEPENDENT_CODE ON
PUBLIC_HEADER "${MACOS_FW_LIB_HDRS}"
)
-target_link_libraries(macos_fw_lib
- Qt5::Core
-)
+target_link_libraries(macos_fw_lib PRIVATE ${QT_QTCORE_TARGET})
diff --git a/Tests/QtAutogen/MacOsFW/test/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/test/CMakeLists.txt
index 521c184..8cb1bc5 100644
--- a/Tests/QtAutogen/MacOsFW/test/CMakeLists.txt
+++ b/Tests/QtAutogen/MacOsFW/test/CMakeLists.txt
@@ -4,16 +4,16 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../src
)
include_directories(SYSTEM
- ${Qt5Core_INCLUDE_DIRS}
- ${Qt5Widgets_INCLUDE_DIRS}
+ ${Qt${QT_TEST_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_TEST_VERSION}Widgets_INCLUDE_DIRS}
)
set(testname AutomocMacosFWLib)
add_executable(${testname} testMacosFWLib.cpp)
set_target_properties(${testname} PROPERTIES AUTOMOC TRUE)
-target_link_libraries(${testname}
- Qt5::Core
- Qt5::Widgets
- Qt5::Test
+target_link_libraries(${testname} PRIVATE
+ Qt${QT_TEST_VERSION}::Core
+ Qt${QT_TEST_VERSION}::Widgets
+ Qt${QT_TEST_VERSION}::Test
macos_fw_lib
)
diff --git a/Tests/QtAutogen/ManySources/CMakeLists.txt b/Tests/QtAutogen/ManySources/CMakeLists.txt
index df8a2a6..f9ac7db 100644
--- a/Tests/QtAutogen/ManySources/CMakeLists.txt
+++ b/Tests/QtAutogen/ManySources/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(ManySources)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt
index 5c58a82..7ab3a8e 100644
--- a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocCMP0071)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt
index 954fe3d..4375b17 100644
--- a/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0071 NEW)
# *Generate* files
diff --git a/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt
index 68fa067..3771487 100644
--- a/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0071 OLD)
# *Generate* files
diff --git a/Tests/QtAutogen/MocCMP0100/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/CMakeLists.txt
index 559cffe..b19dc6a 100644
--- a/Tests/QtAutogen/MocCMP0100/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0100/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocCMP0100)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt
index 654b31e..aaaf7fb 100644
--- a/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0100 NEW)
add_executable(mocCMP0100New
diff --git a/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt
index 2be0535..006cda1 100644
--- a/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0100 OLD)
# Generate moc files externally.
diff --git a/Tests/QtAutogen/MocInclude/CMakeLists.txt b/Tests/QtAutogen/MocInclude/CMakeLists.txt
index 04c8baf..4224d2f 100644
--- a/Tests/QtAutogen/MocInclude/CMakeLists.txt
+++ b/Tests/QtAutogen/MocInclude/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
+cmake_minimum_required(VERSION 3.16)
project(MocInclude)
get_filename_component(CS_REAL ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
include("${CS_REAL}/../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
index 8b11b46..c28616b 100644
--- a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
+++ b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
+cmake_minimum_required(VERSION 3.16)
project(MocIncludeSymlink)
include("../AutogenCoreTest.cmake")
@@ -63,6 +63,7 @@ macro(buildMocInclude sourceDir binaryDir)
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOMOC_PATH_PREFIX=ON"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
diff --git a/Tests/QtAutogen/MocMacroName/CMakeLists.txt b/Tests/QtAutogen/MocMacroName/CMakeLists.txt
index bf13d18..d8dc4a3 100644
--- a/Tests/QtAutogen/MocMacroName/CMakeLists.txt
+++ b/Tests/QtAutogen/MocMacroName/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocMacroName)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt
index f4fde58..b5d405a 100644
--- a/Tests/QtAutogen/MocOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocOnly)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/MocOptions/CMakeLists.txt b/Tests/QtAutogen/MocOptions/CMakeLists.txt
index 19ee658..169e6cb 100644
--- a/Tests/QtAutogen/MocOptions/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOptions/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocOptions)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/MocOsMacros/CMakeLists.txt b/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
index b0125f6..db44da3 100644
--- a/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
@@ -1,10 +1,10 @@
-cmake_minimum_required(VERSION 3.11)
+cmake_minimum_required(VERSION 3.16)
project(MocOsMacros)
include("../AutogenCoreTest.cmake")
# Tests if moc processes Q_OS_XXX macros
-message( "Qt5Core_VERSION: ${Qt5Core_VERSION}" )
+message( "Qt${QT_TEST_VERSION}Core_VERSION: ${Qt${QT_TEST_VERSION}Core_VERSION}" )
message(
"CMAKE_CXX_COMPILER_PREDEFINES_COMMAND: "
${CMAKE_CXX_COMPILER_PREDEFINES_COMMAND} )
@@ -12,7 +12,7 @@ message(
# On some platforms (e.g. MAC) Q_OS_XXX requires moc to include moc_predefs.h
# which is supported since Qt 5.8 and requires
# CMAKE_CXX_COMPILER_PREDEFINES_COMMAND to be defined.
-if( ( ${Qt5Core_VERSION} VERSION_GREATER_EQUAL "5.8" ) AND
+if( ( ${Qt${QT_TEST_VERSION}Core_VERSION} VERSION_GREATER_EQUAL "5.8" ) AND
DEFINED CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
)
message( "Test enabled!" )
diff --git a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt
index c886736..b9e20c8 100644
--- a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt
+++ b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocSkipSource)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt
index e8af6c9..88d0998 100644
--- a/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt
+++ b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(ObjectLibrary)
include("../AutogenCoreTest.cmake")
@@ -11,7 +11,7 @@ add_subdirectory(a)
# Object library b defined locally
include_directories(b)
add_library(b OBJECT b/classb.cpp)
-target_compile_features(b PRIVATE ${QT_COMPILE_FEATURES})
+target_link_libraries(b PRIVATE ${QT_LIBRARIES})
# Executable with OBJECT library generator expressions
add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>)
diff --git a/Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt b/Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt
index fe76ac3..5ace3ae 100644
--- a/Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt
+++ b/Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt
@@ -1,2 +1,2 @@
add_library(a OBJECT classa.cpp)
-target_compile_features(a PRIVATE ${QT_COMPILE_FEATURES})
+target_link_libraries(a PRIVATE ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/Parallel/CMakeLists.txt b/Tests/QtAutogen/Parallel/CMakeLists.txt
index 299bcbf..29628eb 100644
--- a/Tests/QtAutogen/Parallel/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(Parallel)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/Parallel1/CMakeLists.txt b/Tests/QtAutogen/Parallel1/CMakeLists.txt
index 5c7d547..d94aba5 100644
--- a/Tests/QtAutogen/Parallel1/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel1/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(Parallel1)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/Parallel2/CMakeLists.txt b/Tests/QtAutogen/Parallel2/CMakeLists.txt
index 668aea4..58667a8 100644
--- a/Tests/QtAutogen/Parallel2/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel2/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(Parallel2)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/Parallel3/CMakeLists.txt b/Tests/QtAutogen/Parallel3/CMakeLists.txt
index 5c50f5e..cc3aae0 100644
--- a/Tests/QtAutogen/Parallel3/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel3/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(Parallel3)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/Parallel4/CMakeLists.txt b/Tests/QtAutogen/Parallel4/CMakeLists.txt
index 2c40c6a..2b81e98 100644
--- a/Tests/QtAutogen/Parallel4/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel4/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(Parallel4)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt b/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
index cddece3..5543b9a 100644
--- a/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
+++ b/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(ParallelAUTO)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/RccEmpty/CMakeLists.txt b/Tests/QtAutogen/RccEmpty/CMakeLists.txt
index a8e2af1..c8f9d17 100644
--- a/Tests/QtAutogen/RccEmpty/CMakeLists.txt
+++ b/Tests/QtAutogen/RccEmpty/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RccEmpty)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
index 61b9601..b44973d 100644
--- a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
+++ b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RccOffMocLibrary)
include("../AutogenCoreTest.cmake")
@@ -9,9 +9,7 @@ include("../AutogenCoreTest.cmake")
add_library(empty STATIC empty.cpp not_generated_file.qrc)
set_target_properties(empty PROPERTIES AUTORCC OFF)
set_target_properties(empty PROPERTIES AUTOMOC TRUE)
-target_link_libraries(empty no_link_language)
+target_link_libraries(empty PRIVATE no_link_language ${QT_LIBRARIES})
add_library(no_link_language STATIC empty.h)
set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE)
-# Pass Qt compiler features to targets that don't link against Qt
-target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES})
-target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES})
+target_link_libraries(no_link_language PRIVATE ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/RccOnly/CMakeLists.txt b/Tests/QtAutogen/RccOnly/CMakeLists.txt
index f3776f5..f3271e0 100644
--- a/Tests/QtAutogen/RccOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/RccOnly/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RccOnly)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt
index 4223274..a79177f 100644
--- a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt
+++ b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RccSkipSource)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
index c53e857..76dbdf5 100644
--- a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RerunMocBasic)
include("../AutogenCoreTest.cmake")
@@ -63,6 +63,7 @@ execute_process(
${_D_CMAKE_GENERATOR_INSTANCE}
"-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
RESULT_VARIABLE exit_code
OUTPUT_VARIABLE output
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
index 42f2f57..e27a824 100644
--- a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocBasic)
include("../../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
index 2677659..3a9244d 100644
--- a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
@@ -1,6 +1,6 @@
# This test checks whether adding a source file to the project triggers an AUTOMOC re-run.
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RerunMocOnAddFile)
include("../AutogenCoreTest.cmake")
@@ -64,6 +64,7 @@ try_compile(MOC_RERUN
MocOnAddFile
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
index 9e5e21c..e600137 100644
--- a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocOnAddFile)
include("@CMAKE_CURRENT_LIST_DIR@/../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt b/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt
index c5811eb..b17e4c5 100644
--- a/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt
@@ -1,6 +1,6 @@
# This test checks whether a missing dependency of the moc output triggers an AUTOMOC re-run.
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RerunMocOnMissingDependency)
include("../AutogenCoreTest.cmake")
@@ -13,10 +13,10 @@ add_executable(exe "${main_source}")
set(testProjectTemplateDir "${CMAKE_CURRENT_SOURCE_DIR}/MocOnMissingDependency")
set(testProjectSrc "${CMAKE_CURRENT_BINARY_DIR}/MocOnMissingDependency")
set(testProjectBinDir "${CMAKE_CURRENT_BINARY_DIR}/MocOnMissingDependency-build")
-if(DEFINED Qt5Core_VERSION AND Qt5Core_VERSION VERSION_GREATER_EQUAL "5.15.0")
- set(moc_depfiles_supported TRUE)
+if(DEFINED Qt${QT_TEST_VERSION}Core_VERSION AND Qt${QT_TEST_VERSION}Core_VERSION VERSION_GREATER_EQUAL "5.15.0")
+ set(moc_depfiles_supported TRUE)
else()
- set(moc_depfiles_supported FALSE)
+ set(moc_depfiles_supported FALSE)
endif()
# Utility macros
@@ -48,6 +48,7 @@ try_compile(MOC_RERUN
MocOnMissingDependency
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=ON"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
diff --git a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
index a7fb2d7..2d2edb4 100644
--- a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RerunMocPlugin)
include("../AutogenCoreTest.cmake")
@@ -63,6 +63,7 @@ try_compile(MOC_PLUGIN
MocPlugin
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt
index 5068289..8097fd0 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(MocPlugin)
include("../../AutogenGuiTest.cmake")
@@ -22,7 +22,7 @@ configure_file(jsonIn/StyleE.json jsonFiles/StyleE_Custom.json)
set(CMAKE_AUTOMOC TRUE)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/jsonFiles")
-link_libraries(Qt5::Widgets)
+link_libraries(Qt${QT_TEST_VERSION}::Widgets)
add_library(PlugA STATIC StyleA.cpp)
add_library(PlugB STATIC StyleB.cpp)
diff --git a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
index 33c01ac..1598bfd 100644
--- a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.11.2)
+cmake_minimum_required(VERSION 3.16)
project(RerunRccConfigChange)
include("../AutogenCoreTest.cmake")
@@ -33,6 +33,7 @@ try_compile(RCC_DEPENDS
RccConfigChange
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
index e2dd0ac..83f3a45 100644
--- a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.11.2)
+cmake_minimum_required(VERSION 3.16)
project(RccConfigChange)
include("../../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
index 1301550..15e38db 100644
--- a/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RerunRccDepends)
include("../AutogenCoreTest.cmake")
@@ -66,6 +66,7 @@ try_compile(RCC_DEPENDS
RccDepends
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
diff --git a/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
index 150f849..6bba163 100644
--- a/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(RccDepends)
include("../../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt b/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt
index 9b114e9..979e878 100644
--- a/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt
@@ -66,6 +66,7 @@ execute_process(
"${build_type_extra}"
"-DQT_TEST_VERSION=${QT_TEST_VERSION}"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
RESULT_VARIABLE exit_code
OUTPUT_VARIABLE output
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in
index c787db1..1775725 100644
--- a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in
+++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(UicOnFileChange)
include("@CMAKE_CURRENT_LIST_DIR@/../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
index f3536ba..25ea822 100644
--- a/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
+++ b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(StaticLibraryCycle)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/TestMacros.cmake b/Tests/QtAutogen/TestMacros.cmake
index 9dcf31f..529592e 100644
--- a/Tests/QtAutogen/TestMacros.cmake
+++ b/Tests/QtAutogen/TestMacros.cmake
@@ -7,8 +7,17 @@ else()
endif()
list(APPEND Autogen_BUILD_OPTIONS
"-DCMAKE_AUTOGEN_VERBOSE=1"
- "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
)
+if(Qt${QT_TEST_VERSION}Core_DIR)
+ get_filename_component(prefix "${Qt${QT_TEST_VERSION}Core_DIR}" DIRECTORY)
+ get_filename_component(prefix "${prefix}" DIRECTORY)
+ get_filename_component(prefix "${prefix}" DIRECTORY)
+ list(APPEND Autogen_BUILD_OPTIONS "-DCMAKE_PREFIX_PATH:STRING=${prefix}")
+else()
+ list(APPEND Autogen_BUILD_OPTIONS
+ "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+ )
+endif()
# XXX(xcode-per-cfg-src): Drop the NO_PER_CONFIG_SOURCES exclusion
# when the Xcode generator supports per-config sources.
if(CMAKE_GENERATOR STREQUAL "Xcode")
diff --git a/Tests/QtAutogen/UicInclude/CMakeLists.txt b/Tests/QtAutogen/UicInclude/CMakeLists.txt
index 929868b..042d18f 100644
--- a/Tests/QtAutogen/UicInclude/CMakeLists.txt
+++ b/Tests/QtAutogen/UicInclude/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(UicInclude)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/UicInterface/CMakeLists.txt b/Tests/QtAutogen/UicInterface/CMakeLists.txt
index e022764..167ae49 100644
--- a/Tests/QtAutogen/UicInterface/CMakeLists.txt
+++ b/Tests/QtAutogen/UicInterface/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(UicInterface)
include("../AutogenGuiTest.cmake")
@@ -11,12 +11,12 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
add_library(KI18n klocalizedstring.cpp)
-target_link_libraries(KI18n ${QT_QTCORE_TARGET})
+target_link_libraries(KI18n PRIVATE ${QT_QTCORE_TARGET})
set(autouic_options
-tr tr2$<$<NOT:$<BOOL:$<TARGET_PROPERTY:NO_KUIT_SEMANTIC>>>:x>i18n
)
-if (NOT Qt5Widgets_VERSION VERSION_LESS 5.3.0)
+if (NOT Qt${QT_TEST_VERSION}Widgets_VERSION VERSION_LESS 5.3.0)
list(APPEND autouic_options -include klocalizedstring.h)
endif()
diff --git a/Tests/QtAutogen/UicNoGui/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/CMakeLists.txt
index 076299d..b938a17 100644
--- a/Tests/QtAutogen/UicNoGui/CMakeLists.txt
+++ b/Tests/QtAutogen/UicNoGui/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.13)
+cmake_minimum_required(VERSION 3.16)
project(UicNoGui)
include("../AutogenCoreTest.cmake")
diff --git a/Tests/QtAutogen/UicOnly/CMakeLists.txt b/Tests/QtAutogen/UicOnly/CMakeLists.txt
index b163254..e25b44d 100644
--- a/Tests/QtAutogen/UicOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/UicOnly/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(UicOnly)
include("../AutogenGuiTest.cmake")
diff --git a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt
index dc3b7d4e..15dfe65 100644
--- a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt
+++ b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16)
project(UicSkipSource)
include("../AutogenGuiTest.cmake")