Commit Graph

216 Commits

Author SHA1 Message Date
Mårten Nordheim
ef9cef6dff Add a find_library entry for the GameController framework
Needed for QtGamepad

Change-Id: I50227949eb509c021ba8d9b4dbe2b36b6a6de87f
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-01 12:50:04 +00:00
Alexandru Croitor
34b1c1c23c Fix qt_find_package to not show incorrect packages at features summary
qt_find_package usually does 2 find_package() calls, one in CONFIG
mode and one in MODULE mode.

If the CONFIG mode doesn't find a Config file, the package_DIR cache
variable is set to NOTFOUND, and this causes the FeatureSummary
at the end to show that the package was not found, even if it is
found by the next MODULE mode find_package call.

Make sure to unset the _DIR variable in case if the Config module
call fails.

This fixes XRender showing up as not found even when it's found via
the FindXRender.cmake file.

Change-Id: I6ce39dad9cbb11836ca71f735a3267070c75b444
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Qt CMake Build Bot
2019-09-27 14:28:04 +00:00
Joerg Bornemann
deeddf2cb1 cmake: Fix QT_TOOL_PATH_SETUP_COMMAND
The set command looked like this:
    set \"PATH=...\"
which was setting the environment variable \"PATH.

Removing the escaped double quotes makes it actually work.

Change-Id: I2c1d5d01b4415220512b005b75b7b67c695e33ae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-26 12:22:13 +00:00
Leander Beernaert
6e2ca1d6cb Add SKIP_TYPE_REGISTRATION option to add_qml_module
If the qml files are not listed in the qmldir file they do not need
to be written again, since it is expected that they are registered
by the c++ plugin code.

Change-Id: I624aedb182583f942bf1d1a322861c47a64b5065
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-24 12:54:57 +00:00
Tor Arne Vestbø
2cc3720a57 macOS: Prevent warnings about object files without any symbols
Change-Id: I0860b95cd75f536ff20defde97c3df7dc78a1e18
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-24 07:27:58 +00:00
Alexandru Croitor
80d86fed13 Fix qtdeclarative build
There is an issue about versionless tool target not finding
the regular targets, and that fails the configuration phase
of qtdeclarative.

Temporarily don't export the versionless targets, to get the
qt5 build going.

Change-Id: I5c7baff7f677f4a3f1f91b9e8082ba8a80f9cddd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-23 11:22:01 +00:00
Alexandru Croitor
fbddf745e9 Create module tools packages (config files) automatically
Previously you had to make sure to use DISABLE_TOOLS_EXPORT
in an add_qt_module call if the tools are built after the module,
as well as to manually call qt_export_tools after all associated
tools are built.

This was needlessly complex, especially for people that are porting
a repo with tools for the first time.

The tools package creation is now automatically done at QtPostProcess
step, so there is no need to use either DISABLE_TOOLS_EXPORT or
qt_export_tools() manually.

DISABLE_TOOLS_EXPORT is now a no-op, and will be removed once all repos
are updated not to use it.

Change-Id: I965b0d3a8a0cb908afae87b047083ed7bea9f02f
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-22 10:29:28 +00:00
Mårten Nordheim
25c53ce00e PCH: Only enable automatically for libraries/modules
Some tests are changing headers using defines inside the tests.
Let's more closely mirror what qmake does to fix this. And it will also
save quite a lot of space since most tests don't include all of
e.g. QtCore

Change-Id: I6f7e530f922418944d690bd2a1ee5f459ba755e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-19 17:33:20 +00:00
Leander Beernaert
d03d12a74f Add Qml plugin example support
Extend the example writing section to handle qml plugins. Detection
is based on whether the plugin config is detected an the target links
against Qml.

add_qt_qml_module() now uses the the public facing API underneath.

Change-Id: I2ccd06548e7b5b18c9dc3338b835bc115fa97809
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-19 08:06:08 +00:00
Cristián Maureira-Fredes
3ba61c0354 Check if Qt source dir is not empty to use syncqt
In an extreme case where /bin/syncqt.pl does exists,
is better to check if the QtBase_SOURCE_DIR is not empty
to avoid a mismatch script version that is being used.

Change-Id: Ia5694eadc5517998b827eccf70bdf6f3c14ebfa3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-18 15:26:26 +00:00
Leander Beernaert
1496a88429 Fix QtDeclcarative static builds
Incorrect variable name was being used to set the target in the parent
scope.

Change-Id: I73ea644ebf94c9b9a62b34b1ad493e488729ff2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-18 14:28:29 +00:00
Simon Hausmann
cb5fbbde27 Fix up documentation integration placeholder
In the future need will need to continue to tie qdoc runs still to
targets, just like with qmake. This change prepares us for that by
ensuring that add_docs takes two parameters and that any re-generated
CMakeLists.txt from now on gets it right.

Change-Id: Id0256dc1e2f2f59f3b4e4ca98f0d10d025d189fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-18 09:45:12 +00:00
Mårten Nordheim
89e347ba42 Fix for getting windows running tests
By adding the path to the DLLs early on in the path. This fixes the
issue seen in CI (0xc0000135, DLL not found) and resolves local issues
where you might have forgotten to add this to path yourself potentially
grabbing libraries from elsewhere.

The ${path} seems to be a holdover that is no longer used, so it was
removed while the code was changed anyway.

Also disable WIN32_EXECUTABLE for all tests so that we can actually get
some output from them :)

Change-Id: Iec42c809c37be4f31c7f0a7af3a30c3528022dbe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-17 17:11:59 +00:00
Jüri Valdmann
933d383a24 pro2cmake: Support QML IMPORTPATH with multiple elements
Change-Id: I8113d7dd4e7967d020d59a5b4104e8366d55283c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-17 10:39:34 +00:00
Alexandru Croitor
6bfe16922a Teach automoc to run moc when it sees Q_ENUM_NS
Needed for qtcoap, otherwise AUTOMOC doesn't run moc
on qcoapnamespace.h.

Change-Id: I4ca43fcbbc5db6163f9f9f788b920eae86f5b174
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-17 08:49:56 +00:00
Simon Hausmann
0f312d3c02 Prospective fix for QtGui private symbol versioning
In qmake, the header files used for private symbol versioning is done
via

    private_api_headers = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.QPA_HEADER_FILES

So we must do the same with CMake.

Change-Id: Iaebeb13592241b6c4d89f70d2e6ac3ebfb374207
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-09-17 08:06:28 +00:00
Leander Beernaert
21dd3624a5 Fix OUTPUT_TARGET propagation in qt6_add_resource()
Value was not being propagated to the parent scope when set.

This patch also changes OUTPUT_TARGET to OUTPUT_TARGETS since it is
possible that two targets can be generated.

Change-Id: If489a609ed363a319224fcd6c5a4fc878d0d8617
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-16 11:41:48 +00:00
Mårten Nordheim
5884f793b9 Don't set the MODULE_HEADER property on header-only modules
They're INTERFACE-type targets and can thus only have whitelisted
properties set. That fixes the cmake configure step for the UiPlugin
target in qttools.

This has the unfortunate side-effect that the headers will not be picked
up for our pre-compiled headers. Although it is not a big issue since we
don't have many header-only modules. An example is QtTools' UiPlugin.

Amends 2cf0ba1fba

Change-Id: If722928f64727ffaf2e9d0746668c0198fa1a647
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-13 11:19:46 +00:00
Mårten Nordheim
2cf0ba1fba Use pre-compiled headers when building Qt with cmake
Some modules define their own manually-maintained lists, and we can rely
on the headers generated by each module to include in the pch as well
e.g. QtCore/QtCore.

There's also e.g. QtWidgetDepends for QtWidgets, but this only
works for modules, not for tools, examples or other applications.
For now we'll use the Qt<Module>/Qt<Module> headers for the
modules we depend on.

Building with PCH can be disabled with -DBUILD_WITH_PCH=NO, and it only
works for versions of CMake newer than 3.15.20190829.

Change-Id: Iae52bd69acfdfd58f4cd20d3cfa3c7f42775f732
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-11 08:25:54 +00:00
Alexandru Croitor
6720f0204f Don't propagate INSTALL_INTERFACE headers for modules with no syncqt
If syncqt was not executed for a module, it will not have generated
headers, so we should not propagate the include/${module} header
location in that case.

Change-Id: I6dc0628a11ababb4d237215a9f4d3fc331383848
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-10 14:19:35 +00:00
Simon Hausmann
bc54f0b164 Fix build of installed header-only modules in non-prefix builds
QtUiTools in qttools is a public module that has only headers, so it's
an interface library in cmake. That means INTERFACE_INCLUDE_DIRECTORIES
cannot contain paths to the source or build directory, unless they are
prefixed with BUILD_INTERFACE, which this patch adds.

Change-Id: I047700f447237dfbe5a901072eb413a159ae537d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-05 13:36:47 +00:00
Simon Hausmann
4ee762cf25 Fix qmlcachegen invocation on Windows, part 2
Fix up the previous commit and use separate COMMAND parameters for
add_custom_command to ensure the expansion of the PATH. The injection
via -E env "/some/dir;%PATH%" does not work as the dollar expansion is
not applied when the ninja command uses cmd /C. This relies now on
undocumented behavior of cmake ;(

Change-Id: I5b5fc88e4c13f8fb6c6bba3131204c2eb35404d6
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-04 13:55:34 +00:00
Simon Hausmann
18fc9e1bf8 Fix qtdeclarative build on Windows
Our tools are typically installed into the Qt bin directory, after which
they are useable right away on Windows, since the Qt dlls are located
there, too. An exception to the rule are tools that are built within a
module and used right away. At that point they are in the top-level
bin dir of the build directory, along with "local" DLLS they might need,
but with the Qt dlls out of reach. To cover this case, we need to
prepend a PATH adjusting command when using these with
add_custom_command.

Change-Id: I7f58581f5060c8004b5d1fa1f6f17297256783de
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-04 13:18:08 +00:00
Simon Hausmann
85e3bb7aea Remove dead code
Change-Id: Iac7c7c77744b43772faf3402566685a674ab8ff3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2019-09-04 12:29:25 +00:00
Alexandru Croitor
f9842ae7d4 Don't include module syncqt header locations if syncqt was not run
When building QtQmlDevTools we don't generate syncqt headers, but the
non-existent include paths were still added, which means that anything
that used QtQmlDevTools would fail to configure (the standalone tests).

Make sure to only add the include paths if syncqt was executed.

Change-Id: I6d79ecf53e9a5d396e8df801584ce2c9f119f9be
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-02 12:32:01 +00:00
Leander Beernaert
eeffac526e Update Android build configuration
Update Android build configuration to be compatible with the multi-arch
android build patch to qmake. We can now build and generate the apk
correctly. Executing on the device/simulator will only work once the
latest changes from 5.14 have been merged in.

We now replace target suffix with ${CMAKE_ANDROID_ARCH_ABI}.[so|a] so
we don't have to deal with handling targets which might have any of the
OUTPUT_NAME properties set.

The dependency and deploy settings generation has also been updated to
append the file contents to a string and then do a single file write
at the end.

Change-Id: Id3c5bd0428141ecaf962124a100390e3a4e41feb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-30 12:10:26 +00:00
Alexandru Croitor
6c15ad7978 Fix qtdeclarative static builds
qmlplugindump is not build during a Qt static build, so there's no
point in creating custom targets that would run the tool.

Change-Id: Id7d6d44da63312f298f46eab08a5637cb0c97c8f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-30 12:10:07 +00:00
Alexandru Croitor
d436023b6a Fix static builds after revamp of add_qt_resource
The first issue is that instead of arg_OUTPUT_TARGET we should use
rcc_OUTPUT_TARGET (there was also a typo in the OUTPUT word).

The second issue came with the fact that the object library targets
that were created for resources had a "Qt6::" namespace prefix in the
exported Targets files, and yet the link generator expression did not
contain the prefix. This failed when building qtsvg in a static build,
because the exported object library could not be found.

The solution is to use the TARGET_NAME generator expression which
takes care of adjusting the name of the target when exported, thus
making the linking work both when building qtbase and when building
qtsvg.

This had the fallout, that all resource object libraries need
to be associated with an export set and installed. This wasn't the case
for plugins, because plugins have an export name of the form
"FooTargets", whereas the export name for the resource object library
is "Qt6FooTargets".

Adjust the export names of plugins to be the same as for modules and
resource library objects (aka contain the "Qt6 prefix").

Change-Id: I1ca28d20c51e4447e5783cc20571a68ec77f6513
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-30 08:24:37 +00:00
Simon Hausmann
3b04d22241 Fix "mkspec selection" when building with Emscripten
Change-Id: Id9d466221294651c2f8dfde149d82f45b4081238
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-28 14:10:10 +00:00
Simon Hausmann
db61770566 Fix CMake errors around linker flags when targeting WASM
* The -no-undefined linker option only makes sense for shared
      libraries. The WASM build is a static build though.

    * The -gc-sections linker option is only relevant for host tools
      and certainly applicable to the WASM toolchain.

Change-Id: Ib8daec66a6d80f5025887448882dd891e6176268
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-28 13:23:59 +00:00
Leander Beernaert
add4c4816c Add missing qml-root-path for Android
Add missing qml root path variable in the deployment configuration file.
Not having this variable will cause androiddeployqt not use the
qml dependency scanner to package all relevant dependencies.

This patch also fixes QT_ANDROID_BUNDLED_FILES files not being
processed.

Change-Id: I5bca33cdbb57098f283b38516b777571806da9e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-28 12:29:12 +00:00
Alexandru Croitor
486da5a84d Fix qt_get_module_for_plugin to work with interface libraries
Assume that interface libraries can't have plugins for now, otherwise
we'll need to change the "MODULE_PLUGIN_TYPES" property name to
include INTERFACE_ as a prefix.

Change-Id: I21b64179ded5fd10216d843a21ee149e002793f3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:15:00 +00:00
Leander Beernaert
4260b1edc5 Add OUPUT_DIRECTORY option to add_qt_test
From all the observed cases, the parameters given to OUTPUT_DIRECTORY
tend to be CMAKE_CURRENT_BINARY_DIR, which was the default value. This
change is mainly to avoid add_qt_test failing if OUTPUT_DIRECTORY is
specified.

Change-Id: I26b931dd33ad1e991b64c14cc11b4b7a713fc858
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-26 09:39:47 +00:00
Leander Beernaert
753e7c1061 Do not use quick compiler with embedded test data
Prevent the quick compiler running on embedded test data for platforms
such as Android. This breaks certain assumptions about the test setup
otherwise.

Change-Id: I1026da3e16552256623de26b843ea32ed2c4260e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-23 13:50:49 +00:00
Leander Beernaert
acdc5dfaee Skip emebedding test data when there is no target
On android test data is embedded into to the binary via resources. This
will not work with sourceless tests such as the qml only test cases.

Change-Id: I3ecf28223b3c7c6dae4ca3f15519adc028082598
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-08-23 09:31:39 +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
bb2d1f8119 Abstract and fix usages of QT_KNOWN_MODULES
In some places of the build system we need to iterate over repo specific
Qt known modules (aka the ones that are built in the current project).
In other places we need to iterate over the whole list of known Qt
modules (those found via find_package + the ones built in the
current project).

Introduce two separate functions that provide access to either the
former or latter, and adjust all existing usages of QT_KNOWN_MODULES as
needed.

Change-Id: Ica96d0cfe690b9aaaa3f8c53bc84975bccad69c7
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:25:37 +00:00
Leander Beernaert
24bdc6e156 Fix missing prefix for test data on android
Add missing required resource prefix to add_qt_resource() call when
embedding test data as a resource.

Change-Id: I9130f9ae863daae80221a1475b077b1d2e501f6d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-22 13:49:33 +00:00
Leander Beernaert
7a1853dbe2 Extract add_qt_resource into reusable components
This patch moves all of the underlying code for add_qt_resource
into a common reusable snippet for both the Qt build and user projects.

For users, the new API is available under QT5_ADD_RESOURCES. If
outfiles is a CMAKE target we will use the new API, otherwise
we will fall back to the old behavior.

This patch also adds EXTRA_CMAKE_FILES and EXTRA_CMAKE_INCLUDES to
add_qt_module so that module specific cmake files can be installed
and loaded by the module's config.cmake.

The code will be installed under CMAKE_BINARY_DIR/Qt{}CoreResource.cmake
and is injected into Qt{}Core_Config.cmake via the extra cmake includes
passed into add_qt_module.

To make sure it still works with QtBuild, we do the actual generation
of the file from QtBaseGlobalTargets and include the generated file
there as well.

Change-Id: I85fefaa11dde01a6790d23c62d6a64cd157e2617
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-22 09:47:01 +00:00
Leander Beernaert
87a6283fbb Fix QT_WILL_BUILD_TOOLS evaluation
This condition was not being properly evaluated since the cached variable
was treated as a string. Any checks with if(QT_WILL_BUILD_TOOLS) would
just verify whether the string was empty or not.

Change-Id: Ie8b9ecc8249a1e9f5c0aa1b13d5bef686fcb04de
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-16 11:39:18 +00:00
Alexandru Croitor
1291e8d094 Fix developer warnings that a plugin does not belong to a Qt module
When building qtsvg or qtimageformats there are a bunch of
configuration warnings like:

The plug-in 'qtiff' does not belong to any Qt module.

This happens because qt_get_module_for_plugin() checks for modules
only in the QT_KNOWN_MODULES variable. find_package()'d modules
will not appear there though, but only in
QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE.

Change the function to check for Qt modules in both variables.
This fixes all the warnings regarding plugins not belonging to a
module.

Change-Id: I39e668801a93794b62888cf868b97c55f57dccdd
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-16 07:28:53 +00:00
Alexandru Croitor
4572ded8b3 Fix copying / installing of testdata to proper location
I don't know why, but previously the test data was copied to
"test_build_dir/testdata" subfolder. That's incorrect, there's no
need for a testdata subfolder, the copied / installed contents
should go directly under the test build dir / install dir.

Incidentally this will make the corelib/io/qdir tests to pass.

Amends 1307736c7d .

Change-Id: I9e180d608433fe82f4a29afea7f594507e6020d3
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:16 +00: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
Leander Beernaert
723d5c5056 Fix QRC Resource paths for qrc files in subdirectories
When pro2cmake converts qrc files that are located in a subdirectory
there is an error in the resource paths for qrc files generated
with add_qt_resource().

For instance, consider the contents of data/scenegraph.qrc:
<RCC>
    <qresource prefix="/qt-project.org/scenegraph">
        <file>"shaders/24bittextmask.frag"</file>
    </qrsource>
<RCC>

After processing by pro2cmake and add_qt_resource() we generate
<RCC>
    <qresource prefix="/qt-project.org/scenegraph">
	<file alias="data/shaders/24bittextmask.frag">
            ${CMAKE_CURRENT_SOURCE_DIR}/data/shaders/24bittextmask.frag"
        </file>
    </qrsource>
<RCC>

The expected qrc path for the resource should be prefix/shaders/...,
but in CMake it becomes prefix/data/shaders/... due to the
BASE parameter.

To fix it we check whether BASE is set and whether there are no
other aliases present on the source file before setting an alias
with the original file path.

Change-Id: If0a68a5ffa787704b10b740e20f875c9029509b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-14 11:44:58 +00:00
Leander Beernaert
0f268277c5 Add substituition rule to qt_internal_module_info
Added substituion rule to qt_internal_module_info to replace '.' with
'_'. Fixes compile errors for targets with names such as Plugin.2.

Change-Id: I0754c771bdc456a8a8f450fba90792c98d276c92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-12 10:02:20 +00:00
Leander Beernaert
b25260bac6 Change quick compiler generated code path
We now compile all qml files from the quick compiler in separate
directories qmlcache/${resource_name} to prevent issues where the same
qml file is present in more than one resource file.

Change-Id: I6857ff6aaaa21112896d5d39bbe11d3ffe524ec8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-12 09:01:35 +00:00
Leander Beernaert
6ef1b60b08 Fix QuickCompiler Setup Errors
If the variable resource_files existed in the parent scope, the list
would now be duplicate.

Fix case where TO_CMAKE_PATH didn't properly convert //Foo into /Foo,
so wee need to handle this manually.

Change-Id: I73f1b4db82f6a80ba00da928b39091ac6c968a02
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-09 14:12:37 +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