Commit Graph

132 Commits

Author SHA1 Message Date
Sebastian Holtermann d8d064abbc Autogen: Use the same algorithm for RCC and UIC option merging 2017-09-07 17:53:19 +02:00
Sebastian Holtermann 37714f884b Autogen: Replace cmsys::SystemTools:: with cmSystemTools:: 2017-09-07 17:53:19 +02:00
Sebastian Holtermann d1e5eb8497 Autogen: Iterate source files only once
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.
2017-09-07 17:53:18 +02:00
Daniel Pfeifer 2b4c32c95f clang-format: format all code as Cpp11 2017-08-30 11:07:05 -04:00
Daniel Pfeifer ca2233e31f IWYU: Mark cmConfigure.h with pragma: keep
Also remove `#include "cmConfigure.h"` from most source files.
2017-08-26 07:41:04 +02:00
Daniel Pfeifer 5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Sebastian Holtermann 0f2e178f65 Autogen: Don't use cmMakefile::GetQtUiFilesWithOptions
The purpose of this patch is to allow later removal of
AUTOGEN specific variables in cmMakefile and cmSourceFile.
2017-08-22 19:10:32 +02:00
Sebastian Holtermann 727247c316 Autogen: Read skip files from makefile
This allows to pass SKIP_AUTOMOC hints to the
FOO_autogen target from files that are not listed
in the target sources.

The problem was that if main.cpp was listed in the source
but not main.h, then SKIP_AUTOMOC for main.h was ignored.
2017-08-22 18:43:34 +02:00
Sebastian Holtermann 1eb1b409c2 Autogen: Remove VS specific code exclusion
The amount of disabled code was small.
Also the #ifdef tests were confusing and made
testing on non Windows machines more difficult.
2017-08-22 18:43:34 +02:00
Sebastian Holtermann 54ec2a8bcf Autogen: Initializer file type scanning optimizations 2017-08-22 17:13:59 +02:00
Sebastian Holtermann cf7b3b9671 Autogen: Initializer optimizations and cleanups 2017-08-22 17:13:59 +02:00
Sebastian Holtermann 93f0ba2823 Autogen: Add AUTOMOC_MACRO_NAMES support
Closes #17176
2017-08-18 12:32:04 +02:00
Sebastian Holtermann 362f9bd755 Autogen: Merge and remove redundant function calls 2017-08-10 18:48:15 +02:00
Sebastian Holtermann 952fc65d14 Autogen: Clear sources meta data cache
Adds cmGeneratorTarget::clearSourcesCache() which clears the cache
of precomputed sources lists and object names. The cache gets
recomputed on demand.

Clearing the cache is necessary in case an OBJECT library
gets a source added after a target (ORIGIN) that includes it
computed it's external sources cache.
This may happen in AUTOMOC when ORIGIN is processed before the
OBJECT library which gets a mocs_compilation.cpp file added.

Closes #17152
Closes #17139
Closes #17085
Closes #15967
2017-08-10 18:33:02 +02:00
Sebastian Holtermann a13716a5dc Autogen: Enable per-config support
Enables the AUTOGEN per-config include directories and wrapper sources
for multi configuration generators.

Closes #16460
2017-08-05 14:37:03 +02:00
Sebastian Holtermann 6d83757f26 Autogen: Generate rcc wrapper file on demand
For multi configuration generators remove per-config
qrc_FOO_$<CONFIG>.cpp source file support.
Instead use a single source file qrc_FOO.cpp which is a wrapper
that includes the actual rcc generated qrc_FOO_CONFIG.cpp file.

This way, after a repeated configuration change, only the wrapper file
qrc_FOO.cpp must be regenerated to include the appropriate
qrc_FOO_CONFIG.cpp file.
2017-08-05 14:21:50 +02:00
Sebastian Holtermann 74a1b8ebde Autogen: Fix configuration suffix initialization
The configuration suffix was used before it was initialized.
2017-08-05 12:46:10 +02:00
Sebastian Holtermann e2c9cf12d1 Autogen: Remove per-config suffix for mocs_compilations.cpp 2017-08-05 12:08:14 +02:00
Sebastian Holtermann 7fa9c55019 Autogen: Forward target dependencies to *_autogen target
Only the dependecies from target_link_libraries() of the origin
target were forwarded to the _autogen target. This patch
adds forwarding of the dependencies from add_dependencies()
to the _autogen target.

Closes #17094
2017-07-28 12:40:18 +02:00
Sebastian Holtermann dca5df16c5 Autogen: Process GENERATED files. Add CMP0071.
This lets AUTOMOC and AUTOUIC process GENERATED files which
used to be ignored before.
A new policy CMP0071 ensures that the old behavior of ignoring
GENERATED files is enabled when the CMake compatibility version
CMAKE_MINIMUM_REQUIRED is < 3.10.

Closes #16186
2017-07-18 18:11:31 +02:00
Brad King 9a34e95a41 Autogen: Skip generated files for compatibility with CMake 3.8
The change in commit v3.9.0-rc1~464^2~8 (Autogen: Add AUTOMOC/UIC
support for generated source files, 2017-03-02) changes behavior of
existing projects that may not expect `AUTOGEN` on generated files and
do not yet set `SKIP_AUTOGEN` on them.  Disable the behavior change for
now to fix the regression for CMake 3.9.  We can restore it later with a
policy.

In order to keep the implementation and tests working, add an
undocumented property we can use in the tests to enable the behavior
before the policy is introduced.

Fixes: #17031
Issue: #16186
2017-07-07 10:12:15 -04:00
Brad King cc1b513df1 Autogen: Do not use per-config file suffixes with VS yet
The change in commit v3.9.0-rc1~42^2~1 (Autogen: Per-config file
suffixes, 2017-05-15) broke Visual Studio builds because the generators
do not yet fully support per-config sources.  Disable the behavior on
Visual Studio generators for now.

Fixes: #16939
2017-06-07 09:41:49 -04:00
Brad King ed77c5c5bd cmQtAutoGeneratorInitializer: Remove unused local variable 2017-05-30 13:27:36 -04:00
Brad King f8642f953d Merge topic 'reduce-string-copying'
2c2bb5f5 Remove unnecessary operator<< usage
1e4e2f99 Remove unused variables
25486156 Improved checking for number of arguments passed
86dc86dd Add const-reference qualifications
76bdb407 Change std::basic_string<char> to std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !886
2017-05-28 09:13:12 -04:00
Pavel Solodovnikov 86dc86dd6c Add const-reference qualifications 2017-05-26 19:50:11 +03:00
Sebastian Holtermann dbda590628 Autogen: Per-config file suffixes. New AUTOGEN_BUILD_DIR target property.
Closes #14760
Closes #14313
2017-05-26 15:27:17 +02:00
Sebastian Holtermann 0965002e57 Autogen: Pass build directory in Info file 2017-05-26 15:23:21 +02:00
Brad King 2b7aecba16 Merge topic 'autogen-fixes'
09035319 Autogen: Pass explicit predefines header to moc if possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !671
2017-04-21 08:43:43 -04:00
Aleix Pol 0903531964 Autogen: Pass explicit predefines header to moc if possible
Qt is relying on whoever calls moc to include a file with the predefined
values that will be used by the compiler, otherwise moc takes wrong
paths and weird things happen.
Instead, generate an include file and feed it to all mocs to make sure
it's generating correct code.

Co-Author: Sebastian Holtermann <sebholt@xwmw.org>
Fixes: #16640
2017-04-20 08:59:07 -04:00
Brad King a4452fd82d cmGlobalVisualStudioGenerator: Drop VS7 enumeration value
We no longer support the VS 7.0 (.NET 2002) IDE, so drop the enumeration
value corresponding to its version.
2017-04-19 14:54:57 -04:00
Daniel Pfeifer 1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Daniel Pfeifer e9fc7ff505 Add self-sufficient wrapper for <sys/stat.h> 2017-03-24 22:58:25 +01:00
Daniel Pfeifer 72ea66b1cf Autogen: include what you use 2017-03-23 23:20:10 +01:00
Sebastian Holtermann af1354d6c1 Autogen: Add AUTOGEN_SOURCE_GROUP support
Closes: #16501
2017-03-16 11:52:20 +01:00
Sebastian Holtermann ea3bc1e5b0 Autogen: Add AUTOMOC/UIC support for generated source files
Closes #16186
Closes #14379
2017-03-06 22:01:03 +01:00
Sebastian Holtermann e3af6bec67 Autogen: Initializer cleanups 2017-03-06 22:01:02 +01:00
Sebastian Holtermann 699321bfd5 Autogen: Add support for generated .qrc files 2017-03-06 22:01:02 +01:00
Sebastian Holtermann a28ae16e3c Autogen: Embrace qrc file lists in braces in AutogenInfo.cmake
This allows empty .qrc files in any list position.
2017-03-06 22:01:02 +01:00
Sebastian Holtermann 0d9a5baa0e Autogen: Remove unused variables 2017-03-06 22:01:02 +01:00
Sebastian Holtermann 47dbe9267e Autogen: Add cmQtAutogeneratorCommon class with shared types and functions 2017-03-06 22:01:02 +01:00
Sebastian Holtermann 3bf28f5ed0 Autogen: New short InfoGet functions 2017-03-02 09:10:03 -05:00
Sebastian Holtermann 1cdf7c1be2 Autogen: Add AUTOUIC_SEARCH_PATHS support
Closes #15227
2017-03-02 09:10:01 -05:00
Sebastian Holtermann 70ebf35cda Autogen: Add AUTOMOC_DEPEND_FILTERS support 2017-02-22 21:13:48 +01:00
Sebastian Holtermann 9d1db7d7c3 Autogen: Overhaul and simplify AutogenInfo.cmake file generation 2017-02-21 10:38:50 -05:00
Sebastian Holtermann 0ab817fa1e Autogen: Optimize GetCompileDefinitionsAndDirectories function 2017-02-21 10:38:50 -05:00
Sebastian Holtermann 754d431813 Autogen: Sort AutogenInfo.cmake.in
Also rename AM_SKIP_MOC to AM_MOC_SKIP
and AM_SKIP_UIC to AM_UIC_SKIP
2017-02-21 10:38:49 -05:00
Sebastian Holtermann f27c5852b0 Autogen: Initializer: Add old settings file to clean files 2017-01-13 00:00:44 +01:00
Sebastian Holtermann d8e45536fb AUTOGEN: Initializer: Always remember skipped files 2017-01-10 12:49:15 +01:00
Sebastian Holtermann d9313a8290 AUTOGEN: Initializer: Enable SKIP_AUTOGEN on all AUTOGEN generated sources 2017-01-10 12:49:15 +01:00
Sebastian Holtermann 32d3540e09 AUTOGEN: Initializer: Introduce SKIP_AUTOGEN checks 2017-01-10 12:49:15 +01:00