1. 15 May, 2019 1 commit
    • Sebastian Holtermann's avatar
      Autogen: Use ADDITIONAL_CLEAN_FILES target property for file cleaning · 4b4fd99f
      Sebastian Holtermann authored
      The `ADDITIONAL_CLEAN_FILES` target property works on multiple generators
      to remove addition files at the clean target.  In `AUTOGEN` use it instead of
      the deprecated and limited `ADDITIONAL_MAKE_CLEAN_FILES` directory property
      to remove `AUTOGEN` generated files.
      
      Fixes: #17074 "Autogen: clean target with ninja generator doesn’t clean
                     autogen files"
      4b4fd99f
  2. 07 May, 2019 1 commit
    • Sebastian Holtermann's avatar
      Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data caching · 7d50e1c6
      Sebastian Holtermann authored
      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"
      7d50e1c6
  3. 06 Apr, 2019 1 commit
  4. 02 Apr, 2019 1 commit
  5. 04 Mar, 2019 1 commit
    • alcroito's avatar
      Autogen: Fallback on internal qrc parser when RCC isn't built yet · bb97a377
      alcroito authored
      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.
      bb97a377
  6. 25 Feb, 2019 2 commits
  7. 21 Feb, 2019 3 commits
  8. 19 Feb, 2019 1 commit
  9. 02 Feb, 2019 2 commits
  10. 01 Feb, 2019 1 commit
  11. 30 Jan, 2019 2 commits
  12. 28 Jan, 2019 2 commits
    • Sebastian Holtermann's avatar
      Autogen: Reenable passing compiler implicit include directories to moc · 03dbb62d
      Sebastian Holtermann authored
      Since commit 5990ecb7 (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
      03dbb62d
    • Sebastian Holtermann's avatar
      cmLocalGenerator: Simplify `GetIncludeDirectories` · f16dfdf7
      Sebastian Holtermann authored
      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.
      f16dfdf7
  13. 23 Jan, 2019 1 commit
  14. 21 Jan, 2019 1 commit
  15. 18 Jan, 2019 1 commit
    • Sebastian Holtermann's avatar
      Autogen: Prepend instead of append `mocs_compilation.cpp` to the sources list · 1ed4d48d
      Sebastian Holtermann authored
      `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
      1ed4d48d
  16. 17 Jan, 2019 1 commit
  17. 16 Jan, 2019 1 commit
  18. 15 Jan, 2019 2 commits
  19. 10 Jan, 2019 1 commit
    • Tobias Hunger's avatar
      Autogen: Add AUTO(MOC|RCC|UIC)_EXECUTABLE target properties · cd32886b
      Tobias Hunger authored
      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.
      cd32886b
  20. 07 Jan, 2019 1 commit
    • Tobias Hunger's avatar
      Autogen: Prepare for Qt 6 · 9045f6a3
      Tobias Hunger authored
      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.
      9045f6a3
  21. 07 Dec, 2018 3 commits
  22. 03 Dec, 2018 1 commit
  23. 28 Nov, 2018 1 commit
  24. 27 Nov, 2018 1 commit
    • Sebastian Holtermann's avatar
      Autogen: Fix empty uic executable string · b1b5004c
      Sebastian Holtermann authored
      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
      b1b5004c
  25. 21 Nov, 2018 1 commit
  26. 14 Nov, 2018 1 commit
  27. 11 Nov, 2018 1 commit
  28. 03 Nov, 2018 1 commit
    • Sebastian Holtermann's avatar
      Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS support · b5e895b5
      Sebastian Holtermann authored
      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
      b5e895b5
  29. 18 Oct, 2018 1 commit
  30. 10 Oct, 2018 1 commit
    • Brad King's avatar
      cmLocalGenerator: Remove AddCompileDefinitions method · 8f076acd
      Brad King authored
      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.
      8f076acd
  31. 18 Sep, 2018 1 commit