Commit Graph

31934 Commits

Author SHA1 Message Date
Brad King 069d836dab Merge topic 'restore-target-export-includes'
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6969
2022-02-10 09:07:35 -05:00
Kitware Robot df741a36f4 CMake Nightly Date Stamp 2022-02-10 00:01:20 -05:00
Eugene Shalygin 83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION
In commit 55e4753bbb (Refactor cmTargetExport removing
InterfaceIncludeDirecories, 2021-07-20, v3.22.0-rc1~337^2~1) the storage
of `INCLUDES DESTINATION` was moved into each target.  However, a target
may be installed in multiple exports, and their `INCLUDES DESTINATION`
should not be mixed.

Convert the IncludeDirectoriesEntries vector to a map and modify access
function to store the directories lists with respect to cmExportTarget
object. This fixes error when the same target is exported more than once
via different exports and each for consequent export its include
directories list grows. Add a test for this case.

Fixes: #23183
2022-02-09 13:31:26 -05:00
Brad King e40cea3fe9 Merge topic 'genex-LINK_LIBRARY-to-decorate-library'
2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property
42965799b4 Genex: Add $<LINK_LIBRARY:...>
78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse
4b55828a9f cmExpandListWithBacktrace: add handling of empty elements.
28d7432468 cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6769
2022-02-09 09:28:20 -05:00
Brad King 3d5466d5e9 Merge topic 'trace-global-frame'
a41d6e4d7a Trace: add global_frame field to json-v1 format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6954
2022-02-09 09:04:43 -05:00
Brad King 25003baf50 Merge topic 'vs_buildcache_support'
b764c7c273 VS: Add property to turn off Visual Studio compile batching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6957
2022-02-09 08:59:45 -05:00
Kitware Robot d7ee1145a1 CMake Nightly Date Stamp 2022-02-09 00:01:13 -05:00
Brad King 4bd8a35b55 Merge topic 'dotnet_sdk'
5cdd774d51 VS: Handle build target correct for .NET SDK style projects with Any CPU
309191052c VS: Set Visual Studio versions read out from solution file
f7791698cb VS: Allow setting output directory in .NET SDK style projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6944
2022-02-08 08:39:34 -05:00
Marc Chevrier 2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property
To enable the management of incompatible $<LINK_LIBRARY> declarations,
add LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> target
properties.
2022-02-08 11:41:04 +01:00
Kaloyan Donev b764c7c273 VS: Add property to turn off Visual Studio compile batching
Resolves: #23179
2022-02-08 08:07:00 +02:00
Kitware Robot 40c7649a55 CMake Nightly Date Stamp 2022-02-08 00:01:14 -05:00
Marc Chevrier 42965799b4 Genex: Add $<LINK_LIBRARY:...>
This generator expression offers the capability, for the link step, to
decorate libraries with prefix/suffix flags and/or adding any specific flag for each
library.

Fixes: #22812, #18751, #20078, #22703
2022-02-08 00:02:32 +01:00
Braulio Valdivielso Martinez a41d6e4d7a Trace: add global_frame field to json-v1 format
Tools using the json-v1 format might want to trace stack frames across
different `CMakeLists.txt` files, in order to, for example, provide
stacktraces that span from the top-level `CMakeLists.txt` in a
project. One would think that `frame` lets you do that, but it
doesn't, because it tells you the depth of the stack within the
current `CMakeLists.txt`, so it gets reset across calls to
`add_subdirectory`.

The solution involves adding a field with a "global frame". This value
gets incremented on calls to `add_subdirectory`, which makes it easier
for tools to reconstruct "global stacktraces".

I considered changing the current "frame" value, but I didn't because
it would be a breaking change. I cannot think of any use-case where
"frame" is more useful to "global-frame", but maybe I'm missing
something.
2022-02-07 16:03:22 -05:00
Brad King 6b6d0d12a7 Merge topic 'allow_manifest_as_content'
feebc8394f Windows: Allow manifest files to be bundled as content

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6939
2022-02-07 12:19:01 -05:00
Brad King 4cf80f413b Merge topic 'cmcmd-end-of-options-delimiter'
b10930040d cmcmd: add end of options delimiter to cmake -E commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6934
2022-02-07 12:18:03 -05:00
Florian Schweiger 5cdd774d51 VS: Handle build target correct for .NET SDK style projects with Any CPU
* Extend Visual Studio solution parser for reading build target
* Map solution build target to project build target (especially for Any CPU)
* Use C++ <optional> template instead of pointer return value for cmSlnData::GetProjectByGUID
2022-02-07 13:08:37 +01:00
Florian Schweiger 309191052c VS: Set Visual Studio versions read out from solution file 2022-02-07 13:07:40 +01:00
Florian Schweiger f7791698cb VS: Allow setting output directory in .NET SDK style projects 2022-02-07 12:03:03 +01:00
Kitware Robot f93ce447e8 CMake Nightly Date Stamp 2022-02-07 00:01:16 -05:00
Marc Chevrier 78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse 2022-02-06 14:32:24 +01:00
Marc Chevrier 4b55828a9f cmExpandListWithBacktrace: add handling of empty elements. 2022-02-06 14:32:24 +01:00
Marc Chevrier 28d7432468 cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntry
In preparation of support of genex $<LINK_LIBRARY:...>, propagate
cmComputeLinkDepends::LinkEntry instances to ensure to have, when needed,
all attributes attached to the link item.
2022-02-06 14:32:24 +01:00
Kitware Robot 3d91571f79 CMake Nightly Date Stamp 2022-02-06 00:01:08 -05:00
Kitware Robot db7f754487 CMake Nightly Date Stamp 2022-02-05 00:01:15 -05:00
Brad King f84dcbd496 Merge topic 'post-rel-dev'
9a48012f93 Configure CMake itself with policies through CMake 3.22
a5a9687799 export: Increase maximum policy version in exported files to 3.22
a9ffded98c Add deprecation warnings for policies CMP0097 and below

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6948
2022-02-04 08:24:26 -05:00
Brad King 1198a23d5d Merge topic 'vs-simplify-pch'
dd1e2cc80c VS: Simplify generation of per-source PCH settings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6950
2022-02-04 08:19:19 -05:00
Brad King c724e8d2bd Merge topic 'rel-version'
bd11d78dfc Help/dev: Clarify maintainer guide step for DEVEL_CMAKE_VERSION
d184bf0659 Replace DEVEL_CMAKE_VERSION with literal 3.23 release version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6951
2022-02-04 08:06:16 -05:00
Brad King d184bf0659 Replace DEVEL_CMAKE_VERSION with literal 3.23 release version
This was accidentally left out of commit 736663deed (Begin 3.23 release
versioning, 2022-02-03).  The step is documented as part of the release
branching process in the CMake Maintainer Guide `Help/dev/maint.rst`.
2022-02-04 06:44:22 -05:00
Aron Yu feebc8394f Windows: Allow manifest files to be bundled as content 2022-02-04 10:16:55 +01:00
Kitware Robot 32afcf74af CMake Nightly Date Stamp 2022-02-04 00:01:13 -05:00
Peter Würth b10930040d cmcmd: add end of options delimiter to cmake -E commands
Implements a -- delimiter, that indicates the end of options (starting
with a dash -) of a command and separates them from the subsequent
operands (positional arguments).

The following commands are affected:
- env: Implemented the -- delimiter.
- cat: The -- delimiter was already kind of considered, but its
  occurence did not stop the options parsing.
- rm: Here the command already implemented the -- delimiter as
  specified, but it was not documented.

Fixes #22970
2022-02-03 21:54:17 +01:00
Brad King dd1e2cc80c VS: Simplify generation of per-source PCH settings
Avoid looking up the PCH create/use flags just to map them through
flag tables back to the `.vcxproj` settings.  Instead, simply
generate the PCH settings directly for each source file.

Since commit 9df1f33c9a (VisualStudio: move PCH rules to projects when
possible., 2020-10-15, v3.20.0-rc1~638^2) we already do this for the
target-wide PCH settings.
2022-02-03 15:52:22 -05:00
Brad King a5a9687799 export: Increase maximum policy version in exported files to 3.22
The files generatd by `install(EXPORT)` and `export()` commands
are known to work with policies as of CMake 3.22, so enable them
in sufficiently new CMake versions.
2022-02-03 14:13:12 -05:00
Brad King a9ffded98c Add deprecation warnings for policies CMP0097 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.16 and below to encourage projects to port
away from setting policies to OLD.
2022-02-03 14:13:12 -05:00
Brad King 345908b16b Begin post-3.23 development 2022-02-03 09:16:07 -05:00
Brad King 736663deed Begin 3.23 release versioning 2022-02-03 09:12:55 -05:00
Brad King 7077916781 Merge topic 'cmake-ignore-prefix-path'
201d8c4298 find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable
bd805a51ae Refactor: Keep track of prefixes in cmSearchPath

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6880
2022-02-03 07:35:23 -05:00
Brad King 0c0d4e1c7a Merge topic 'cmake-presets-configure-preset-reachability'
c18409cdac CMakePresets.json: Ensure configurePreset is reachable from current file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6937
2022-02-03 07:32:54 -05:00
Kitware Robot fb26581653 CMake Nightly Date Stamp 2022-02-03 00:01:15 -05:00
Kyle Edwards c18409cdac CMakePresets.json: Ensure configurePreset is reachable from current file 2022-02-02 15:17:30 -05:00
Kyle Edwards 201d8c4298 find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable
Fixes: #20878
2022-02-02 11:09:00 -05:00
Kyle Edwards bd805a51ae Refactor: Keep track of prefixes in cmSearchPath 2022-02-02 11:09:00 -05:00
Brad King 9245925810 Merge topic 'cuda_generic_arch_all'
8f64df0a7c CUDA: Generic all and all-major support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6816
2022-02-02 08:23:19 -05:00
Brad King 0f316675cf Merge topic 'dotnet_ref_in_sdk'
5ee3154f65 VS: .Net SDK Style projects can add Reference to dlls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6932
2022-02-02 08:21:16 -05:00
Kitware Robot ece32491ab CMake Nightly Date Stamp 2022-02-02 00:01:17 -05:00
Brad King c138ddb943 Merge topic 'refactor-find-package-cmake-ignore-path'
11f97d1968 find_package(): Refactor CMAKE_[SYSTEM_]IGNORE_PATH
30e5c1d92b find_package(): Add tests for CMAKE_IGNORE_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6918
2022-02-01 12:04:33 -05:00
Raul Tambre 8f64df0a7c CUDA: Generic all and all-major support
Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags,
2021-08-17) added all and all-major options to CUDA_ARCHITECTURES. These are
fairly generic and likely to see real-world use by distributors. Thus it's
desirable to support these also for Clang and older NVCC versions.

The supported architectures are dependent on the toolkit version. We determine
the toolkit version prior to compiler detection. For NVCC we get the version
from the vendor identification output, but for Clang we need to invoke NVCC
separately.

The architecture information is mostly based on the Wikipedia list with the
earliest supported version being CUDA 7.0. This could be documented and
expanded in the future to allow projects to query CUDA toolkit version and
architecture information.
For Clang we additionally constrain based on its support.

Additionally the architecture mismatch detection logic is fixed, improved and
updated for generic support:
* Commit 01428c55 (CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work
  during detection, 2020-08-29) enabled CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS
  if CMAKE_CUDA_ARCHITECTURES is specified. This results in
  CMakeDetermineCompilerID.cmake printing the compiler error and our code for
  presenting the mismatch in a user-friendly way being useless. The custom
  logic seems preferable so go back to not enabling it.
* Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags,
  2021-08-17) tried to support CMP0054 but forgot to add x to the interpolated
  result. Thus the conditions would always evaluate to false. This is fixed as
  a byproduct of removing NVIDIA specific checks, improving the error message
  and replacing architectures_mode with a simpler architectures_explicit.

Visual Studio support omits testing the flags during detection due to
complexities in determining the toolkit version when using it.
A long-term proper implementation would be #23161.

Implements #22860.
2022-02-01 18:25:20 +02:00
Brad King 012ea11ea4 Merge topic 'update-kwsys'
1e242a95d0 Merge branch 'upstream-KWSys' into update-kwsys
7d9204a7e2 KWSys 2022-01-31 (9fd1660a)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6930
2022-02-01 10:38:07 -05:00
Sumit Bhardwaj 5ee3154f65 VS: .Net SDK Style projects can add Reference to dlls
When support for `DOTNET_SDK` was added, only a minimal set of options
were built in. Based on user feedback, support for reference to dlls
(not just projects) is needed. That support is added here.

Fixes: #23166
2022-02-01 07:18:03 -08:00
Kitware Robot 0294570d06 CMake Nightly Date Stamp 2022-02-01 00:01:17 -05:00