Commit Graph

120 Commits

Author SHA1 Message Date
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
Sebastian Holtermann
e7280a7f17 AUTOGEN: Rename config variables
The new names describe the variables use cases better.
2017-01-10 12:49:15 +01:00
Sebastian Holtermann
63d3ca4c1c AUTOGEN: Make skipMoc and skipUic blacklists behave the same way
Before skipMoc was a list of files that were not included in the
sources. Now the skipMoc files are added to the sources as well in case
they are needed for uic processing. skipMoc becomes a blacklist just like
skipUic.
2017-01-10 12:49:15 +01:00
Sebastian Holtermann
df74f3ff83 QtAutogen: Generate rcc output file names in one place only 2016-12-07 08:24:04 -05:00
Sebastian Holtermann
bafbeaf190 QtAutogen: Add rcc output files to autogen target byproducts 2016-12-07 08:24:03 -05:00
Sebastian Holtermann
8f437f3c35 QtAutogen: Add moc compilation file to autogen target byproducts
Closes: #16389
2016-12-07 08:24:03 -05:00
Sebastian Holtermann
360c342711 QtAutogen: Reconfigure when .qrc file changes
Add .qrc files to the CMake depends.
When the .qrc file changes the build system gets reconfigured
and the resource files watch list gets updated.
2016-12-07 08:24:03 -05:00
Sebastian Holtermann
b5409d04f1 QtAutogen: Rename autogen target to *_autogen from *_automoc 2016-12-07 08:24:02 -05:00
Sebastian Holtermann
d9996aab74 QtAutogen: Inline single use variable definitions 2016-12-07 08:24:02 -05:00
Sebastian Holtermann
b770b85d6c QtAutogen: Determine the Qt major version in only one way 2016-12-07 08:24:01 -05:00
Sebastian Holtermann
5c3dc7460e QtAutogen: Clean removes autogen build directory
Cleaning removes the entire autogen build directory instead
of single files.
2016-12-07 08:24:01 -05:00
Sebastian Holtermann
8c9358386b QtAutogen: Generate included ui_ and moc_ files in _automoc/includes
ui_ and moc_ files that are include in source files get generated in
$CURRENT_BUILD_DIR/$TARGETNAME_automoc/include.
The directory is added to the INCLUDE_DIRECTORIES of the origin target
in the generation stage.

From now on all autogen files get generated below
$CURRENT_BUILD_DIR/$TARGETNAME_automoc.
2016-12-07 08:24:01 -05:00
Sebastian Holtermann
057ac11bfb QtAutogen: Use checksum based subdirectories to avoid name collisions 2016-12-07 08:24:00 -05:00