Now that the working directory is in the build tree, relative input
paths must be converted to an absolute path to remain relative to the
source directory.
Fixes: #19472
Avoid listing the same input more than once in custom commands generated
in `.vcxproj` and `.csproj` files. In the case of a `.vcxproj` file
additionally avoid listing the source to which the command is attached
since it is already implicitly a dependency.
This is a nice cleanup and also works around a VS 2019 16.1 regression
in MSBuild dependency checking. Starting with that version, MSBuild now
re-builds custom commands when the list of dependencies has changed.
However, its check is confused by duplicate dependencies.
De-duplicating them avoids this problem.
Co-Author: Brad King <brad.king@kitware.com>
Fixes: #19303
Entries of the `CPATH` environment variable are implicitly searched as
include directories by some C/C++ compilers. Since commit 5990ecb741
(Compute implicit include directories from compiler output, 2018-12-07,
v3.14.0-rc1~108^2) these entries are detected by CMake and included in
the `CMAKE_{C,CXX}_IMPLICIT_INCLUDE_DIRECTORIES` variables.
However, we should not exclude them from explicit specification via `-I`
or particularly `-isystem` because they are meant as user-specified
include directories that can be re-ordered without breaking compiler
builtin headers. In particular, we need explicit requests via
`include_directories` with the `SYSTEM` option to result in `-isystem`
so that third-party headers do not produce warnings.
Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
Fixes: #19291
Drop the sentence added by commit 5a5a1d90f0 (Help: FindThreads not
needed with modern C++., 2019-01-09, v3.14.0-rc1~186^2) about not
needing the module with modern C++. The module is often still needed.
Fixes: #19297
Add a note about the fix in commit 3d3713121b (target_link_libraries:
Fix static library private deps in other dirs, 2019-04-30). Also
reference the equivalent note already added to the 3.13.5 notes.
When building for iOS, the compiled target is placed into a bundle.
If a single-configuration generator is used, like Makefiles or Ninja,
the try_compile FILE_COPY behavior fails to find the bundle, because
it only looks for the bundle inside a Debug subfolder (presumably
to support a multi-configuration generator like Xcode).
Consider looking for the bundle in the root try_compile folder, as
well as in the location specified by CMAKE_TRY_COMPILE_CONFIGURATION.
Closes: #19211
On macOS ranlib truncates the fractional part of the static achive
file modification time. If the archive and at least one contained
object file were created within the same second this will make look
the archive older than the object file. On subsequent ninja runs
this leads to re-achiving and updating dependent targets.
As a work-around we touch the archive after ranlib.
Closes: #19222
Remove the 1.67 upper-bound on compiler feature computation so that with
newer versions we at least get it mostly right. Leave a comment with
notes about updating features for future versions.
In commit a1ad0a699b (target_link_libraries: Allow use with targets in
other directories, 2018-09-07, v3.13.0-rc1~94^2) we accidentally broke
the logic that adds `$<LINK_ONLY:...>` to private dependencies of static
libraries in their `INTERFACE_LINK_LIBRARIES` in the case that the
dependency is added from outside the directory creating the library.
The check for a valid target name should apply to the original name
specified by the caller and not the encoded cross-directory reference.
Fixes: #19197
Restore path suffixes incorrectly removed by commit a62d50ec56 (Modules:
Replace coded PATHS with PATH_SUFFIXES, 2017-11-20, v3.11.0-rc1~293^2).
Hints do not participate in the usual bin/lib subdirectory search that
`<PackangeName>_ROOT` or `CMAKE_PREFIX_PATH` exhibit.
Fixes: #19185
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
The Gentoo case added by commit 1673923c30 (FindBoost: Add support for
Boost 1.67 with Python version suffixes, 2018-03-18, v3.11.0~3^2) left
out the `.` version component separator and instead duplicated the RPM
case. Add the missing `.` now.
Fixes: #18743
VS 2019 Update 1 will fix its redist directories to be named `VC142`
instead of `VC141`. It will also use cl `19.21` instead of `19.20`
so we can use that to distinguish the versions.
Fixes: #19131