qt5base-lts/util/cmake
Alexandru Croitor a285bcba26 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 <simon.hausmann@qt.io>
2019-07-29 13:16:14 +00:00
..
tests Enable recursive expansion of simple qmake variables 2019-07-18 07:26:01 +00:00
cmakeconversionrate.py Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00
configurejson2cmake.py Fix mapping of features to private features 2019-07-22 08:29:33 +00:00
generate_module_map.sh Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00
helper.py Fix mapping of Apple platforms in pro2cmake.py 2019-07-23 10:31:15 +00:00
json_parser.py Improve configurejson2cmake.py to handle non-compliant qmake JSON 2019-05-27 07:48:51 +00:00
Pipfile CMake: pro2cmake.py: Simplify conditions 2019-01-29 09:29:38 +00:00
pro2cmake.py Ugly fix for handling QT_SOURCE_TREE 2019-07-29 13:16:14 +00:00
pro_conversion_rate.py Add script to print out list of unconverted .pro files 2019-04-08 14:53:46 +00:00
run_pro2cmake.py Improve run_pro2cmake.py 2019-06-05 07:41:46 +00:00
special_case_helper.py Improve special case handler to work on Windows 2019-06-11 14:09:54 +00:00