Commit Graph

37922 Commits

Author SHA1 Message Date
Tobias Hunger
b173f0b905 CMake: Treat OUTPUT_DIRECTORY as relative to top level build directory
Treat a relative path in OUTPUT_DIRECTORY as relative to the top level
build directory, not to the current build directory.

Change-Id: I4d409d1362a8f73d13b93cf5ab98e82e60dd62cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-20 10:38:32 +00:00
Alexandru Croitor
a9af99c926 Add windows platform plugin and its requirements
- executed pro2cmake script on windows qpa plugin
- added windowsuiautomation platformsupport project
- fixed plugin dlls and lib files to be written to the same path
- fixed an issue comErrorString which used implicit casting
  from QString to char*, but plugins are currently built
  with QT_NO_CAST_TO_ASCII

Task-number: QTBUG-74140
Change-Id: I5db3b6c5264bbd5dfba2998b049fda36eb312c70
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:35:07 +00:00
Alexandru Croitor
3f03917b54 Fix Windows build
- Fix qmake build
- Fix QtNetwork moc-ing, by including the moc files
  inside the cpp files
- Fix sql odbc plugin by including QT_PLUGIN define
- Fix Boostrap to link against the Platform target, to get the
  correct Unicode and WIN64 defines.
- Fix vulkan headers to be found
- Fix freetype bzip and png unresolved symbols / linker issues
  when building minimal platform plugin (also need to make
  sure to use the vcpkg toolchain instead of CMAKE_PREFIX_PATH
  because then find_package is overridden, which does magic
  to properly propagate static library dependencies).
- Fix qfilesystementry test not to be built without private
  tests feature (it led to undefined symbols issues).
- Make sure to remove QT_NO_CAST_TO_ASCII define when building
  QtCore, so that the qstringbuilder3 test builds
  successfully.

Task-number: QTBUG-74140
Change-Id: I353d08392b604d55f8e62cdd8696d1e19a3c084a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:34:52 +00:00
Alexandru Croitor
4f1a155909 Regenerate cmake files from configure.json files
The new files represent the json features more closely.
This helps with various build issues as well, like dynamicgl
feature not being present before.

Change-Id: I433592f48e0550700226a635492a3ce15af743c1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:34:43 +00:00
Alexandru Croitor
37b154858f Improve configurejson2cmake feature output generation
There were a few cases of feature outputs that were handled
incorrectly before this change, specifically:
- publicFeatures and privateFeatures with custom names
- privateFeatures that also ended up writing defines into
  public headers
- publicFeatures that ended up in private headers
- internal features (that should have no QT_FEATURE_foo
  defines) that were still written to either public or
  private headers

The change takes care of all those cases by keeping a map
of which features need to be written along with any visibility
specifications, as well as custom name changes.

Change-Id: I37baeaeacdfe4935128a392c72ca71b5c3ca1c8d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:34:33 +00:00
Alexandru Croitor
e5b2699750 Do define generation after feature evaluation
Instead of generating defines guarded by feature ifdefs,
record the define information (condition, name, value, etc),
and generate the final define statement only if the feature
condition evaluated to true.

This removes the need to generate feature defines
(QT_FEATURE_foo) for features that have neither public nor
private outputs in the configure.json file.

Also note that all qt_feature_definition() calls
(which correspond to type:"define" outputs in json files)
now generate defines only in the public header, which seems
to be consistent with how qmake evaluates json files.

Change-Id: I5210b405d5735dd9df5f7a55d1ea9547bb7b1159
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:34:13 +00:00
Tobias Hunger
64147fcb33 CMake: Add QT_CFLAGS_* when building x86simd tests
Change-Id: I5caa088d517cb9d3749c3ed8ef88a41552c1d340
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-18 12:33:44 +00:00
Tobias Hunger
fbf98bf255 CMake: pro2cmake.py: Better reporting of unused keys from qmake
Change-Id: Ie1b1f446c314bb5248cc13efeae1f279b0182e04
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-18 11:38:05 +00:00
Tobias Hunger
6e16f127ad CMake: pro2cmake.py: Handle SIMD sources
Change-Id: Ib445888e769432e8c247ae2d2fb5d8af2d5cd275
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-18 11:37:47 +00:00
Tobias Hunger
d48160be9e Corelib: Update to include qrc-file removal
Change-Id: I18d556d7517de7d9f2eb55045511d2166f0105ce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 11:01:40 +00:00
Alexandru Croitor
6ca047aba9 Use qt_evaluate_config_expression for feature enable conditions
Certain features like opengles2 can be enabled or disabled based
on the conditions that are specified in the ENABLE and DISABLE
parameters.
Because some of those conditions use STREQUAL with
a single quoted argument, we have to use
qt_evaluate_config_expression to circumvent the CMake bug
regarding single quotes, which is described in the function
implementation.
Only then will enabling / disabling work correctly.

Change-Id: I3b68ef611c985f0d8416fd089055fd862da1e542
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-14 13:56:30 +00:00
Tobias Hunger
42ae8218b1 CMake: configurejson2cmake.py: Fix typo
Change-Id: Ib142032577f1d84bfb2402103271db04a4bb25a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-12 08:43:03 +00:00
Alexandru Croitor
ea7d13de0d Update README to mention setting the vcpkg toolchain
Change-Id: Icac2ba956246901e02bb6aa257f81cccf56560e8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-11 16:54:10 +00:00
Tobias Hunger
4b105d77c2 CMake: pro2cmake.py: Remove .qrc files!
Remove qrc files from CMake. Use add_qt_resource function instead.

Change-Id: I64cdbd9498f97d23cd8e03f34ab5ae4a52dba5af
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-11 14:52:09 +00:00
Alexandru Croitor
af8413af15 Fix header Depends file generation
The script used to write incorrect dependency headers due to not
clearing the qtdeps variable at each loop step.

Change-Id: Icf293be7cea596daa096ab19d390c0bb468a8654
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-11 14:12:06 +00:00
Tobias Hunger
becbe4df3a Improve add_qt_resource function
* Handle BASE to give the directory files will be relative to.
* Support lang="foo" for qresource sections.

Change-Id: I36087220d03789a97105dc6dd1aca7a25a063d9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-11 09:14:33 +00:00
Tobias Hunger
4471249d33 CMake: Re-generate CMakeLists.txt file for network
Change-Id: Ib75578958a98947efbca853692b24528c1a3e8a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-11 09:14:22 +00:00
Tobias Hunger
138c0d0437 CMake: Re-generate CMakeLists.txt file for corelib
Change-Id: I96fb3e388a39481c513f1c6a23327e41a785e4af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-11 09:14:10 +00:00
Liang Qi
997c869280 cmake: fix the order of parameters for homebrew
Change-Id: I7b597a8d6bc81eafb21e5368a29700638c351bdf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-07 09:42:46 +00:00
Alexandru Croitor
e3c2d74506 Update README to specify the minimum version of CMake needed
Change-Id: I10e594859129bddfa56f078389b2272a0072fda0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-07 09:34:04 +00:00
Liang Qi
b51fbd72b9 cmake: build qmacstyle
Change-Id: I1fa0196036ffd31b5961bb5b73ff21123a818af8
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2019-03-06 13:18:36 +00:00
Liang Qi
32c59d6856 cmake: fix cocoa and graphics on macOS
Change-Id: Ia956c74a54874f91cc0ea8e5105164de88890ff2
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-06 13:18:20 +00:00
Mikhail Svetkin
25ee3d1c3b cmake: Fix moc on macOS
moc does not generate moc_defs.h and that's why moc does not understand
that he runs on macOS.
It happens because cmake can not find Qt version.

Change-Id: I34c51ebb69dc1ff782a0f129e114cda819122805
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-06 13:17:48 +00:00
Simon Hausmann
d72b717119 Fix build
There is no more internal function for adding general linker flags.
Let's use the appropriate cmake function right away, regardless of the
compiler choice. This is also how global.pri handled it.

Change-Id: I20c9002a31aa4d7e64c1c59d8d67118774da337c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-06 10:19:00 +00:00
Tobias Hunger
32d4f139c8 CMake: Re-generate bootstrap-related CMakeLists.txt files
Change-Id: Ia4be80729807c6aaac5b22a0dab81a841d57bdcd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 15:38:01 +00:00
Tobias Hunger
e1de70933e CMake: Handle gc-sections linker flags
Add a function to set gc-sections flags on the linker.

Change-Id: I9ac02364836d2aa8de239adb8d3a5d29659a4007
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 15:37:48 +00:00
Tobias Hunger
f3e3832c4d CMake: Re-generate CMakeLists.txt file for concurrent and sql
Change-Id: I3b61e35a65d369f0fff7c61c0b3af6f6e2974e1f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-04 10:00:25 +00:00
Tobias Hunger
27fc264b7d CMake: Re-generate CMakeLists.txt files for src/tools/*
Re-generate the CMakeLists.txt files for qdbusxml2cpp,
qdbuscpp2xml, qlalr and qvkgen.

Change-Id: I473a7bbdfa5ed5049d17324fb7dab4940124ef86
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-04 09:25:02 +00:00
Tobias Hunger
0fb799a0d7 CMake: Re-generate CMakeLists.txt file for uic
Change-Id: I9411b727b199d35709cf0fef37d3a442982cc3da
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-04 09:24:51 +00:00
Tobias Hunger
bfca573f87 CMake: Re-generate CMakeLists.txt file for dbus
Change-Id: I13ce987d4db99e160bf579ea3a785ac45cc1417b
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-04 09:24:37 +00:00
Tobias Hunger
9a7af3949a CMake: Re-generate CMakeLists.txt file for xml
Change-Id: I6d2570b5b98defc241acf653847b4c433432290f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-04 09:24:14 +00:00
Tobias Hunger
66a4267f93 CMake: pro2cmake.py: Map libpng to PNG::PNG
Change-Id: Ia8dd20b777e24e2783bedb0f063db2189e0b7ed3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 09:09:04 +00:00
Tobias Hunger
a5f51e4898 CMake: pro2cmake.py: Automatically map equals(QT_ARCH, "foo") in conditions
Change-Id: I10d8001ba8330deaa622ef8c499b2b6fe438e28a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 09:08:57 +00:00
Tobias Hunger
363eccf010 CMake: pro2cmake.py: Handle BOOTSTRAP for add_qt_tool
Add BOOTSTRAP for tools that need it automatically.

Change-Id: I33b2ec16dfcb09709f844ed232ce9974a9d7c7ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 09:08:48 +00:00
Михаил Светкин
3c9d7dfb30 cmake: Cleanup harfbuzz features
Remove system-harfbuzz feature and use harfbuzz feature as system

Change-Id: I441345a667450f1c2d19380b0709911011c7ceb7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-01 19:24:50 +00:00
Alexandru Croitor
07f922286c Fix building tests on macOS
Change-Id: I15a83d5abf9e8fa541ff3ca60bd8243f5f4b85e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-28 10:23:17 +00:00
Tobias Hunger
83354655b2 CMake: pro2cmake.py: Simplify code and add test for line continuation
Simplify code a bit and add a test for line continuation fixup.

Change-Id: If865bc94d7d419c65d3280b5f9613ebc0d3db74a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:41 +00:00
Tobias Hunger
f2e968b245 CMake: pro2cmake.py: Handle for loops without block
Handle for loops with a single line of instructions and add a test
for that.

Change-Id: I041ae30f64abcbd3db7df29933647f047b92ede3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:30 +00:00
Tobias Hunger
33fe56c630 CMake: pro2cmake.py: Make \$\$QT_FOO work in assignments
This broke somewhere along the way. Add a test for this.

Change-Id: I106ddff6eb86a51ef132285d1bc623f3b5cf71fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:17 +00:00
Tobias Hunger
754ba28799 CMake: pro2cmake.py: Fix parsing of Line continuation before end of file
... and add a test case for this.

Change-Id: If20d737b54ecb3f9e128e59070b238c840acad6c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:08 +00:00
Tobias Hunger
8512f5179d CMake: pro2cmake.py: Fix parsing of for loops
Ignore for loops in the pro2cmake.py parser and add a unit test for that.

Change-Id: I2a0c075c45cf56f4f24ada2d53e8e8e94ce19f26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:00 +00:00
Tobias Hunger
04d6981702 CMake: run_pro2cmake.py: Add statistics
Change-Id: I78e65970694d0c37c4b3c3ba6e6a83155579ea0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:07:07 +00:00
Tobias Hunger
eb832cb00a CMake: pro2cmake.py: Handle complex conditions
Change-Id: Ifb047e5736f1831ddbd65b210e760c2729378334
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:06:49 +00:00
Tobias Hunger
951e297362 CMake: pro2cmake.py: Warn and fix broken line continuation
Warn on broken line continuation in .pro-files, but fix up the issue
and proceed.

Change-Id: Ibe68011b312bcea25620ce790a0b44b2983fbd88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:06:41 +00:00
Alexandru Croitor
84af8f9b0b Fix build of qmake on macOS
Two changes were needed:
- correctly link against frameworks
- use qcore_mac.cpp instead of qcore_mac_objc.mm, because we don't
  link against AppKit

Change-Id: Ibd9d6d367a7fcdf7dce277c1b06d36c491294eeb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 16:11:53 +00:00
Alexandru Croitor
58bd86443c Fix usage of linker -no-undefined flag for macOS
Change-Id: I41c55871a8db3d860fc20ad17eb9a97b01d62448
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 16:11:43 +00:00
Tobias Hunger
c971d2d359 CMake: pro2cmake.py: Handle values with () in assignments
Change-Id: I0f59c7fa57cd6c64b151f439d4eea4ae56dca288
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:03:20 +00:00
Tobias Hunger
22dc78f417 CMake: pro2cmake.py: Fix handling of TEMPLATE=subdir .pro-files
Change-Id: I52f575df199c4d9b38123ab5d838f2e85344835d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:03:07 +00:00
Tobias Hunger
8c04d6c967 CMake: pro2cmake.py: Improve condition simplification code
Improve the code that simplifies conditions to take "OS families"
into account. E.g. if a system must be ANDROID, then it is redundant
to express that it is NOT APPLE_OSX.

Change-Id: Ib7e62726c309bf84b9e5e0d6a6e3465511db0ead
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:58 +00:00
Tobias Hunger
35f23a3dad CMake: pro2cmake.py: Better parsing of scopes with else
Parse conditions more exactly as before, enabling proper handling
of else scopes.

Change-Id: Icb5dcc73010be4833b2d1cbc1396191992df1ee4
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:45 +00:00