Commit Graph

513 Commits

Author SHA1 Message Date
Alexandru Croitor
3215f5457a Handle top level tests, examples and main qmake projects in pro2cmake
The script now detects whether the project file given is a:
- top level qmake project (qtdeclarative.pro)
- top level tests project (qtdeclarative/tests.pro)
- top level examples project (qtdeclarative/examples.pro)

This is done by finding the .qmake.conf file in parent directories of
the given project, and comparing the project's location to the
.qmake.conf location.

For the top level qmake project and the tests project, the script will
now use a predefined block of code that we usually had to copy paste and
change manually. Now only small bits will have to be adjusted manually
(project name and dependencies).

For the examples project, the content is surrounded by the required
build examples commands.

As a result, developers will have to worry less about knowing where to
copy paste from.

Change-Id: I4f751b371e74eeb86e070d58635c3d99b970ab18
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-09 19:20:38 +00:00
Ville Voutilainen
b2a11daaa1 cmake: Enable building of the oci plugin
Change-Id: I003d6da10c7e47402fb373d3956817817328cf0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-05 08:24:07 +00:00
Ville Voutilainen
95c9c5a308 cmake: Enable building of the db2 plugin
Change-Id: I26810cccba5f3128cb47e0bf53b5ec78de2eec8c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-04 09:50:15 +00:00
Ville Voutilainen
3ff31ed020 Enable building of the mysql plugin
Change-Id: I8cb97afaaed46ee64b5a133e797179d7ddecdeef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-02 15:16:42 +00:00
Simon Hausmann
8da5305102 Fix Harfbuzz detection
We use

    qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz)

which would set harfbuzz_FOUND. Since variable names are case-sensitive,
this is also the name we must check for in the qt feature condition.

Change-Id: I43420489c3310bc9c3e5cc798a005c8d5b0ab646
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-30 13:21:32 +00:00
Maurice Kalinowski
e5bf0290d9 Add Qt Mqtt to the library mapping
Change-Id: Ifa50161a579647002d3349b49da7012660c59f81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-28 15:51:44 +00:00
Alexandru Croitor
0798ed8a83 Fix subdir handling in pro2cmake
Conditions scopes that had "else" were not handled properly.
The "else" condition should be expanded to its proper negative full
form.

Also every condition "piece" should be wrapped with parentheses before
being passed to sympy simplification, to be sure that boolean
operator precedence is applied properly.

Refactored the code a bit to make it easier to read.

Change-Id: I4726845b867f93c3afbc9362cdce1cd063ccff63
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:15:59 +00:00
Alexandru Croitor
c3ef1a012b Fix handling of more functions in handle_function_value
Essentially pass them through without failing the whole
conversion process.

Change-Id: I7bbd198203f79b45120a7254e2ecdf58e32f9525
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:15:44 +00:00
Alexandru Croitor
5c75f6a21a Fix some corner cases of condition mapping in pro2cmake
no-png is an old unused scope that should be mapped to the png
feature instead.

Map contains(QT_CONFIG, shared) to correct variable check.

Sympy doesn't like dashes in indentifiers, so replace all of them
with a _dash_ token which will be replaced again at the end
of the condition simplifying.

When doing sympy preprocessing, fix mapping of target names that
don't contain double colons.

Change-Id: Id3d37800665c96505b7cbb1d80fdbed59c3ae9c0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:15:32 +00:00
Alexandru Croitor
3416a83f05 Augment conversion scripts with requirements for qttools part 2
Designer components target names need to be prefixed with Qt.

Change-Id: I13037820b080d88cd670f2db97232509eb868daf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:15:24 +00:00
Alexandru Croitor
5a5dc6294b Augment conversion scripts with requirements for qttools
The libclang test is implemented as a custom FindWrapLibClang module.
The module does mostly the same things as the configure test in qmake
land.

Change-Id: I965f284baf7daef074e22f033047c35a917c8808
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:15:14 +00:00
Leander Beernaert
060784c981 Remove ../ from Targets
Remove repeating '../' pattern from target names, since we generate
the targets in the correct location with CMake.

Change-Id: I89d527a9ad717f742f8d0e5921f378e6ac0a229d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-26 10:39:40 +00:00
Leander Beernaert
103d1aa910 Use GLOB_RECURSE for testdata
Use GLOB_RECURSE for testdata instead of globbing the top level folder.
Although RCC supports scanning directories, it will result in alias
collosions and test not being able to find the files on platforms
where test data is embedded into the binary.

Change-Id: I35d3d46a5d9fcafa5c8dc833eafdd0044ffe355f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-26 08:20:14 +00:00
Leander Beernaert
bf298499a0 Update public CMake macros' version
Update all public Qt macros to use qt6/QT6 instead of qt5/QT6.

Change-Id: Ib178f4fa21f37dfb8da7d4d8c097aa0e96c9d9f9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-23 10:04:30 +00:00
Alexandru Croitor
60ceb1b0c5 Handle contains(CONFIG, static) in pro2cmake
Change-Id: I36717688dd3b2ff0f6730bf3d65be421e391895f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2019-08-23 09:26:42 +00:00
Alexandru Croitor
54aeb4ccd7 Add support for Qt header_modules aka a header only INTERFACE library
Also add support for modules that have no private module counterpart.

Both are needed for Designer's QtUiPlugin in qttools.

Change-Id: Ia7e9d8837140e1de5cd59e196b4f63481ab68298
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-23 09:26:16 +00:00
Alexandru Croitor
02074bf345 Fix more uses of functions in handle_function_value
Change-Id: Ie6b6f79b50e9eaf605427f19a8c2ca86050e2f74
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2019-08-23 09:26:07 +00:00
Leander Beernaert
f96faa95aa Update pro2cmake example generation to use QT5_ADD_RESOURCES
Update pro2cmake to generate CMake projects where resources are handled
via the QT5_ADD_RESOURCES command.

Change-Id: I66dc2174a45fc652fd8c9b7e3c0f46f58ae02c0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-23 07:52:19 +00:00
Leander Beernaert
3a105b9d11 Extend run_pro2cmake.py to pass --is-example to pro2cmake
Add command line argument to make run_pro2cmake invoke pro2cmake with
the --is-example option so we can convert examples in bulk.

Change-Id: I162eddffc509f16a97de5517698e8daca5207b74
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-23 07:06:48 +00:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Alexandru Croitor
b8dae2c617 Handle test helpers better
Teach pro2cmake to use add_qt_test_helper instead of
add_qt_executable when the qmake 'qt_test_helper' feature is used.

Don't use macOS bundles when building tests on macOS, because that
breaks path assumptions for certain tests.

Introduce a new OVERRIDE_OUTPUT_DIRECTORY option for add_qt_test_helper
that allows placing the binary into a folder other than the test parent
folder. I considered changing the default behavior not to place into the
parent folder, but that would break all existing tests, so I opted for
override approach instead. Ultimately we might want to revisit this
later.



Change-Id: I68fd1dea608333c2af0d3896050b40a6964dd87f
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-15 10:56:02 +00:00
Leander Beernaert
7fda42ef9a Rename alias property on source files to QT_RESOURCE_ALIAS
Rename the alias property used by add_qt_resource() to QT_RESOURCE_ALIAS
to match property naming conventions.

Change-Id: I97b12b0b794e158f03dabeed5ec23a3b7d56cfbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-15 09:34:09 +00:00
Leander Beernaert
8630c5ac7e Add support for QtQuikCompiler retained resources
Support translating the QTQUICK_COMPILER_RETAINED_RESOURCES variable.

Fix missing PROPERTIES keyword for set_source_files_properties() commands.

Apply source file properties to standalone source files as they appear
in the project as it was possible for them to inherit values that were
not meant for them.

When creating resource lists, prefix them with the resource name
to avoid collisions.

Change-Id: I69ef85ea9414c0e7c07b1ebfb76d24bd878ce70f
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-14 12:45:11 +00:00
Alexandru Croitor
87078650a5 Wrap resource file paths in quotes
This is required for paths that contain spaces, otherwise the .qrc
file generated by the build system is invalid, and the RCC run fails
at build time.

Change-Id: I887100b08052b49dd7ea4dd92b94f357a7d9d16e
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-12 12:41:14 +00:00
Leander Beernaert
e614e837fa Add QT_QML_DEBUG define conversion
Add QT_QML_DEBUG to target when we have qml_debug in qmake's CONFIG
variable.

Change-Id: I266c7313db12667498d4f770c73aec9e79c0b50e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-12 11:42:00 +00:00
Simon Hausmann
1720970102 Fix resource prefix calculation
tools/qml/qml.qrc uses prefix="something", which means that the leading
slash is implied.

Change-Id: Ia856fcef36873442a84b9162f1901cb31ca37b49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-09 15:56:57 +00:00
Leander Beernaert
3549f51c98 Fix cases where DESTDIR equals ./ or ../
When DESTDIR has relative paths as a parameter we should prefix those
with ${CMAKE_CURRENT_BINARY_DIR} in order for them to be placed in
the correct location.

Change-Id: Ie9e9d656cbb54457bdf99425e3e1b05e09f20d7c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-09 14:12:49 +00:00
Simon Hausmann
1fc117e29d Add support for immediate resources
Collect files passed to RESOURCES and write out an add_qt_resources()
call. Similarly, for each "object" passed to RESOURCES (not a file),
write add_qt_resources(), too.

Change-Id: Idbb368ebb4d003a48e7c47ebaf53a78f65ebf9b9
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-09 12:28:24 +00:00
Simon Hausmann
95c27e325f Fix add_qt_resource behavior with regards to unspecified prefixes
This change makes the PREFIX parameter a required parameter if the
target does not specify a default. This way the behavior is clear when
reading the code: add_qt_resource() without PREFIX means it must come
frmo the target.

Change-Id: I79024e70e7b4d32a5164b93aa08ec9ff409b2d39
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2019-08-09 11:50:11 +00:00
Simon Hausmann
73ba2ba2de Simplify resource embedding for qml modules
* Add support for a QT_RESOURCE_PREFIX target property, that
      add_qt_resource respects. This makes it convenient to add files
      to the resource system for a project without the need to repeat
      prefixes. In qmake land with multiple resources they're repeated
      in the foo.prefix variables or in the prefix attribute in .qrc
      files.

    * Since /qt-project.org/imports is in the default QML import search path
       and the hierarchy under the import search paths is "regulated",
       we might as well make add_qml_module set QT_RESOURCE_PREFIX on
       the target. We can compute the correct value for that. This
       allows removing the redundant prefix from the add_qt_resource()
       calls for the qml files.

Change-Id: Ic15130dc9e432340fc3edf93e35f2a803b4b40eb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-09 11:47:25 +00:00
Simon Hausmann
8ba882a0b3 Add support for QTQUICK_COMPILER_SKIPPED_RESOURCES
Detect this in the conversion script and map it to a source file
property. When that's the case, avoid repeating the file list but
instead store it in a variable.

Change-Id: If3119d83914bb798766e27351746b4e867bd3ab3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-09 09:21:12 +00:00
Leander Beernaert
5424c72ab6 Extend handling of special condtions
Extend the hanlding of special condtions outside single line statements.
Conditions such as 'qtHaveModule(gui):qtConfig(opengl(es1|es2)?)' would
not be handled properly.

Change-Id: I992f75311b82d84c574c9cb4ef6d7d648f425d81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-08 13:11:00 +00:00
Leander Beernaert
5d7bb2e4f0 Add support for converting qtTargetLibrary() value assignments
Add support to pro2cmake to handle variable assignments via functions,
e.g: TARGET = $$qtTargetLibrary($$TARGET). The evalulation of the
functions happens during parsing and is very rudementary in nature.

Currently it only covers the qtTargetLibrary(), required for certain
projects, and quote(), required for passing unit tests.

If we run into any unhanlded function an exception will be thrown.

This patch also changes the TARGET property on Scope to expand the
value.

Change-Id: I678b7058067348a3972944bdba110f556cf22447
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-08 13:03:28 +00:00
Leander Beernaert
6396840182 Fix conversion of SUBDIR pro files not in current directory
This patch fixes the processing of pro files that do not reside in
the current directory. Before this patch statements such as SUBDIRS +=
Foo/Bar/z.pro would cause z.pro to be parsed in the current
CMakeLists.txt. What we want instead is a call to
add_subdirectory(Foo/Bar). Failing to do so leads to issues with
relative paths specified in z.pro being invalid.

Change-Id: I7bfa7837d54877e5340081d1c9aebe855cf6796d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-08 08:07:11 +00:00
Leander Beernaert
d8a7c0f40f Handle DESTDIR override
Set OUTPUT_DIRECTORY on a target when DESTDIR is specified.

Change-Id: I72061ae8156356fcb2aa9ba6cb87049fcef600c7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-07 13:47:51 +00:00
Leander Beernaert
f9db9a22e9 Handle qmake's CONFIG=plugin
In some tests in qtdeclarative we have projects that are built
as a lib with CONFIG=plugin. Without these changes they would be
translated to an add_qt_module call.

Change-Id: I208d31d43b087ed0b87eb4715f6c49b218fcc2c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-07 12:34:59 +00:00
Alexandru Croitor
b4ef975a0a Handle conditions for SUBDIRS *more* correctly
There are project files that not only do SUBDIRS -= foo depending on
some condition, but also SUBDIRS += foo. To handle these cases
correctly we need to do a whole pass across all scopes and collect
all addition and subtraction conditions.

Once we have that information, we can compute a final condition for a
particular subdirectory. After we have the condition information for
all subdirectories, we can simplify all those conditions using SimPy,
and group all subdirectories that have the same simplified condition.

Finally we print out the subdirectories grouped by the simplified
condition.

The end result is similar to how we have extend_target() calls with
multiple sources grouped into a single conditional call, except in
this case it's subdirectories.

Amends b26b1455d7.

Change-Id: I5b648ac67264ba9a940561baee5b49c43c13b721
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-07 11:55:28 +00:00
Leander Beernaert
9ca1d79539 Fix regular expression for add_qml_module
Values such as Foo.2 would no longer be converted into Foo due to an
error in the regular expression.

Change-Id: I6a11d02662782094f5b264f86a930d9aaf002c77
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-06 13:27:20 +00:00
Leander Beernaert
d943252741 Fix shared resource paths in tests
Resources shared by tests were incorrectly setup. Resources would
always be registered with BASE/filename as alias. In these cases the
fix is to set the alias with the original file name.

Change-Id: I667ce7b74ae5f86740c8bb8a040cc2895a3dc116
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-06 13:17:17 +00:00
Leander Beernaert
709538096c Fix add_qml_module URI
Make sure the URI name for qml modules correctly strips out the version
number for instances such as QtQuick.Controls.2.

Change-Id: I18e706b371323eeefdd6d7564b922265fa5cad3f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-06 13:10:22 +00:00
Leander Beernaert
a3e149d92a Fix qml plugin conversion: always install qml files
Always install qml files regardless of whether the install_qml_files
configuration is present in qmake. This was causing most unit tests to
fail due to missing qml files.

Change-Id: I53c7200cfa66805d0e459190ef105c1a73c34a5f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-06 10:29:28 +00:00
Leander Beernaert
5d88ba001e Fix $$_PRO_FILE_PWD substitution
PRO_FILE_PWD should return CMAKE_CURRENT_SOURCE dir without any
compenstation for mistmatching directory locations as we are doing with
PWD.

There are test that use a shared .pri project file which gets included
into the .pro file of test. In this .pri file we have a statement such
as DEFINES += QT_QMLTEST_DATADIR=\\\"$${_PRO_FILE_PWD_}/data\\\".
Since the .pri project file is located in ../../shared/shared.pri the
substitution would result in
${CMAKE_CURRENT_SOURCE_DIR}/../../shared/data instead of the expected
${CMAKE_CURRENT_SOURCE_DIR}/data.

Change-Id: Id899d6a624acc45425af47ca9aa1b332cf63e659
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-05 12:58:10 +00:00
Alexandru Croitor
e2ab42c2aa Implement condition simplification for add_subdirectory conditions
This makes the SUBDIRS -= foo conditions simplified and nice to look
at.

Amends b26b1455d7.

Change-Id: I9ffe3db1e358f94fb65a885cc90c44218482825b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-01 18:33:16 +00:00
Alexandru Croitor
67bbb9179f Fix pro2cmake to handle QT default values properly
Setting the "QT" SetOperation which defaults to "core" and "gui",
should only be done once on the top-level .pro scope. To distinguish
the top level scope, we need to check for both an empty parent_scope
and an empty base_dir.

Amends 9e96c38426

Change-Id: I9db1cbf0e6592c8c195d11b97b3eff40b1adbcbd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-01 14:50:17 +00:00
Alexandru Croitor
cb370593df Small fix to correctly handle default arguments
Dictionaries are mutable, and should not be assigned as a default
parameter.

Change-Id: Id08c17f89c17b404560241849603e1e1a0ec6562
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-01 14:50:07 +00:00
Leander Beernaert
97b76704ea Refactor QML_FILES for add_qml_module
It has been decided, that going forward all qml files are to be added
to a module via the resource system. This patch does the ground work
to make sure all qml modules in the qt codebase follow these new
conventions.

New properties on targets have been added so that we can't track all the
qml related information for later use.

To make sure it is still possible to install qml files we added the
qt_install_qml_files() command.

Pro2cmake has been adjusted to handle the special cases of versioned
qml modules (e.g: QtQuick.2). It will now insert a TARGET_PATH
override to avoid the default conversion from the URI parameter.

Finally, this patch temporarliy disables the quick compiler by moving
all relevant code into a dummy function. This will be removed in a
follow up patch where the quick compiler will be enable for all
qml files present in resource files.

Change-Id: I09fe4517fad26ec96122d9c7c777dbfbd214905c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-01 14:07:01 +00:00
Jędrzej Nowacki
9e96c38426 Properly convert default QT directive
If unset QT by default has value: "core gui". This patch adds this
behavior by pre-defining the value in the root scope.

qmimedata CMakeList.txt was re-generated.

Change-Id: Ib8b6064bc46c72d829e0077d09f21bbfb494e137
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-08-01 13:38:21 +00:00
Jędrzej Nowacki
b26b1455d7 Implement SUBDIR-= conversion in pro2cmake tool
CMake doesn't support removing subdirectories therefore one need to
convert all removal to conditional adds. The resulting code doesn't
win a beauty contest. That is because handle_subdir works on already
processed strings which means it doesn't have access to the boolean
operations. As such it can not minimize the expressions, but it works
and in the most simple cases it is pretty good.

The patch re-generates CMakeLists.txt under tests/auto/corelib/kernel
excluding qcoreapplication, qmetatype, qmimedata, qobject, qtimer,
which are suffering from unrelated problems, like for example Gui,
pthread linkage issues.

Change-Id: I18a02f6eda7a3b41b1313211c8bc9ce277bb67be
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-01 13:36:39 +00:00
Leander Beernaert
a920c16ef2 Add Qt Quick Compiler support
This patch adds support for the qtquick compiler feature, which
will embed the compiled qml files as resources along with the
respective qml_loader.

This patch also changes the add_qml_module call to require either
EMBED_QML_FILES and/or INSTALL_QML_FILES to be specified.

Change-Id: I32d29c9b554b8286ed3b980027a56dd4abe11c92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-31 12:52:20 +00:00
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