summaryrefslogtreecommitdiff
path: root/Source/cmQtAutoGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy: fix `readability-redundant-access-specifiers` warningsBen Boeckel2021-01-271-3/+0
|
* clang-tidy: fix `performance-trivially-destructible` warningsBen Boeckel2021-01-271-1/+1
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-7/+7
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-1/+1
| | | | Fixes: #20666
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+7
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* Autogen: Refactor json info file reading interfaceSebastian Holtermann2019-09-291-36/+60
|
* Autogen: Use JSON instead of CMake script for info filesSebastian Holtermann2019-09-251-7/+42
| | | | | | | | | | | | | | | | | | | | | | | We used to store information for the _autogen target in a CMake script file AutogenInfo.cmake, which was imported by a temporary cmake instance in the _autogen target. This introduced the overhead of creating a temporary cmake instance and inherited the limitations of the CMake language which only supports lists. This patch introduces JSON files to pass information to AUTORCC and autogen_ targets. JSON files are more flexible for passing data, e.g. they support nested lists. The patch has the side effects that - AutogenInfo.cmake is renamed to AutogenInfo.json - AutogenOldSettings.txt is renamed to AutogenUsed.txt - RCC<qrcBaseName><checksum>Info.cmake is renamed to AutoRcc_<qrcBaseName>_<checksum>_Info.json - RCC<qrcBaseName><checksum>.lock is renamed to AutoRcc_<qrcBaseName>_<checksum>_Lock.lock - RCC<qrcBaseName><checksum>Settings.txt is renamed to AutoRcc_<qrcBaseName>_<checksum>_Used.txt
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+2
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* Autogen: Abbreviate file paths in messagesSebastian Holtermann2019-09-161-7/+17
| | | | | | | | | | | This introduces the `cmQtAutoGenerator::MessagePath` method, that abbreviates paths by placing a - "SRC:" prefix in place of the project source directory - "BIN:" prefix in place of the project binary directory The method is used in `AUTO{MOC,UIC,RCC}` when paths are displayed in messages. This makes the messages generated by `AUTO{MOC,UIC,RCC}` shorter and improves their readability.
* Autogen: Let cmQtAutoGenerator::Logger methods accept cm::string_viewSebastian Holtermann2019-08-271-9/+10
|
* Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data cachingSebastian Holtermann2019-05-071-75/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New features ------------ CMake's `AUTOMOC` and `AUTOUIC` now cache information extracted when parsing source files in `CMakeFiles/<ORIGIN>_autogen.dir/ParseCache.txt`. This leads to faster `<ORIGIN>_autogen` target rebuilds, because source files will be parsed again only if they're newer than the `ParseCache.txt` file. The parse cache will be recomputed if it is older than the CMake executable. `AUTOMOC` and `AUTOUIC` now check if `moc` or `uic` output files are older than the `moc` or `uic` executable. If an output file is older than the compiler, it will be regenerated. Therefore if a new `moc` or `uic` version is installed, all output files will be regenerated. `AUTOMOC` and `AUTOUIC` error and warning messages are more detailed. Internal changes ---------------- `moc` and `uic` output file names are not computed in the `_autogen` target anymore but in `cmQtAutoGenInitializer`. This makes the available at the configuration stage for improved dependency computations (to be done). In `AutogenInfo.cmake`, equally sized lists for "source file names", "source file flags" and "compiler output file names" are passed to the `_autogen` target. This replaces the separate file lists for `AUTOMOC` and `AUTOUIC`. Files times are read from the file system only once by using `cmFileTime` instances instead of `cmQtAutoGenerator::FileSystem::FileIsOlderThan` calls. All calls to not thread safe file system functions are moved to non concurrent fence jobs (see `cmWorkerPool::JobT::IsFence()`). This renders the `cmQtAutoGenerator::FileSystem` wrapper class obsolete and it is removed. Instead of composing a single large settings string that is fed to the `cmCryptoHash`, now all setting sub strings are fed one by one to the `cmCryptoHash` and the finalized result is stored. The `std::mutex` in `cmQtAutoGenerator::Logger` is tagged `mutable` and most `cmQtAutoGenerator::Logger` methods become `const`. Outlook ------- This patch provides the framework required to - extract dependencies from `.ui` files in `AUTOUIC`. These will help to address issue #15420 "AUTOUIC: Track uic external inputs". - generate adaptive `make` and `ninja` files in the `_autogen` target. These will help to address issue #16776 "AUTOUIC: Ninja needs two passes to correctly build Qt project". - generate (possibly empty) `moc` and `uic` files for all headers instead of a `mocs_compilation.cpp` file. This will help to address issue #17277 "AUTOMOC: Provide a option to allow AUTOMOC to compile individual " "moc_x.cxx instead of including all in mocs_compilation.cxx"
* Autogen: Factor out concurrency framework to cmWorkerPool classSebastian Holtermann2019-04-151-102/+0
| | | | | | | | | | | | | | | This factors out the concurrency framework in `cmQtAutoGeneratorMocUic` to a dedicated class `cmWorkerPool` which might be reused in other places. `cmWorkerPool` supports fence jobs that require that - all other jobs before in the queue have been processed before the fence job processing gets started, - no jobs later in the queue will be processed before the fence job processing has been completed. Fence jobs are needed where the completion of all previous jobs in the queue is a requirement for further processing. E.g. in `cmQtAutoGeneratorMocUic` the generation of `mocs_compilation.cpp` requires that all previous source file parse jobs have been completed.
* Autogen: Move libuv loop from cmQtAutoGenerator to cmQtAutoGeneratorMocUicSebastian Holtermann2019-04-061-10/+0
| | | | | | | | `cmQtAutoGenerator` automatically started a libuv loop in the constructor. The loop is needed in `cmQtAutoGeneratorMocUic`, but not in `cmQtAutoGeneratorRcc` (anymore). To avoid starting the loop in `cmQtAutoGeneratorRcc`, this patch moves the loop variables and startup code from `cmQtAutoGenerator` to `cmQtAutoGeneratorMocUic`.
* Autogen: Make cmQtAutoGenerator::FileSystem Logger freeSebastian Holtermann2019-04-061-19/+2
| | | | | | | | | | | | `cmQtAutoGenerator::FileSystem` used to have a reference to a `cmQtAutoGenerator::Logger` instances. This was used for utility methods that automatically generated an error message on demand. Unfortunately this resulted in double error messages in some places. To fix these and with the additional purpose of removing the dependency of `cmQtAutoGenerator::FileSystem` to `cmQtAutoGenerator::Logger`, this patch removes the `Logger` reference in `cmQtAutoGenerator::FileSystem`. In the process some silent error conditions gained error messages and some existing error messages were extended.
* Autogen: Move Logger and FileSystem member variables to generator classesSebastian Holtermann2019-04-061-8/+4
| | | | | | | `cmQtAutoGenerator` automatically added `cmQtAutoGenerator::Logger` and `cmQtAutoGenerator::FileSystem` member variables to all inherited classes. This patch moves these members variable declarations to the inherited classes, where needed.
* AutoRcc: Don't use cmQtAutoGenerator::FileSystem methodsSebastian Holtermann2019-04-061-0/+8
| | | | | | `cmQtAutoGenerator::FileSystem` is only required for concurrent file system access, but `cmQtAutoGeneratorRcc` isn't concurrent. Therefore this patch replaces all `cmQtAutoGenerator::FileSystem` uses in `cmQtAutoGeneratorRcc`.
* Replace use of CollapseCombinedPath with CollapseFullPathBrad King2019-03-191-3/+3
| | | | | | | | | | | `CollapseCombinedPath` was introduced by commit 551d3343cd (cmDependsC: Collapse relative include paths, 2013-06-19, v2.8.12~237^2) where the existing `CollapseFullPath` should have been used instead. Then its use proliferated slightly. Since `CollapseCombinedPath` is less widely used and less robust (see issue #19049), use `CollapseFullPath` everywhere instead. Issue: #19050
* Autogen: Rename cmQtAutoGen::GeneratorT enum to cmQtAutoGen::GenTSebastian Holtermann2019-02-211-10/+10
|
* clang-tidy: Use `= delete`Regina Pfeifer2019-01-291-1/+3
|
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-3/+0
|
* Autogen: Add CMAKE_AUTOGEN_VERBOSE variable supportSebastian Holtermann2018-06-211-4/+7
| | | | | Setting CMAKE_AUTOGEN_VERBOSE enables verbose output during AUTOMOC, AUTOUIC and AUTORCC generation.
* Autogen: Add lock file to AUTORCC commandsSebastian Holtermann2018-05-301-1/+1
| | | | | By using a per .qrc lock file in AUTORCC, the same `cmake -E cmake_autorcc ...` command can be called concurrently.
* Autogen: Use std::istreambuf_iterator for file so string readingSebastian Holtermann2018-04-031-0/+5
| | | | | | | This adds a dedicated mutex for file reading and writing to cmQtAutoGenerator::FileSystem. The purpose of the change is to avoid that long files reads block cmsys based path computations, which are protected by an other mutex.
* Autogen: Protected calls to cmFilePathChecksumSebastian Holtermann2018-04-031-0/+9
| | | | | Closes #17861 Closes #17862
* Autogen: Protected calls to cmQtAutoGen::SubDirPrefixSebastian Holtermann2018-04-031-0/+2
|
* Autogen: Protected calls to cmSystemTools::GetFilenameWithoutLastExtensionSebastian Holtermann2018-04-031-0/+2
|
* Autogen: Protected calls to cmSystemTools::Split/JoinPathSebastian Holtermann2018-04-031-0/+8
|
* Autogen: Protected calls to cmSystemTools::CollapseCombinedPathSebastian Holtermann2018-04-031-1/+11
|
* De-duplicate cmUVSignalHackRAIIBrad King2018-01-251-37/+1
| | | | | | This was added separately in `cmCTestMultiProcessHandler` and `cmQtAutoGenerator`. Factor out the duplicate code into a common header for re-use.
* Autogen: Process files concurrently in AUTOMOC and AUTOUICSebastian Holtermann2018-01-171-48/+260
| | | | | | | | | | | | | | | | | | | | | | 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: Add and use cmQtAutoGenerator base classSebastian Holtermann2017-11-191-0/+76
Adds the new base class `cmQtAutoGenerator` which contains common variables and methods used by `cmQtAutoGeneratorMocUic` and `cmQtAutoGeneratorRcc`.