29696 Commits

Author SHA1 Message Date
Stephen Kelly
9bc6eb8e1f cmGlobalGenerator: Initialize generator targets on construction (#15729)
The Ninja generator and Visual Studio generators are special-cased for the
QtAutogen feature.  In order to reduce the number of custom targets, the Visual
Studio generators prefer to create custom commands instead, and in order to
create appropriate Ninja files, generated rcc files are listed as byproducts.

This requires the use of the GetConfigCommonSourceFiles API of the
cmGeneratorTarget for those generators when initializing the autogen target.
The initializer method is called from Compute() after the cmGeneratorTarget
objects are created, however the initialization of the object directory occurs
later in the InitGeneratorTargets method.  That means that the resulting object
locations are computed incorrectly and cached before the object directory is
determined, so the generated buildsystem can not find the object files.

The initialization of the object directory was split from the creation of
cmGeneratorTarget instances in commit 0e0258c8 (cmGlobalGenerator: Split
creation of generator object from initialization., 2015-07-25).  The motivation
for the split was to do only what is essential to do early in cases where
cmGeneratorTargets need to be created at configure-time.  That is required for
the purpose of implementing policies CMP0024 and CMP0026, and for
try_compile(LINK_LIBRARIES).  However, the split was not really necessary.

Compute the object directory in the cmGeneratorTarget constructor instead.

The QtAutogen unit test already tests the use of TARGET_OBJECTS with AUTOMOC,
and that test already passes on Ninja.  The reason it already passes is that
the QtAutogen target also uses the AUTORCC feature, and specifies several qrc
files in its SOURCES.  Later in the Compute algorithm (after the
InitGeneratorTargets call), the rcc files are determined and target->AddSource
is called.  The AddSource call clears the previously mentioned cache of source
files, causing it to be regenerated when next queried, this time taking account
of the object directory.

Extend the test suite with a new target which does not make use of AUTORCC with
qrc files so that the test added alone would break without the fix in this
commit.
2015-09-29 09:56:34 -04:00
Stephen Kelly
1fe390201d QtAutogen: Port away from cmLocalGenerator. 2015-09-29 09:56:23 -04:00
Stephen Kelly
59a729b2be QtAutogen: Split initializer class into separate file. 2015-09-29 09:56:23 -04:00
Stephen Kelly
1e83a963d8 QtAutogen: Split initializer methods into separate class. 2015-09-26 19:32:54 +02:00
Stephen Kelly
12f0e13c5f QtAutogen: Simplify generator initialization API. 2015-09-26 19:32:54 +02:00
Stephen Kelly
65ff75d3f5 QtAutogen: Remove unnecessary dereference. 2015-09-26 19:32:54 +02:00
Stephen Kelly
64b78c147f QtAutogen: Move Source initialization to prior loop.
Ensure that all targets have their _automoc.cpp before attempting
to initialize the autogen target.  The initialization evaluates
generator expressions for target sources, and must include the
_automoc.cpp of object library dependents in order for TARGET_OBJECTS
to include the object file for the corresponding _automoc.cpp file.
2015-09-26 19:32:53 +02:00
Stephen Kelly
c3c20d3ce3 QtAutogen: Add _automoc.cpp sources before initializing. 2015-09-26 19:32:53 +02:00
Stephen Kelly
8b6ec29d40 QtAutogen: Move initialization condition to caller. 2015-09-26 19:32:53 +02:00
Stephen Kelly
9470b056fc QtAutogen: Move condition to prior loop. 2015-09-26 19:32:53 +02:00
Stephen Kelly
b7491b1cda QtAutogen: Move condition to prior loop. 2015-09-26 19:32:52 +02:00
Stephen Kelly
e791c85419 QtAutogen: Make some methods static. 2015-09-26 19:32:52 +02:00
Stephen Kelly
6210ec644a QtAutogen: Make internal method private. 2015-09-26 19:32:52 +02:00
Stephen Kelly
a3ceb998d7 QtAutogen: Don't use members to initialize automoc targets. 2015-09-26 19:32:50 +02:00
Stephen Kelly
dced2fe10f QtAutogen: Rename variable. 2015-09-26 19:21:49 +02:00
Stephen Kelly
f9a77e76e4 QtAutogen: Don't use a member to store skipped uic files. 2015-09-26 18:48:23 +02:00
Stephen Kelly
c3633e7a41 QtAutogen: Add missing includes and forward declarations. 2015-09-26 18:48:23 +02:00
Brad King
414cc18a9a Merge topic 'revert-cmake-W-options'
2e606306 Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options
81739e92 Revert topic 'cmake-W-options' (#15747)
2015-09-25 16:16:17 -04:00
Brad King
02f95f9b7c Merge topic 'fix-try_compile-internal-argv'
710bde43 cmCoreTryCompile: Fix internal argument vector construction
2015-09-25 10:12:42 -04:00
Brad King
5a83303f50 Merge topic 'install-directory-dest-genex'
bd189cc2 install: Allow generator expressions in DIRECTORY DESTINATION
2015-09-25 10:12:40 -04:00
Brad King
910ea21004 Merge topic 'Threads-CXX'
fff9434d FindThreads: officially announce it works with only C++ enabled
66db914a FindThreads: fix printing a pointer value in test code
0b38424c FindThreads: make the call to try_run() work also if only C++ is enabled
9924a212 FindThreads: replace CheckIncludeFiles by CheckIncludeFile
a27bc0cc Check(Function|Library|Symbol)Exists: make it work if only C++ is enabled
7279f293 FindThreads: add simple testcase
2015-09-25 10:12:37 -04:00
Brad King
ede54544f1 Merge topic 'fix-max-path-initialization'
8bfff686 cmLocalGenerator: Compute object max path on construction.
2c2479fb cmGlobalGenerator: Create all local generators after Configure().
194bb068 cmGlobalGenerator: Remove unused method.
c5f07e05 cmGlobalGenerator: Create local generators after all makefiles configured.
dd408de4 cmGlobalGenerator: Create local generator after configuring the makefile.
8a88089b cmMakefile: Create the local generator after configuring the makefile.
934aa454 Makefiles: Remove need to create local generator at configure time.
61b48e70 Makefiles: Port to cmOutputConverter.
2015-09-25 10:12:35 -04:00
Rolf Eike Beer
fff9434d45 FindThreads: officially announce it works with only C++ enabled 2015-09-25 10:08:35 -04:00
Rolf Eike Beer
66db914adf FindThreads: fix printing a pointer value in test code
This causes a warning in C mode, and entirely fails in C++ mode:

CMake/Modules/CheckForPthreads.c: In function ‘runner’:
CMake/Modules/CheckForPthreads.c:34:27: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      printf("%d CC: %d\n", (int)args, cc);
                            ^
Use %p to print out a pointer value, which will not cause any problems.
2015-09-25 10:08:06 -04:00
Rolf Eike Beer
0b38424cf2 FindThreads: make the call to try_run() work also if only C++ is enabled
This isn't enough to make the whole module work with only C++ enabled.
2015-09-25 10:08:05 -04:00
Rolf Eike Beer
9924a212f6 FindThreads: replace CheckIncludeFiles by CheckIncludeFile
While at it, also add a branch using CheckIncludeFileCXX. Also give a better
error message if no supported language is enabled. C++ support isn't working
yet, but it has never worked.
2015-09-25 10:08:05 -04:00
Rolf Eike Beer
a27bc0ccac Check(Function|Library|Symbol)Exists: make it work if only C++ is enabled 2015-09-25 10:07:54 -04:00
Kitware Robot
7c0b22a84e CMake Nightly Date Stamp 2015-09-25 00:01:06 -04:00
Brad King
710bde43aa cmCoreTryCompile: Fix internal argument vector construction
In TryCompileCode we construct an internal argv[] vector that needs to
have a fake argv[0] so our internal cmake command line looks like a real
command line.  Fix construction of the fake argv[0] when try_compile is
called without the CMAKE_FLAGS argument.  Otherwise the first internal
-DVAR=val argument that we use to pass information like
CMAKE_OSX_SYSROOT is ignored.
2015-09-24 15:26:32 -04:00
Brad King
cbfae8c3f2 Merge topic 'install-files-dest-genex'
69ab5f55 Tests: Cover install(FILES) with a genex DESTINATION
17aa6fd3 install: Allow generator expressions in FILES DESTINATION
2015-09-24 10:28:54 -04:00
Robert Goulet
bd189cc24e install: Allow generator expressions in DIRECTORY DESTINATION 2015-09-24 09:13:03 -04:00
Stephen Kelly
8bfff68642 cmLocalGenerator: Compute object max path on construction. 2015-09-24 09:39:39 +02:00
Stephen Kelly
2c2479fbed cmGlobalGenerator: Create all local generators after Configure(). 2015-09-24 09:39:39 +02:00
Stephen Kelly
194bb06803 cmGlobalGenerator: Remove unused method. 2015-09-24 09:39:39 +02:00
Stephen Kelly
c5f07e0537 cmGlobalGenerator: Create local generators after all makefiles configured. 2015-09-24 09:39:38 +02:00
Stephen Kelly
dd408de46b cmGlobalGenerator: Create local generator after configuring the makefile. 2015-09-24 09:39:38 +02:00
Stephen Kelly
8a88089bbe cmMakefile: Create the local generator after configuring the makefile.
The local generator is not used during configure time.
2015-09-24 09:39:38 +02:00
Stephen Kelly
934aa454d0 Makefiles: Remove need to create local generator at configure time.
This method is used during try_compile.
2015-09-24 09:39:38 +02:00
Stephen Kelly
61b48e70bc Makefiles: Port to cmOutputConverter. 2015-09-24 09:39:38 +02:00
Kitware Robot
02ccef2ae5 CMake Nightly Date Stamp 2015-09-24 00:01:05 -04:00
Brad King
69ab5f5502 Tests: Cover install(FILES) with a genex DESTINATION 2015-09-23 14:41:52 -04:00
Robert Goulet
17aa6fd362 install: Allow generator expressions in FILES DESTINATION 2015-09-23 14:37:17 -04:00
Brad King
c3b3284c93 Merge topic 'vs-target-ordering'
40c7b461 VS: Fix rebuild with regeneration after input CMake code change (#15754)
03bfe71a VS: Refactor target ordering logic
2015-09-23 09:23:01 -04:00
Brad King
3779716616 Merge topic 'cpack-package-empty-dirs'
b761e90d CPack: remove accidental changes
2015-09-23 09:22:59 -04:00
Brad King
20ed8bbd02 Merge topic 'fix-forced-toolchain-dialect'
d1375851 Project: Don't require computed default dialect if compiler was forced.
2015-09-23 09:22:57 -04:00
Domen Vrankar
b761e90d70 CPack: remove accidental changes
Remove changes accidentally included in commit b58de9fe (CPack: allow
packaging of empty directories, 2015-09-22).
2015-09-23 09:15:57 -04:00
Kitware Robot
44f2ade2cb CMake Nightly Date Stamp 2015-09-23 00:01:05 -04:00
Stephen Kelly
d13758514c Project: Don't require computed default dialect if compiler was forced.
Commit 7235334a (Project: Determine default language dialect for the
compiler., 2015-09-15) introduced a mechanism to determine the default
dialect used for the running compiler.  If conditions in
the <CompilerId>-<Lang>.cmake file are such that compile features for
that version of the compiler should be supported, the _DEFAULT_STANDARD
is set to the computed value.

However, the CMakeForceCompiler module allows users to bypass execution of the
compiler by CMake.  In that case, do not set the _DEFAULT_STANDARD variable at
all, which effectively disables the compile-features where the module is used.

No compile features have ever been recorded where the module is used so no
functionality is lost.
2015-09-22 22:13:15 +02:00
Brad King
2e6063068c Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options
Resolve conflicts in

 Help/variable/CMAKE_ERROR_DEPRECATED.rst
 Help/variable/CMAKE_WARN_DEPRECATED.rst

by integrating changes from both sides.
2015-09-22 13:57:08 -04:00
Brad King
81739e9215 Revert topic 'cmake-W-options' (#15747)
The changes in commit c96fe0b4 (cmake: Add -W options to control
deprecation warnings and errors, 2015-07-28) fail to account for
-Wdev warnings produced by places in CMake other than message().
This causes a regression in which -Wno-dev fails to suppress such
warnings.  Revert the feature until it can be revised accordingly.
2015-09-22 13:53:09 -04:00