25962 Commits

Author SHA1 Message Date
Brad King
7700df9b1e CMake 3.14.3 2019-04-22 07:42:52 -04:00
Brad King
db02be85a0 VS: Provide the default platform name to project code
The value of `CMAKE_VS_PLATFORM_NAME` is computed by Visual Studio
generators based on `CMAKE_GENERATOR_PLATFORM` or some default.
Prior to the VS 2019 generator, the default was always `Win32`.
However, for the `Visual Studio 16 2019` generator, the default is
based on the host platform.

Store the default in a new `CMAKE_VS_PLATFORM_NAME_DEFAULT` variable for
use by project code.  This is particularly useful in toolchain files
because they are allowed to set `CMAKE_GENERATOR_PLATFORM` and so
`CMAKE_VS_PLATFORM_NAME` is not yet known.  Of course the toolchain file
author knows whether it will set `CMAKE_GENERATOR_PLATFORM`, and if not
then `CMAKE_VS_PLATFORM_NAME_DEFAULT` provides the platform name that
will be used.

Fixes: #19177
2019-04-19 07:46:13 -04:00
Brad King
5e98111643 CMake 3.14.2 2019-04-12 08:02:19 -04:00
Brad King
6a39d3df54 Merge branch 'fix-overlay-icon-windows' into release-3.14
Merge-request: !3217
2019-04-11 14:04:54 -04:00
Julien Jomier
12ef832c96 cmake-gui: Fix icon overlay on windows
Since commit 9175a378f5 (QtDialog: Add windows taskbar progress,
2018-11-17, v3.14.0-rc1~330^2) we've added a missing overlay icon.
This results in Windows falling back to a default overlay icon.
Simply drop this line.

Fixes: #19160
2019-04-11 14:03:29 -04:00
Brad King
7bad2464fc Merge branch 'xcode-extra-sources' into release-3.14
Merge-request: !3208
2019-04-11 10:35:49 -04:00
Brad King
428c1e429f Xcode: Avoid mutating App Bundle targets during generation
For `MACOSX_BUNDLE` targets we generate an `Info.plist` automatically
and add it to the sources presented to Xcode.  Avoid mutating the
original target's list of sources to achieve this.  Otherwise when we
generate the same target again (e.g. in a sub-project's Xcode file) it
will look different than the first time and possibly break invariants.

Fixes: #19114
2019-04-11 10:35:14 -04:00
Brad King
b4385d5ccc Xcode: Factor out duplicate source group code into lambda 2019-04-11 10:35:14 -04:00
mistersandman
fce03306ee cmake-gui: Fix theme on Windows with Qt >= 5.10
In Qt 5.10 the theme support moved to a separate QWindowsVistaStyle
plugin.

Issue: #19147
2019-04-08 13:30:05 -04:00
Brad King
3c9dec0bdc CMake 3.14.1 2019-03-29 09:22:46 -04:00
Brad King
04c0efd4b7 Merge branch 'implicit-includes-autogen' into release-3.14
Merge-request: !3159
2019-03-29 08:48:39 -04:00
Sebastian Holtermann
a8b7cbb787 Autogen: Do not treat hard-coded -I/usr/include exclusion as implicit include
The `cmLocalGenerator::GetIncludeDirectoriesImplicit` method is called
by `cmQtAutoGenInitializer` to get the compiler's list of implicit
include directories.  Since commit 557b2d6e65 (Fix regression in
-I/usr/include exclusion logic, 2019-02-13, v3.14.0-rc2~6^2~2) the
method hard-codes exclusion of `/usr/include` for historical reasons.
However, it should not be reported as a real implicit include directory
unless the compiler really has it.

Refactor the logic to distinguish the hard-coded exclusion of
`/usr/include` from the real list of implicit include directories.

Fixes: #19100
2019-03-28 14:07:24 -04:00
Brad King
52bb1760ff Merge branch 'backport-kwsys-SystemTools-copy-self' into release-3.14
Merge-request: !3145
2019-03-27 14:22:52 -04:00
Brad King
9cf64bb101 Merge branch 'jacoco_parser_crash' into release-3.14
Merge-request: !3147
2019-03-27 14:20:45 -04:00
Sylvain Joubert
1d16eae868 ctest_coverage: fix out-of-bounds index in Jacoco parser
When the current source file is not found the FilePath variable was left
with the previous path content. In case the previous file had less lines
than the current one and there are 'line' entries for the current one
with higher number we ended up in a buffer overflow while indexing the
previous file entry with a line number higher.  By clearing the
FilePath, the empty() guard triggers correctly on an empty path and it
avoid modifying the wrong data.
2019-03-26 11:50:30 -04:00
Brad King
ce180cf810 cmake: Fix '-E copy foo .' to avoid clobbering file
Backport KWSys commit 92334e7670 (SystemTools: CopyFileAlways: avoid
copying file over self, 2019-03-25) to the CMake 3.14 release branch.

Fixes: #19075
2019-03-26 10:51:47 -04:00
Brad King
c22a2b49af Merge branch 'toolchain-include_directories' into release-3.14
Merge-request: !3140
2019-03-25 11:50:06 -04:00
Brad King
588fa1bb9e Restore support for include_directories() in toolchain files
Any `include_directories()` calls in toolchain files are used during our
ABI detection step even though it does not include any system headers.
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2), that check is also used
to detect implicit include directories.  Any `include_directories()` in
a toolchain file are detected as implicit and later excluded from
explicit specification on compiler command lines, thus breaking the
purpose of the calls in the first place.

Fix the implicit include directory detection step to avoid using paths
from `include_directories()` calls in the toolchain file.

Fixes: #19079
2019-03-25 11:48:17 -04:00
Brad King
9603e418e5 Merge branch 'eclipse-interface-lib' into release-3.14
Merge-request: !3125
2019-03-20 10:54:24 -04:00
Brad King
d3dcf8d774 Eclipse: Fix extra generator to not crash on interface libraries
Do not process interface libraries in ways that expect build information
to be present internally.  This filtering was left out of the extra
generator accidentally when interface libraries were introduced, but it
worked by accident until commit 76ad2ecb50 (Order SYSTEM include
directories after non-system directories, 2018-04-13, v3.12.0-rc1~179^2)
added a code path that was not tolerated.

Fixes: #18363
2019-03-20 10:52:31 -04:00
Brad King
5b6c6c2d80 Merge branch 'find_program-windows-share' into release-3.14
Merge-request: !3105
2019-03-14 14:52:12 -04:00
Brad King
00c4ddf75e find_program: Restore leading double slash on Windows network path
Since commit c76c1ea208 (find_program: Consider CWD only for paths with
separator, 2018-05-31, v3.13.0-rc1~413^2) we accidentally convert the
leading `//` to just `/` on results with Windows network paths.

This was caused by `CollapseCombinedPath` being less robust than
`CollapseFullPath`.  Restore use of the latter but in a way that
preserves the requirement of the above commit to support candidates that
are themselves absolute.

Fixes: #19049
Issue: #19050
2019-03-14 14:46:23 -04:00
Brad King
5c50eeaffc VS: Fix x64 host recognition by x86 cmake process
In commit 57e48f16f2 (VS: Add Visual Studio 16 2019 generator,
2019-01-09, v3.14.0-rc1~150^2) and commit 0fd742a6ff (VS: Teach VS 2019
generator to select host tools matching host arch, 2019-01-28,
v3.14.0-rc1~63^2) we intended to select the `x64` target architecture
and `x64` host tools by default on x64 host machines.  Fix detection
of a x64 host when CMake itself is a 32-bit x86 process.

The KWSys SystemInformation `Is64Bits` member is not set correctly,
which led to this bug.  Pending investigation on the KWSys side,
simply test ourselves via `IsWow64Process`.
2019-03-14 13:19:18 -04:00
Brad King
bf02d62532 CMake 3.14.0 2019-03-14 09:08:05 -04:00
Brad King
f3cedf381e VS: Revert "Use MSBuild matching toolset host architecture"
Revert commit da402a081b (VS: Use MSBuild matching toolset host
architecture, 2019-01-28, v3.14.0-rc1~50^2).  Multiple people have
reported that the 64-bit `amd64/msbuild` tool fails in cases that the
32-bit `msbuild` works.  Drop our change pending further investigation
and hopefully a fix to VS.

Fixes: #18904, #19037
Issue: #18219
2019-03-12 12:53:06 -04:00
Brad King
f96f1aa571 CMake 3.14.0-rc4 2019-03-08 07:34:57 -05:00
Brad King
0e2804b9ba Merge branch 'cxx-checks-warning-match' into release-3.14
Merge-request: !3075
2019-03-07 15:00:26 -05:00
Brad King
4ca5a815f2 C++ feature checks: Match warnings more strictly
Require the word "warning" to appear at the start of a line, after
whitespace, or after a `:`.  This is the same that CTest launchers use
to match warnings.  It avoids matching "warning" inside file paths.

Fixes: #19019
2019-03-07 14:55:54 -05:00
Brad King
c042c998d0 Merge branch 'install-no-imported-global' into release-3.14
Merge-request: !3071
2019-03-07 09:17:21 -05:00
Brad King
47389c5641 install: Do not crash on imported global target
Since commit e89ad0f94e (install: Allow installing targets created in
another directory, 2018-06-18, v3.13.0-rc1~407^2) the `install(TARGETS)`
command may find a global-scoped target outside the calling directory.
Ignore an `IMPORTED GLOBAL` target if it is found in this way.  Imported
targets cannot be installed, and trying to do so violates internal
invariants.

Fixes: #19022
2019-03-07 09:00:56 -05:00
Brad King
898d21ebe6 Merge branch 'vs-explicit-newline' into release-3.14
Merge-request: !3065
2019-03-06 09:43:27 -05:00
Luca Cappa
0bf4418017 VS: Encode newlines in XML attributes
Encode `\n` as `
` to avoid generating a literal newline inside an
XML attribute.  This is more readable and also fixes custom commands in
`.csproj` files with VS 2019 RC.

Fixes: #19001
2019-03-06 09:37:21 -05:00
Brad King
0b82f56ac6 VS: Fix Fortran target type selection with RC sources
The Intel Fortran `.vfproj` files do support both Fortran and the
Windows Resource compiler (`.rc)` files.  Prior to CMake 3.9 we did not
support that, but commit 2c9f35789d (VS: Decide project type by linker
lang as fallback, 2017-03-30, v3.9.0-rc1~340^2) accidentally enabled it.
It was then broken by commit d3d2c3cd49 (VS: Fix Fortran target type
selection when linking C++ targets, 2019-02-04, v3.14.0-rc1~13^2).

Restore support for Fortran+RC in VS projects and add a test case.

Fixes: #19002
2019-03-01 11:58:21 -05:00
Brad King
20a41aa589 CMake 3.14.0-rc3 2019-03-01 09:25:27 -05:00
Brad King
338e32b3b8 Merge branch 'cuda_device_link_handle_frameworks' into release-3.14
Merge-request: !3039
2019-03-01 08:02:11 -05:00
Robert Maynard
d5d1b15654 CUDA: Filter out -framework arguments during device linking
The filter in commit e768d96c74 (CUDA: Filter out host link flags during
device linking, 2018-10-22, v3.13.0-rc2~4^2~2^2) removes `-framework`
but not the framework name that comes after it.  Revise the logic to
remove both.

Fixes: #18911
2019-02-28 14:56:11 -05:00
Brad King
71852e969b Merge branch 'vs2019' into release-3.14
Merge-request: !3044
2019-02-28 13:25:51 -05:00
Brad King
00c1120837 VS: Drop workaround needed only for VS 2019 preview 2 and 3
A temporary workaround added by commit 626c51f47b (VS: Update for Visual
Studio 2019 Preview 2, 2019-01-24, v3.14.0-rc1~74^2) is no longer needed
as of VS 2019 preview 4.

Fixes: #18898
2019-02-28 11:04:29 -05:00
Brad King
18731d60ac Merge branch 'backport-check-std-size-cbegin-cend' into release-3.14
Merge-request: !3030
2019-02-27 11:32:31 -05:00
Mathieu Garaud
e17deb7ad4 Extend C++17/C++14 feature checks to cover more standard library APIs
Make sure `std::cbegin`, `std::cend`, and `std::size` work in C++17 or
C++14 mode before choosing the corresponding standard level for
compiling CMake itself.  This helps in cases that the compiler is using
a standard library too old to support the full standard level chosen.
2019-02-27 11:24:43 -05:00
Brad King
f369d59cdd Merge branch 'cmake_role-vs-fix' into release-3.14
Merge-request: !3028
2019-02-27 08:05:55 -05:00
Kyle Edwards
4b95e7fe63 CMAKE_ROLE: Fix value in --build for Visual Studio generators
Fixes: #18990
2019-02-26 14:52:17 -05:00
Brad King
3106cf4e3d include_external_msproject: Restore support for EXCLUDE_FROM_ALL
In commit dc6888573d (Pass EXCLUDE_FROM_ALL from directory to targets,
2019-01-15, v3.14.0-rc1~83^2) all `AddNewTarget` call sites were updated
to copy the directory-level `EXCLUDE_FROM_ALL` into the target property
of the same name, except that the one for `include_external_msproject`
was incorrectly missed.  Add it now.

Furthermore, refactoring in commit b99129d2d8 (ENH: some code cleanup,
2007-03-12, v2.6.0~2020) accidentally set the `EXCLUDE_FROM_ALL` target
property of `include_external_msproject`-generated targets to `FALSE`
instead of simply leaving it unset.  This was not necessary but had no
effect until the above commit gave it a meaning.  Drop that.

Fixes: #18986
2019-02-26 10:20:01 -05:00
Brad King
6ebe40c6ae Merge branch 'remove-exclude-from-all-warning' into release-3.14
Merge-request: !3002
2019-02-22 11:19:09 -05:00
Craig Scott
d3b765d451 EXCLUDE_FROM_ALL: Don't warn if installing target excluded from all
The original warning pre-dates support for install components.
There are now legitimate scenarios where an install(TARGETS)
command may list a target that is excluded from all, e.g.
hierarchical projects that will never install the component such a
target belongs to.

Fixes: #18938
2019-02-22 07:55:56 +11:00
Brad King
c925166764 Merge branch 'link-options' into release-3.14
Merge-request: !2996
2019-02-20 14:32:37 -05:00
Marc Chevrier
98a2d42301 PIE link options: No warning when policy CMP0083 is not set.
Fixes: #18955
2019-02-20 14:30:57 -05:00
Brad King
c36bf6b13c Merge branch 'fix-implicit-includes-fortran' into release-3.14
Merge-request: !2994
2019-02-20 08:57:20 -05:00
Brad King
3dc81a48ff Fortran: Do not suppress explicit use of implicit include directories
Since commit 2e91627dea (ParseImplicitIncludeInfo: add Fortran implicit
include handling, 2019-01-25, v3.14.0-rc1~73^2) we actually populate
`CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES` for the first time.  This
value may be useful to project code to pass to other tooling that wants
to preprocess the way Fortran does, so we should compute the value.
However, compilers like `gfortran` do not actually search their own
implicit include directories for `.mod` files.  The directories must be
passed via `-I` in order for `.mod` files in them to be found.

Since Fortran has no standard library header files that we need to avoid
overriding, it is safe to *not* filter out implicit include directories
from those passed explicitly via `-I` options.  Skip this filtering so
that include directories specified by project code to find `.mod` files
will be searched by the compiler even if they happen to be implicitly
searched by the preprocessor.

Fixes: #18914
2019-02-20 08:13:57 -05:00
Brad King
0794dd3018 Merge branch 'autogen_cache_binary_checks' into release-3.14
Merge-request: !2990
2019-02-19 13:29:48 -05:00