From a285bcba26498f3a03da3891a253213e05dba621 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 26 Jul 2019 18:59:53 +0200 Subject: Ugly fix for handling QT_SOURCE_TREE QT_SOURCE_TREE is a variable that is set in qtbase/.qmake.conf. In qtbase, it's used throughout various projects to find cpp sources when building standalone tests (among other things). Everything works fine with qmake, because even if qmake is invoked on the tests subfolder, qmake searches up the source directory tree until it finds a .qmake.conf file, and uses that. When building qttools with qmake, the qdoc project expects to have a QT_SOURCE_TREE value, but it's not actually set in the qttools/.qmake.conf file, so the generated include paths that use that value are incorrect. Curiously the build still succeeds. Now in CMake land we replaced QT_SOURCE_TREE with CMAKE_SOURCE_DIR, but that does not work properly when doing a standalone tests build, because the project in that case is the tests one, and not the qtbase one, so configuration fails in a developer build when trying to configure some private tests. So far I've found that only qtbase actively uses this value. A temporary fix is to save the qtbase source directory into a QT_SOURCE_TREE variable inside the generated BuildInternalsExtra.cmake file. The pro2cmake script is changed to handle presence of QT_SOURCE_TREE in a qrc file path. This is handled by finding the location of a .qmake.conf file starting from the project file absolute path. This is needed to stop the script from crashing when handling the mimedatabase test projects for example. The change also regenerates the relevant failing test projects, and thus standalone tests (when doing developer builds aka private_tests enabled) now configure and build successfully. Change-Id: I15adc6f4ab6e3056c43ed850196204e2229c4d98 Reviewed-by: Simon Hausmann --- tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/network/socket/qhttpsocketengine') diff --git a/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt b/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt index 6e88b5ecee..7d6193ee54 100644 --- a/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt +++ b/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt @@ -9,7 +9,7 @@ add_qt_test(tst_qhttpsocketengine SOURCES tst_qhttpsocketengine.cpp INCLUDE_DIRECTORIES - ${PROJECT_SOURCE_DIR}/src/network + ${QT_SOURCE_TREE}/src/network LIBRARIES Qt::CorePrivate Qt::NetworkPrivate @@ -35,7 +35,7 @@ extend_target(tst_qhttpsocketengine CONDITION WIN32 extend_target(tst_qhttpsocketengine CONDITION QT_FEATURE_reduce_exports AND UNIX SOURCES - ${PROJECT_SOURCE_DIR}/src/network/socket/qabstractsocketengine.cpp - ${PROJECT_SOURCE_DIR}/src/network/socket/qnativesocketengine.cpp - ${PROJECT_SOURCE_DIR}/src/network/socket/qnativesocketengine_unix.cpp + ${QT_SOURCE_TREE}/src/network/socket/qabstractsocketengine.cpp + ${QT_SOURCE_TREE}/src/network/socket/qnativesocketengine.cpp + ${QT_SOURCE_TREE}/src/network/socket/qnativesocketengine_unix.cpp ) -- cgit v1.2.3