summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.h
Commit message (Collapse)AuthorAgeFilesLines
* Autogen: Make cmQtAutoMocUic a free functionSebastian Holtermann2019-09-281-547/+4
|
* Autogen: Refactor json info file reading interfaceSebastian Holtermann2019-09-281-1/+1
|
* Autogen: Use JSON instead of CMake script for info filesSebastian Holtermann2019-09-251-25/+20
| | | | | | | | | | | | | | | | | | | | | | | 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
* Autogen: Variable renames and cleanupsSebastian Holtermann2019-09-251-3/+2
|
* 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: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)Sebastian Holtermann2019-09-161-3/+4
| | | | | | | | | | | | | | | | The new `AUTOMOC_PATH_PREFIX` boolean target property enables automatic generation of the path prefix `-p` option for `moc`. `AUTOMOC_PATH_PREFIX` is initialized from the variable `CMAKE_AUTOMOC_PATH_PREFIX`, which is ON by default. When `AUTOMOC_PATH_PREFIX` is enabled, CMake tests if a `moc`ed header file is in one of the include directories. If so, then the `-p` option, with the relative path of the header parent directory to the respective include directory, is added to the `moc` command. If the header file is not in an include directory, the `-p` option is omitted. Closes: #18815 "AUTOMOC: generated files include full relative path, breaking certain reproducible builds"
* Autogen: Add IsHeader flag to SourceFileT classSebastian Holtermann2019-09-161-4/+3
|
* Autogen: Abbreviate file paths in messagesSebastian Holtermann2019-09-161-8/+6
| | | | | | | | | | | 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: Split JobEvalCacheT job into separate moc and uic jobsSebastian Holtermann2019-09-161-25/+45
| | | | | | | | | This splits the `JobEvalCacheT` job into separate `JobEvalCacheMocT` and `JobEvalCacheUicT` classes, that run concurrently. The `JobEvalCache*T::FindIncluded*` methods are overhauled to store probed directoriy names only if probing fails. Warning messages are refactored to show the file name and the probed directories instead of all probed file paths. This is easier to read.
* Autogen: Split JobProbeDepsT job into separate moc and uic jobsSebastian Holtermann2019-09-161-9/+29
| | | | | | | | | | | | | By splitting `JobProbeDepsT` into two independent `JobProbeDepsMocT`, `JobProbeDepsUicT`, the moc and uic job generation will happen concurrently. This should improve the execution speed, when both AUTOMOC and AUTOUIC are enabled. Parent directory names for moc and uic output files are are collected in a `std::unordered_set<std::string>` and get created in a batch. Beforehand we tried to create the parent directory for each output file. This led to duplications of `MakeDirectory` calls when there were multiple output files in the same directory (which is the case usually).
* Autogen: Rename job classesSebastian Holtermann2019-09-161-80/+30
|
* Autogen: Remove CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE sort duplicationSebastian Holtermann2019-09-161-1/+0
| | | | | | | This removes code that sorts include directories for `AUTOMOC` according to `CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE`. This is possible because the included directories passed to `AUTOMOC` are already sorted, also with respect to `CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE`.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-3/+3
| | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-3/+3
|
* Merge topic 'autogen_strcat'Brad King2019-08-291-7/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 32b15d320f Autogen: cmQtAutoMocUic settings hash computation optimizations b66cd3fe63 Autogen: cmQtAutoMocUic string concatenation cleanups 619a92eacd Autogen: cmQtAutoRcc settings hash computation optimizations 10dc684508 Autogen: cmQtAutoRcc string concatenation cleanups da6c4b1273 Autogen: cmQtAutoGenInitializer string concatenation cleanups 7a78d15415 Autogen: Let cmQtAutoGenerator::Logger methods accept cm::string_view c797148e85 Autogen: Use cm::string_view for AUTO{MOC,UIC,RCC} generator names 8586077baa Autogen: Modernize cmQtAutoGen methods using cm::string_view Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3742
| * Autogen: cmQtAutoMocUic string concatenation cleanupsSebastian Holtermann2019-08-271-7/+8
| |
* | Merge topic 'autogen_fix_use_after_move'Brad King2019-08-281-1/+1
|\ \ | |/ |/| | | | | | | | | e32f70036c Autogen: Fix AUTOUIC segfault, when file includes colliding ui_*.h file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3745
| * Autogen: Fix AUTOUIC segfault, when file includes colliding ui_*.h fileSebastian Holtermann2019-08-271-1/+1
| | | | | | | | | | | | | | This fixes a case of use after move of a `std::shared_ptr` in `AUTOUIC`. It triggered a segfault, when the error message for colliding `ui_*.h` includes in different files was computed.
* | IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
|/ | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data cachingSebastian Holtermann2019-05-071-161/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Rename `cmQtAutoGeneratorMocUic` class to `cmQtAutoMocUic`Sebastian Holtermann2019-04-151-0/+413
The class name `cmQtAutoGeneratorMocUic` is long and cumbersome. This renames it to `cmQtAutoMocUic`.