17 Commits

Author SHA1 Message Date
Sebastian Holtermann
71d6a1455e Autogen: Evaluate compiler features for the same exectuable only once
To speed up the `AUTOGEN` configuration process, evaluate the compiler
features only once.  The feature evaluation result is stored in the new class
`cmQtAutoGen::CompilerFeatures`, and the instance is shared by using
`std::shared_ptr`.
2019-05-22 12:25:17 +02:00
Sebastian Holtermann
95de172b68 AutoRcc: Make rcc parsing function private
The `.qrc` parsing functions in `cmQtAutoGen` are no longer needed outside
the private implementation of `cmQtAutoGen::RccLister`.  This makes them
private, too.
2019-04-06 16:17:40 +02:00
Sebastian Holtermann
7cbde5c503 AutoRcc: Add cmQtAutoGen::RccLister class
The new `cmQtAutoGen::RccLister` class provides a simple interface to
list files in a `.qrc` resources file by either calling `rcc` with
list options or by parsing the resources file content.
2019-04-06 16:17:19 +02:00
Sebastian Holtermann
b32e18fb88 Autogen: Remove static const generator name strings from cmQtAutoGen 2019-04-02 20:12:43 +02:00
Sebastian Holtermann
63191b169e Autogen: Use more readable variable names for static const AUTO* strings 2019-02-26 19:33:26 +01:00
Sebastian Holtermann
5e36209f71 Autogen: Rename cmQtAutoGen::GeneratorT enum to cmQtAutoGen::GenT 2019-02-21 11:38:30 +01:00
Sebastian Holtermann
14ae19c327 Autogen: cmQtAutoGen: Store generator names in class static const strings 2019-02-21 11:37:51 +01:00
Sebastian Holtermann
f2f1661334 Autogen: Add and use QtAutoGen::Tools method 2019-01-15 09:52:35 +01:00
Sebastian Holtermann
3aa11f31fc Autogen: Use integers to store the Qt version 2018-08-13 18:12:47 +02:00
Craig Scott
8e841a473f Cleanup: Fix typos and grammar in docs and code
No functional changes, just docs, comments and error messages.
2018-04-23 07:48:03 +10:00
Sebastian Holtermann
a8ee7406a7 Autogen: Improved multi-config include scheme
For multi configuration generators AUTOMOC generates the
moc files that are included in `mocs_compilation.cpp`
in `AUTOGEN_BUILD_DIR/include_$<CONFIG>/`. By doing so each
configuration reads different moc files when compiling
`mocs_compilation.cpp`. Since we do not (need to) rewrite
`mocs_compilation.cpp` on a configuration change anymore,
the files also does not need to be recompiled anymore.
Not having to rewrite and recompile `mocs_compilation.cpp`
on a configuration change anymore was the main objective of
this patch.

In a similar fashion AUTORCC generates a `qrc_BASE_CMAKE.cpp`
file below `AUTOGEN_BUILD_DIR/include_$<CONFIG>/` and
`qrc_BASE.cpp` becomes a mere wrapper that includes this
actuall rcc output file (when using multi configuration
generators).

The template files `Modules/AutoRccInfo.cmake.in` and
`Modules/AutogenInfo.cmake.in` were removed in favor
of writing the info `.cmake` files manually.

Closes #17230
2018-02-02 09:10:40 +01:00
Sebastian Holtermann
a008578dee Autogen: Process files concurrently in AUTOMOC and AUTOUIC
This introduces concurrent thread processing in the `_autogen`
target wich processes AUTOMOC and AUTOUIC.
Source file parsing is distributed among the threads by
using a job queue from which the threads pull new parse jobs.
Each thread might start an independent ``moc`` or ``uic`` process.
Altogether this roughly speeds up the AUTOMOC and AUTOUIC build
process by the number of physical CPUs on the host system.

The exact number of threads to start in  the `_autogen` target
is controlled by the new AUTOGEN_PARALLEL target property which
is initialized by the new CMAKE_AUTOGEN_PARALLEL variable.
If AUTOGEN_PARALLEL is empty or unset (which is the default)
the thread count is set to the number of physical CPUs on
the host system.

The AUTOMOC/AUTOUIC generator and the AUTORCC generator are
refactored to use a libuv loop internally.

Closes #17422.
2018-01-17 17:23:49 +01:00
Sebastian Holtermann
ab9d5896ae Autogen: Detect rcc feature once during configuration
We used to detect the `rcc` features before every `rcc` list invocation
wich resulted in `rcc` be called twice for every listing operation.

Now we detect the `rcc` list capabilities once during configuration and
pass it to the cmake_autorcc target in the info file.
2017-11-19 13:12:42 +01:00
Sebastian Holtermann
f86ba8ee8e Autogen: Reintroduce per-config sources support
Reintroduce per-config sources support in AUTOGEN but disable it by default.
2017-09-25 16:27:38 +02:00
Sebastian Holtermann
5d3bca6485 Autogen: Rename cmQtAutoGen::GeneratorType to cmQtAutogen::Generator 2017-09-25 12:02:35 +02:00
Sebastian Holtermann
d8d064abbc Autogen: Use the same algorithm for RCC and UIC option merging 2017-09-07 17:53:19 +02:00
Sebastian Holtermann
d1e5eb8497 Autogen: Iterate source files only once
This is a large commit that serves multiple purposes

- Iterate source files only once and store all extracted
  information in a cmQtAutogenDigest class that can be reused.
  This is brings speed improvements because several properties
  are only evaluated once. More that that it helps to avoid
  duplication of code with non trivial files property checks.
- Fix the Visual Studio generator to use PRE_BUILD when possible.
- Convert `for( ... )` loops to C++11 range base loops where possible
  (cmQtAutogen*.cxx only).
- String concatenation optimizations.
2017-09-07 17:53:18 +02:00