summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Autogen: Fallback on internal qrc parser when RCC isn't built yetAlexandru Croitor2019-03-041-2/+7
| | | | | | | | | | | When building a Qt project, the AUTORCC functionality, by default, uses the rcc binary to get the contents of a qrc file for dependency information. This is done at CMake "generate" time. The problem is that while configuring Qt itself, the rcc binary is not built yet. In that case, to get the contents of the qrc file, fall back to the code branch which uses an ifstream instead of the rcc binary.
* Autogen: Move additional source header search to configuration stageSebastian Holtermann2019-02-251-0/+61
| | | | | | | | The computation of additional source headers and and private headers for AUTOGEN is moved from the _autogen target to the configuration stage. This makes them available for _autogen target dependency computations. Closes: #18949
* Autogen: Refactor file lists computationSebastian Holtermann2019-02-251-162/+208
| | | | | | | In AUTOGEN this replaces simple file name lists with two list (for headers and sources) of structs with file name and file flags. The file name lists that are passed to the _autogen target via AutogenInfo.cmake are filtered from these two lists.
* Autogen: Refactor cmQtAutoGenInitializer::AddGeneratedSource methodSebastian Holtermann2019-02-211-65/+59
| | | | | In AUTOGEN pass the abstract cmQtAutoGenInitializer::GenVarsT to methods to identify the generator (moc/uic/rcc).
* Autogen: Refactor Qt executable name computationSebastian Holtermann2019-02-211-124/+124
| | | | | | In AUTOGEN a common new base class cmQtAutoGenInitializer::GenVarsT for mo/uic/rcc generator variables allows to generalize variable computation functions.
* Autogen: Rename cmQtAutoGen::GeneratorT enum to cmQtAutoGen::GenTSebastian Holtermann2019-02-211-7/+6
|
* Autogen: Use output caching GetExecutableTestOutputSebastian Holtermann2019-02-191-39/+14
| | | | | | | Use the output caching cmQtAutoGenGlobalInitializer::GetExecutableTestOutput method to avoid identical calls to moc, uic and rcc. Closes #18947
* Autogen: Iterate over makefile sources only onceSebastian Holtermann2019-02-021-78/+80
| | | | | | | In QtAutoGen we used to iterate over all makefile source two times to extract file parameters for moc and uic respectively. This patch merges both iterations into one loop. This makes the code easier to understand and likely faster to execute as well.
* cmSystemTools: Let `GetFileFormat` accept a `std::stding const&`Sebastian Holtermann2019-02-021-2/+2
| | | | | The `const char*` used formerly was converted to a `std::string` internally anyway.
* Use cmSourceFile::GetIsGeneratedSebastian Holtermann2019-02-011-2/+2
|
* Autogen: Read the Qt version from directory properties as wellSebastian Holtermann2019-01-301-18/+25
| | | | | This lets AUTOGEN read the Qt version from directory properties as a fallback when the Qt version variables are empty or unset.
* Autogen: Reenable passing compiler implicit include directories to mocSebastian Holtermann2019-01-281-6/+3
| | | | | | | | | | | Since commit 5990ecb741 (Compute implicit include directories from compiler output, 2018-12-07) we now have compiler implicit include directory computation for gcc and clang. It should be safe now to pass these to `moc`. This patch re-enables passing the compiler implicit include directories to `moc`, which was disabled due to issue #18669. Fixes: #18041 Issue: #18669
* cmLocalGenerator: Simplify `GetIncludeDirectories`Sebastian Holtermann2019-01-281-2/+2
| | | | | | | | | | | | | | | | | | This patch strips the `stripImplicitDirs` and `appendAllImplicitDirs` parameters from the `cmLocalGenerator::GetIncludeDirectories` method and makes it a wrapper into the new `cmLocalGenerator::GetIncludeDirectoriesImplicit` method. `cmLocalGenerator::GetIncludeDirectoriesImplicit` is the renamed old implementation of `cmLocalGenerator::GetIncludeDirectories` and still accepts `stripImplicitDirs` and `appendAllImplicitDirs`. The motivation is that there's only *one* case where `cmLocalGenerator::GetIncludeDirectories` is called with the `stripImplicitDirs` parameter being `false` (QtAutoGen), but many other places where it is called using the `true` default value. QtAutoGen is modified to use `cmLocalGenerator::GetIncludeDirectoriesImplicit` directly. In two use cases of `cmLocalGenerator::GetIncludeDirectories` the manually set `true` value for `stripImplicitDirs` is removed.
* Merge topic 'cmake-files-directory'Brad King2019-01-251-2/+1
|\ | | | | | | | | | | | | | | 3e867ed400 cmake: inlined files dir constant and removed it from cmake.h Acked-by: Kitware Robot <kwrobot@kitware.com> Rejected-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2655
| * cmake: inlined files dir constant and removed it from cmake.hBruno Manganelli2019-01-211-2/+1
| |
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-6/+6
| |
* | Merge topic 'autogen_mocs_compilation_first'Brad King2019-01-211-3/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 1ed4d48dcf Autogen: Prepend instead of append `mocs_compilation.cpp` to the sources list a42b700cc2 cmTarget,cmGeneratorTarget: Add optional `before` parameter to AddSource Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Peter Wu <peter@lekensteyn.nl> Merge-request: !2815
| * | Autogen: Prepend instead of append `mocs_compilation.cpp` to the sources listSebastian Holtermann2019-01-181-3/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | `mocs_compilation.cpp` easily takes a long time to compile when it contains multiple `moc` files. When it was appended like before we ran into the situation that all smaller sources were already compiled when `mocs_compilation.cpp` got compiled at last. In that case a single core was busy but all remaining cores stayed idle. To optimize CPU core utilization we now prepend `mocs_compilation.cpp` to the sources list instead of appending it. This allows smaller source files to get compiled *while* the long lasting `mocs_compilation.cpp` gets compiled. Closes #18793
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-3/+3
|/
* Merge topic 'autogen_adaptive_warning'Brad King2019-01-161-22/+21
|\ | | | | | | | | | | | | | | | | 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: Adaptive missing Qt warningSebastian Holtermann2019-01-151-22/+21
| | | | | | | | | | This makes the warning message for a missing Qt use the requested Qt version in the message text.
* | Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-1/+2
| | | | | | | | Reduce the number of files relying on `cmake.h`.
* | clang-tidy: Simplify boolean expressionsRegina Pfeifer2019-01-151-5/+1
|/
* Autogen: Add AUTO(MOC|RCC|UIC)_EXECUTABLE target propertiesTobias Hunger2019-01-101-13/+48
| | | | | | | | | | Allow to force moc/rcc/uic compiler used for AUTO(MOC|RCC|UIC). Setting these properties is only necessary if you are going to do strange things like build these tools as part of your own build system. Setting these properties will also prevent cmake from testing the binary: It is user-provided and assumed to be valid.
* Autogen: Prepare for Qt 6Tobias Hunger2019-01-071-7/+10
| | | | | | | | Handle Qt version > 5 in Qt AutoGen. This patch does *NOT* include tests and documentation: There is no Qt 6 yet. I still need this patch to work on a cmake based build system for Qt 6.
* Merge topic 'autogen-cleanups'Brad King2018-12-101-160/+72
|\ | | | | | | | | | | | | | | 7630eb1975 cmQtAutoGenInitializer: Reduce code duplication Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Tobias Hunger <tobias.hunger@gmail.com> Merge-request: !2689
| * cmQtAutoGenInitializer: Reduce code duplicationTobias Hunger2018-12-071-160/+72
| | | | | | | | Do not repeat the code used to find uic/rcc and moc exectuables.
* | Autogen: Revert passing compiler implicit includes to mocSebastian Holtermann2018-12-071-3/+6
|/ | | | | | | | | Passing an incomplete list of compiler include directories causes a regression in the KIO project (and probably others). We need to disable it until the complete list is available (see #16291). Fixes: #18669 Issue: #18041
* Merge topic 'autogen-qtversion-detection'Brad King2018-12-061-38/+47
|\ | | | | | | | | | | | | | | 5191b74524 Autogen: Qt version detection cleanup Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Sebastian Holtermann <sebholt@xwmw.org> Merge-request: !2694
| * Autogen: Qt version detection cleanupTobias Hunger2018-12-031-38/+47
| | | | | | | | | | Split the Qt version detection code up a bit so that it is a bit easier to follow.
* | Merge topic 'autogen_uic_empty_fix'Brad King2018-12-061-0/+6
|\ \ | |/ |/| | | | | | | | | | | | | 5f0f84c7e0 Autogen: Don't add a WIN32 moc definition if we have a moc_predefs.h file 0814d74548 Autogen: Add QtAutogen.UicNoGui test 2ef640819f Autogen: Tests: Differentiate between Qt core and Qt gui tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2668
| * Autogen: Don't add a WIN32 moc definition if we have a moc_predefs.h fileSebastian Holtermann2018-11-281-0/+6
| | | | | | | | | | | | | | | | On Windows systems we used to add a "-DWIN32" definition to the ``moc`` defines. This is not necessary anymore when we have a ``moc_predefs.h`` file that provides all compiler predefines. Closes #18623
* | Merge topic 'readability-static-accessed-through-instance'Brad King2018-11-281-1/+1
|\ \ | |/ |/| | | | | | | | | 3e60580784 clang-tidy: Fix readability-static-accessed-through-instance Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2647
| * clang-tidy: Fix readability-static-accessed-through-instanceRegina Pfeifer2018-11-211-1/+1
| | | | | | | | Enable the check in .clang-tidy and fix all warnings.
* | Merge topic 'autogen_uic_empty_fix_3_13'Brad King2018-11-281-1/+1
|\ \ | |/ |/| | | | | | | | | b1b5004c1a Autogen: Fix empty uic executable string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2667
| * Autogen: Fix empty uic executable stringSebastian Holtermann2018-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | In CMake 3.13.0 when a target has ``AUTOUIC`` enabled but doesn't link against Qt5Widgets, the uic executable string is empty and an error string "The uic executable \"\" does not exist" is generated. In CMake 3.12 ``AUTOUIC`` was silently disabled instead. This patch fixes the regression and restores the behavior of CMake 3.12. Fixes: #18630
* | Autogen: Add and use cmQtAutoGenInitializer::InfoWriter classSebastian Holtermann2018-11-141-139/+191
| | | | | | | | | | | | | | | | | | The new ``cmQtAutoGenInitializer::InfoWriter`` class provides an interface to write strings/vectors/sets/maps in CMake format into a file. Its use replaces various `cmJoin` calls that failed to address escaping of semicolons in list elements. Closes #18554
* | Autogen: Add support for global ``autogen`` and ``autorcc`` targetsSebastian Holtermann2018-11-111-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches CMake the variables - CMAKE_GLOBAL_AUTOGEN_TARGET - CMAKE_GLOBAL_AUTOGEN_TARGET_NAME - CMAKE_GLOBAL_AUTORCC_TARGET - CMAKE_GLOBAL_AUTORCC_TARGET_NAME which control the generation of global ``autogen`` and ``autorcc`` targets. Closes #17721
* | Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS supportSebastian Holtermann2018-11-031-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds - the variable ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` which initializes - the target property ``AUTOGEN_ORIGIN_DEPENDS`` which controls whether or not the origin target dependencies should be forwarded to the corresponding ``_autogen`` target. The default value of ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` is ``ON`` which corresponds to the behavior that is in place since CMake 3.9. Closes: #18493
* | add_dependencies: Track backtraces internallyBrad King2018-10-181-2/+3
| | | | | | | | | | Record backtraces for "utility" dependencies created by `add_dependencies` calls.
* | cmLocalGenerator: Remove AddCompileDefinitions methodBrad King2018-10-101-1/+1
|/ | | | | | | This method offers the same definitions as `GetTargetDefines` except that it excludes the "export" macro on shared libraries. Update call sites to use `GetTargetDefines` instead. Some of them were incorrectly excluding the export macro.
* cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-1/+1
|
* Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-2/+1
| | | | Use the new IsOn(),IsOff() overloads.
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-2/+2
|
* Autogen: Use integers to store the Qt versionSebastian Holtermann2018-08-131-52/+57
|
* Autogen: Initializer: Group variables in structsSebastian Holtermann2018-08-131-133/+147
|
* cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-2/+2
| | | | | | | | | | | | | | | After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
* Autogen: For Qt5 pass all implicit include directories to mocSebastian Holtermann2018-07-301-3/+5
| | | | | | | | | | | | | For Qt4 it was not possible to pass all compiler implicit include directories to moc because it couldn't handle some system headers. For reference see commit 753b905ec86ffe369d4f59a7a8ced5fedc42939f, commit d2536579d51e77827b8e55f39123316324314781 and [QTBUG-28045](https://bugreports.qt.io/browse/QTBUG-28045). For Qt5's moc the problem does not persist anymore so we can (and should) pass all implicit include directories to moc. Fixes #18041
* Autogen: Split initializer main methodSebastian Holtermann2018-07-301-541/+557
|
* Autogen: Compute variables in Init stage instead of Setup stageSebastian Holtermann2018-07-301-156/+171
|