summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGen.cxx
Commit message (Collapse)AuthorAgeFilesLines
* AUTOMOC: Automatically use options file for moc compilerDaniel Gehriger2022-04-261-0/+7
|
* Source: fix many -Wmissing-prototypes warnings by marking functions staticSean McBride2021-10-251-4/+4
|
* AUTOUIC: Fix merging of --blah options not being detected for Qt6Craig Scott2021-10-051-6/+7
| | | | | | | | | | | | | | | | When merging a new set of uic options with a base set of options, such as when a source file has a non-empty AUTOUIC_OPTIONS property, the test for whether to support options starting with two hyphens was only testing if the Qt major version was exactly 5 rather than at least 5. That had the effect of preventing such options from being merged correctly when using Qt6, so new and base options would both be present instead of the single merged option from the source file properties. Update the version check and rename function arguments to avoid misrepresenting what they mean. Note that uic accepts long option names with a single hyphen too. See Qt docs for QCommandLineParser::ParseAsLongOptions for confirmation.
* AUTOUIC: Revert "Fix generating of dependency rules for UI header files"Brad King2021-08-191-36/+0
| | | | | | | | | | Revert commit e5ec0e52f4 (AUTOUIC: Fix generating of dependency rules for UI header files, 2021-07-22, v3.21.1~8^2) because it caused regressions. For example, changing one C++ source can now cause many others to rebuild. Revert the change pending further investigation. Fixes: #22531 Issue: #16776
* AUTOUIC: Fix generating of dependency rules for UI header filesAlexey Edelev2021-07-231-0/+36
| | | | | | | | | | | | | | | | We could not rely on .ui files when generating the ninja rules for the generated UI header files. .ui files might be added to the target sources but never processed by AUTOUIC afterward, since UI header files are never included in a source code. Instead of adding dependency rules based on the .ui files, this approach scans non-generated source files for includes of the UI header files, as AUTOUIC does. This gives the consistent set of UI header files at configure time, that could be used to generate byproducts rules for the AUTOUIC. Also, the path to the generated UI header file depends not on the .ui file location but on the include line is used in source files. Fixes: #16776
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-2/+1
|
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-2/+4
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-8/+9
| | | | | 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: Use JSON instead of CMake script for info filesSebastian Holtermann2019-09-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | 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: Split JobProbeDepsT job into separate moc and uic jobsSebastian Holtermann2019-09-161-0/+9
| | | | | | | | | | | | | 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).
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-6/+4
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-2/+2
|
* Autogen: Use cm::string_view for AUTO{MOC,UIC,RCC} generator namesSebastian Holtermann2019-08-271-22/+12
| | | | | - Store `AUTO{MOC,UIC,RCC}` generator name as `cm::string_view` - Use `std::initializer_list` instead of `std::array`
* Autogen: Modernize cmQtAutoGen methods using cm::string_viewSebastian Holtermann2019-08-271-65/+39
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-3/+1
| | | | Also, use the new function where applicable.
* Autogen: Modernize to use cmStrCat for string concatenationSebastian Holtermann2019-08-071-3/+2
|
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-3/+2
|
* Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data cachingSebastian Holtermann2019-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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"
* AutoRcc: Make rcc parsing function privateSebastian Holtermann2019-04-061-15/+9
| | | | | | The `.qrc` parsing functions in `cmQtAutoGen` are no longer needed outside the private implementation of `cmQtAutoGen::RccLister`. This makes them private, too.
* AutoRcc: Add cmQtAutoGen::RccLister classSebastian Holtermann2019-04-061-3/+105
| | | | | | 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.
* Autogen: Remove static const generator name strings from cmQtAutoGenSebastian Holtermann2019-04-021-23/+23
|
* Replace use of CollapseCombinedPath with CollapseFullPathBrad King2019-03-191-1/+1
| | | | | | | | | | | `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: Use more readable variable names for static const AUTO* stringsSebastian Holtermann2019-02-261-21/+21
|
* Autogen: Rename cmQtAutoGen::GeneratorT enum to cmQtAutoGen::GenTSebastian Holtermann2019-02-211-10/+10
|
* Autogen: cmQtAutoGen: Store generator names in class static const stringsSebastian Holtermann2019-02-211-17/+30
|
* Modernize: C-arrays and loops over themArtur Ryt2019-02-151-6/+14
| | | | | It replaces C arrays with deduced std::initializer_lists or std::array what makes enables for-loop over them.
* Merge topic 'autogen_adaptive_warning'Brad King2019-01-161-0/+35
|\ | | | | | | | | | | | | | | | | 5fe18eee13 Autogen: Adaptive missing Qt warning f2f1661334 Autogen: Add and use QtAutoGen::Tools method b2343ff086 Autogen: Fix rcc validity check Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2806
| * Autogen: Add and use QtAutoGen::Tools methodSebastian Holtermann2019-01-151-0/+35
| |
* | IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-0/+1
|/ | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-2/+3
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Autogen: Improved multi-config include schemeSebastian Holtermann2018-02-021-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Autogen: Process files concurrently in AUTOMOC and AUTOUICSebastian Holtermann2018-01-171-194/+120
| | | | | | | | | | | | | | | | | | | | | | 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: Fix for problematic nested lists separatorSebastian Holtermann2017-12-181-1/+1
| | | | | | | | | | | | | | | In the AutogenInfo.cmake file the separator for nested lists was `@LSEP@` which led to a speed regression because the `@` character triggered an (unsuccessful) expression evaluation. By setting the policy version of the CMake instance in the `_autogen` target to 3.9, the OLD `@` evaluating behavior controlled by policy CMP0053 is disabled. Also the nested lists separator string is changed to `<<<S>>>`, which solves the problem twofold. Closes #17570
* Autogen: Detect rcc feature once during configurationSebastian Holtermann2017-11-191-53/+38
| | | | | | | | 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.
* Replace cmArray{Begin,End,Size} by their standard counterpartsMatthias Maennich2017-10-231-2/+2
| | | | | | | | | | | std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14 and an standard compliant implementation has been introduced within the 'cm' namespace: cm::{cbegin,cend}. std::size is only part of C++17, hence exposing a compliant implementation within namespace cm (cm::size). where possible, the standard implementations are reused.
* Autogen: Reintroduce per-config sources supportSebastian Holtermann2017-09-251-20/+65
| | | | Reintroduce per-config sources support in AUTOGEN but disable it by default.
* Autogen: Rename cmQtAutoGen::GeneratorType to cmQtAutogen::GeneratorSebastian Holtermann2017-09-251-6/+6
|
* Autogen: Read relative paths from rcc outputSebastian Holtermann2017-09-211-9/+18
|
* Autogen: Refactor loggingSebastian Holtermann2017-09-071-7/+7
|
* Autogen: Use the same algorithm for RCC and UIC option mergingSebastian Holtermann2017-09-071-0/+77
|
* Autogen: Replace cmsys::SystemTools:: with cmSystemTools::Sebastian Holtermann2017-09-071-2/+2
|
* Autogen: Iterate source files only onceSebastian Holtermann2017-09-071-0/+243
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.