summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGen.h
Commit message (Collapse)AuthorAgeFilesLines
* AUTOMOC: Automatically use options file for moc compilerDaniel Gehriger2022-04-261-0/+5
|
* AUTOUIC: Fix merging of --blah options not being detected for Qt6Craig Scott2021-10-051-2/+2
| | | | | | | | | | | | | | | | 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-3/+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/+3
| | | | | | | | | | | | | | | | 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
* clang-tidy: fix `readability-redundant-access-specifiers` warningsBen Boeckel2021-01-271-1/+0
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-4/+4
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-2/+2
|
* 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.
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+2
| | | | | 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-2/+3
| | | | | | | | | | | | | | | | | | | | | | | 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-2/+3
|
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | 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: Split JobProbeDepsT job into separate moc and uic jobsSebastian Holtermann2019-09-161-0/+3
| | | | | | | | | | | | | 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: Replace typedef with usingRegina Pfeifer2019-09-031-1/+1
|
* Autogen: Use cm::string_view for AUTO{MOC,UIC,RCC} generator namesSebastian Holtermann2019-08-271-2/+2
| | | | | - 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-4/+6
|
* 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: Evaluate compiler features for the same exectuable only onceSebastian Holtermann2019-05-221-0/+10
| | | | | | | 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`.
* AutoRcc: Make rcc parsing function privateSebastian Holtermann2019-04-061-16/+0
| | | | | | 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-0/+39
| | | | | | 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-9/+0
|
* Autogen: Use more readable variable names for static const AUTO* stringsSebastian Holtermann2019-02-261-8/+8
|
* Autogen: Rename cmQtAutoGen::GeneratorT enum to cmQtAutoGen::GenTSebastian Holtermann2019-02-211-14/+13
|
* Autogen: cmQtAutoGen: Store generator names in class static const stringsSebastian Holtermann2019-02-211-4/+14
|
* Autogen: Add and use QtAutoGen::Tools methodSebastian Holtermann2019-01-151-0/+3
|
* Autogen: Use integers to store the Qt versionSebastian Holtermann2018-08-131-0/+26
|
* Cleanup: Fix typos and grammar in docs and codeCraig Scott2018-04-221-1/+1
| | | No functional changes, just docs, comments and error messages.
* Autogen: Improved multi-config include schemeSebastian Holtermann2018-02-021-13/+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-19/+36
| | | | | | | | | | | | | | | | | | | | | | 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: Detect rcc feature once during configurationSebastian Holtermann2017-11-191-3/+3
| | | | | | | | 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: Reintroduce per-config sources supportSebastian Holtermann2017-09-251-9/+24
| | | | Reintroduce per-config sources support in AUTOGEN but disable it by default.
* Autogen: Rename cmQtAutoGen::GeneratorType to cmQtAutogen::GeneratorSebastian Holtermann2017-09-251-3/+3
|
* Autogen: Use the same algorithm for RCC and UIC option mergingSebastian Holtermann2017-09-071-0/+10
|
* Autogen: Iterate source files only onceSebastian Holtermann2017-09-071-0/+47
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.