summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGeneratorInitializer.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Autogen: Rename cmQtAutogeneratorInitializer to cmQtAutoGenInitializerSebastian Holtermann2018-01-171-1461/+0
|
* Autogen: Process files concurrently in AUTOMOC and AUTOUICSebastian Holtermann2018-01-171-37/+140
| | | | | | | | | | | | | | | | | | | | | | 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.
* Autogen: Ignore not existing source files in cmMakefileSebastian Holtermann2018-01-101-4/+17
| | | | | | | | | | | | | | | | | | | | | | Until CMake 3.10 a list of source files that had the AUTOUIC_OPTIONS property populated was kept in `cmMakefile::QtUiFilesWithOptions`. In the process to remove all AUTOUIC related code from `cmMakefile` for CMake 3.10, the pre filtered list was replaced by a loop in `cmQtAutoGeneratorInitializer` over all source files in the `cmMakefile`. This loop introduced the problem that file paths were computed for source files that weren't in the target's sources and that might not even have existed. If the path for an unused and not existing file was computed a `cmake::FATAL_ERROR` with the error message "Cannot find source file:" was thrown nevertheless. This caused some projects to fail in CMake 3.10. This patch adds a test for path errors in the loops in `cmQtAutoGeneratorInitializer` that iterate over all source files in a `cmMakefile`. If a path error appears, the file is silently ignored. If the file is part of the target's sources, the path error will still be caught in the loop over all the target's sources. Closes #17573 Closes #17589
* Autogen: Fix library dependency forwarding to _autogen targetSebastian Holtermann2017-12-071-23/+22
| | | | | | | | Library dependencies of the origin target were forwarded to the _autogen target as source file dependencies. This is fixed by forwarding the dependencies as target dependencies instead. Issue: #17278
* server: return whether or not a target is generator providedJustin Goshi2017-11-201-5/+6
| | | | | | Some generators auto-generate targets. For example VS generators create the ALL_BUILD target. Add the ability to mark targets as generator provided and return that info through cmake-server codemodel.
* Autogen: Use integers instead of strings for the Qt versionSebastian Holtermann2017-11-191-2/+1
|
* Autogen: Use project relative paths in rcc custom command commentSebastian Holtermann2017-11-191-1/+21
|
* Autogen: Detect rcc feature once during configurationSebastian Holtermann2017-11-191-41/+57
| | | | | | | | 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.
* Autogen: Make cmQtAutoGeneratorInitializer an instantiable classSebastian Holtermann2017-11-191-652/+621
| | | | | Remove the cmQtAutoGenDigest classes and make cmQtAutoGeneratorInitializer instantiable instead.
* Autogen: Add and use cmQtAutoGenerator base classSebastian Holtermann2017-11-191-3/+10
| | | | | | Adds the new base class `cmQtAutoGenerator` which contains common variables and methods used by `cmQtAutoGeneratorMocUic` and `cmQtAutoGeneratorRcc`.
* Autogen: Switch to use custom commands for RCCSebastian Holtermann2017-11-191-209/+318
| | | | | | | | | | | | | | | | Instead of processing all `rcc` invocation requests in the _autogen target that calls `cmake -E cmake_autogen ...` once, use a dedicated custom command that calls `cmake -E cmake_autorcc ...` for each `.qrc` file. This allows parallel `.qrc` file processing and reduces the workload (and complexity) in the _autogen target. If only `AUTORCC` is enabled, the _autogen target won't be created at all since it is now used for `AUTOMOC` and `AUTOUIC` only. For `.qrc` files that are GENERATED a custom target is used instead of a custom command. Closes #17161
* Autogen: Don't add STATIC_LIBRARY cycle targets to the _autogen dependenciesSebastian Holtermann2017-10-271-17/+83
| | | | | | | When a STATIC_LIBRARY cycle is detected we don't add any STATIC_LIBRARY target from the cycle to the `_autogen` target dependencies. Closes #17389
* Autogen: Allow setting SKIP_AUTOUIC/GEN on .ui files not in the sourcesSebastian Holtermann2017-10-091-6/+10
| | | | | SKIP_AUTOUIC and SKIP_AUTOGEN were ignored when set on a `.ui` file that was not in the sources of the target.
* Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINESSebastian Holtermann2017-09-291-5/+8
|
* Merge topic 'autogen-macro-names2'Brad King2017-09-291-5/+10
|\ | | | | | | | | | | | | | | | | | | | | 93c8d55d Autogen: Update (CMAKE_)AUTOMOC_MACRO_NAMES release notes 084ace47 Autogen: Tests: Update AUTOMOC_MACRO_NAMES test 08041dd1 Autogen: Doc: Update documentation for (CMAKE_)AUTOMOC_MACRO_NAMES 7b33d67b Autogen: Create info file directory before writing 786b5be0 Autogen: Define all macro names in CMAKE_AUTOMOC_MACRO_NAMES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1321
| * Autogen: Create info file directory before writingSebastian Holtermann2017-09-281-5/+10
| |
* | Autogen: Offer solution for CMP0071 in warning messageSebastian Holtermann2017-09-281-28/+37
|/
* Autogen: Reintroduce per-config sources supportSebastian Holtermann2017-09-251-151/+198
| | | | Reintroduce per-config sources support in AUTOGEN but disable it by default.
* Autogen: Rename cmQtAutoGen::GeneratorType to cmQtAutogen::GeneratorSebastian Holtermann2017-09-251-2/+2
|
* Merge topic 'ranged-for'Brad King2017-09-131-11/+11
|\ | | | | | | | | | | | | 7d509579 Meta: modernize old-fashioned loops to range-based `for`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1249
| * Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-11/+11
| | | | | | | | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* | Use cmMakefile::GetOrCreateSourceGroup in cmQtAutogeneratorsInitializerSebastian Holtermann2017-09-091-14/+1
|/
* Autogen: Smarter target dependency computationSebastian Holtermann2017-09-071-72/+97
|
* Autogen: More use of scoped lambdasSebastian Holtermann2017-09-071-35/+28
|
* Autogen: More use of scoped lambdasSebastian Holtermann2017-09-071-16/+11
|
* Autogen: Use list of lists functions for UIC optionsSebastian Holtermann2017-09-071-4/+5
|
* Autogen: Pass RCC build names and function names in info fileSebastian Holtermann2017-09-071-45/+61
| | | | | | | | | - The output file name of the `rcc` command get computed once in the AUTOGEN initializer and is passed in the info file. - The function name for the `-name` option of `rcc` gets computed once in the AUTOGEN initializer and is passed along with the other `rcc` options in the info file.
* Autogen: Add functions to read/write a list of listsSebastian Holtermann2017-09-071-0/+16
|
* Autogen: Use the same algorithm for RCC and UIC option mergingSebastian Holtermann2017-09-071-41/+1
|
* Autogen: Replace cmsys::SystemTools:: with cmSystemTools::Sebastian Holtermann2017-09-071-6/+6
|
* Autogen: Iterate source files only onceSebastian Holtermann2017-09-071-415/+369
| | | | | | | | | | | | | | 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.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-2/+2
|
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-25/+25
|
* Autogen: Don't use cmMakefile::GetQtUiFilesWithOptionsSebastian Holtermann2017-08-221-19/+19
| | | | | The purpose of this patch is to allow later removal of AUTOGEN specific variables in cmMakefile and cmSourceFile.
* Autogen: Read skip files from makefileSebastian Holtermann2017-08-221-32/+58
| | | | | | | | | This allows to pass SKIP_AUTOMOC hints to the FOO_autogen target from files that are not listed in the target sources. The problem was that if main.cpp was listed in the source but not main.h, then SKIP_AUTOMOC for main.h was ignored.
* Autogen: Remove VS specific code exclusionSebastian Holtermann2017-08-221-31/+25
| | | | | | The amount of disabled code was small. Also the #ifdef tests were confusing and made testing on non Windows machines more difficult.
* Autogen: Initializer file type scanning optimizationsSebastian Holtermann2017-08-221-73/+91
|
* Autogen: Initializer optimizations and cleanupsSebastian Holtermann2017-08-221-209/+214
|
* Autogen: Add AUTOMOC_MACRO_NAMES supportSebastian Holtermann2017-08-181-0/+2
| | | | Closes #17176
* Autogen: Merge and remove redundant function callsSebastian Holtermann2017-08-101-20/+10
|
* Autogen: Clear sources meta data cacheSebastian Holtermann2017-08-101-0/+6
| | | | | | | | | | | | | | | | | Adds cmGeneratorTarget::clearSourcesCache() which clears the cache of precomputed sources lists and object names. The cache gets recomputed on demand. Clearing the cache is necessary in case an OBJECT library gets a source added after a target (ORIGIN) that includes it computed it's external sources cache. This may happen in AUTOMOC when ORIGIN is processed before the OBJECT library which gets a mocs_compilation.cpp file added. Closes #17152 Closes #17139 Closes #17085 Closes #15967
* Autogen: Enable per-config supportSebastian Holtermann2017-08-051-10/+0
| | | | | | | Enables the AUTOGEN per-config include directories and wrapper sources for multi configuration generators. Closes #16460
* Autogen: Generate rcc wrapper file on demandSebastian Holtermann2017-08-051-19/+10
| | | | | | | | | | | For multi configuration generators remove per-config qrc_FOO_$<CONFIG>.cpp source file support. Instead use a single source file qrc_FOO.cpp which is a wrapper that includes the actual rcc generated qrc_FOO_CONFIG.cpp file. This way, after a repeated configuration change, only the wrapper file qrc_FOO.cpp must be regenerated to include the appropriate qrc_FOO_CONFIG.cpp file.
* Autogen: Fix configuration suffix initializationSebastian Holtermann2017-08-051-6/+4
| | | | The configuration suffix was used before it was initialized.
* Autogen: Remove per-config suffix for mocs_compilations.cppSebastian Holtermann2017-08-051-24/+6
|
* Autogen: Forward target dependencies to *_autogen targetSebastian Holtermann2017-07-281-12/+33
| | | | | | | | | Only the dependecies from target_link_libraries() of the origin target were forwarded to the _autogen target. This patch adds forwarding of the dependencies from add_dependencies() to the _autogen target. Closes #17094
* Autogen: Process GENERATED files. Add CMP0071.Sebastian Holtermann2017-07-181-9/+35
| | | | | | | | | | This lets AUTOMOC and AUTOUIC process GENERATED files which used to be ignored before. A new policy CMP0071 ensures that the old behavior of ignoring GENERATED files is enabled when the CMake compatibility version CMAKE_MINIMUM_REQUIRED is < 3.10. Closes #16186
* Autogen: Skip generated files for compatibility with CMake 3.8Brad King2017-07-071-0/+7
| | | | | | | | | | | | | | | | The change in commit v3.9.0-rc1~464^2~8 (Autogen: Add AUTOMOC/UIC support for generated source files, 2017-03-02) changes behavior of existing projects that may not expect `AUTOGEN` on generated files and do not yet set `SKIP_AUTOGEN` on them. Disable the behavior change for now to fix the regression for CMake 3.9. We can restore it later with a policy. In order to keep the implementation and tests working, add an undocumented property we can use in the tests to enable the behavior before the policy is introduced. Fixes: #17031 Issue: #16186
* Autogen: Do not use per-config file suffixes with VS yetBrad King2017-06-071-0/+4
| | | | | | | | | The change in commit v3.9.0-rc1~42^2~1 (Autogen: Per-config file suffixes, 2017-05-15) broke Visual Studio builds because the generators do not yet fully support per-config sources. Disable the behavior on Visual Studio generators for now. Fixes: #16939