Commit Graph

9117 Commits

Author SHA1 Message Date
Brad King
cd71d7f663 Merge topic 'doc-if-AND-OR'
41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6970
2022-02-10 09:11:13 -05:00
Brad King
5593a5d978 Merge topic 'clang-cross-compile-windows-pdb'
641cb1093b Windows/Clang: Support PDB when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6959
2022-02-10 09:09:10 -05:00
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
Brad King
41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions
The wording update in commit b74819e4fe (Help: Format 'if' command
documentation, 2013-12-18, v3.0.0-rc1~227^2~1) incorrectly implied that
`AND` has higher precedence than `OR`.  Although this is common in many
languages, it has never been true in CMake's implementation.  Revise
the wording to clarify the precedence.

Add a test case demonstrating the order.

Fixes: #23207
2022-02-09 14:24:43 -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
Brad King
419eb2349a Merge topic 'test-vcs'
7b23fd6c1b Tests: Run CTest.UpdateBZR tests only if explicitly enabled
7cf5355d5e Tests: Add cache entries to control ExternalProject test VCS tools
c8b29dc5b9 Tests: Add cache entries to control existence of CTest.Update* tests
a70864e300 Tests: Make condition for CTest.UpdateCVS match pattern of other tools
1972a75536 Tests: Drop CTestUpdate.BZR test check for xmloutput plugin
f2566f6416 Tests: Drop unnecessary check for FindCVS module
530242576c Tests: Remove always-true condition enabling CTest.Update* tests
4e88a4228e Tests: Remove unused CVS tool discovery

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6956
2022-02-09 08:54:38 -05:00
Deniz Bahadir
641cb1093b Windows/Clang: Support PDB when cross-compiling 2022-02-09 00:38:09 +01:00
Brad King
8fa592a5f2 Merge topic 'GoogleTest-discover-type-params'
073dd1bd81 GoogleTest: Change format for typed tests
f28f738bd2 GoogleTest: Fix type param tests for suites with many cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6958
2022-02-08 08:35:19 -05:00
Brad King
5bf6e57a12 Merge topic 'GoogleTest-discover-type-params' into release-3.23
073dd1bd81 GoogleTest: Change format for typed tests
f28f738bd2 GoogleTest: Fix type param tests for suites with many cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6958
2022-02-08 08:35:18 -05:00
Brad King
7b23fd6c1b Tests: Run CTest.UpdateBZR tests only if explicitly enabled
These tests have not been automatically enabled on current
versions of `bzr` in a long time.  The recent change to
drop the `xmlplugins` heuristic caused the tests to start
running on some machines, but they do not work everywhere.
Disable the tests again pending further investigation.
2022-02-08 08:17:39 -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
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
Evgeniy Shcherbina
073dd1bd81 GoogleTest: Change format for typed tests
Before it would output a typed test as follows:
  Suit/Type.Case
And now it would be:
  Suit.Case<Type>

In case of NO_PRETTY_TYPES it would simply use the type number
instead of its text representation:
  Suit.Case<0>

The change is introduced to make sure CTest outputs tests in a
similar fashion which is "*Suit.Case*" and angle brackets "<>"
emphasize that we are dealing with a typed (template) kind.
2022-02-07 12:53:17 -05:00
Evgeniy Shcherbina
f28f738bd2 GoogleTest: Fix type param tests for suites with many cases
When there were many cases (two digits or more) the "prettier" would
fail to recognize the pretty part leaving the test name unprocessed.
The fix made sure the processing would work correctly, irrespective
of the case number.

Before the fix, for the following input:
TypedSuite/1.  # TypeParam = int
  case
TypedSuite/10.  # TypeParam = char
  case
The output would be:
TypedSuite/int.case
TypedSuite/10.  # TypeParam = char.case

Now the output will be:
TypedSuite/int.case
TypedSuite/char.case
2022-02-07 12:53:16 -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
Brad King
7cf5355d5e Tests: Add cache entries to control ExternalProject test VCS tools
Add undocumented `CMake_TEST_ExternalProject_*` cache entries to
explicitly enable or disable these tests.  If not set, compute defaults
as before.  Also consolidate the VCS default heuristics.
2022-02-07 11:53:29 -05:00
Brad King
c8b29dc5b9 Tests: Add cache entries to control existence of CTest.Update* tests
Add undocumented `CMake_TEST_CTestUpdate_*` cache entries to explicitly
enable or disable these tests.  If not set, compute defaults as before.
2022-02-07 11:53:29 -05:00
Brad King
a70864e300 Tests: Make condition for CTest.UpdateCVS match pattern of other tools 2022-02-07 11:53:28 -05:00
Brad King
1972a75536 Tests: Drop CTestUpdate.BZR test check for xmloutput plugin
Current `bzr` tools do not have any `bzr xmlplugins` command.
2022-02-07 11:53:28 -05:00
Brad King
f2566f6416 Tests: Drop unnecessary check for FindCVS module 2022-02-07 11:53:28 -05:00
Brad King
530242576c Tests: Remove always-true condition enabling CTest.Update* tests 2022-02-07 11:53:26 -05:00
Brad King
4e88a4228e Tests: Remove unused CVS tool discovery
Since commit b819ee85c0 (BUG: Oops. Left chunk of junk at the bottom of
the main Tests CMakeLists.txt file..., 2009-07-24, v2.8.0~385) the
`do_cvs_tests` variable is not used in `Tests/CMakeLists.txt`.
2022-02-07 11:51:40 -05:00
Brad King
c308000ca1 Merge topic 'test-ctest_build-subdir-target'
e485dca1e8 Tests: Move CTest.BuildCommand.ProjectInSubdir into RunCMake.ctest_build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6953
2022-02-07 11:48:26 -05:00
Brad King
e2e9a4b4c9 Merge topic 'test-download-server-timeout'
8809183d58 Tests: Optionally extend RunCMake.ExternalProject download server timeout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6952
2022-02-07 11:46:55 -05:00
Brad King
e485dca1e8 Tests: Move CTest.BuildCommand.ProjectInSubdir into RunCMake.ctest_build
The former duplicates code that is now part of the infrastructure in the
latter.  The latter can also explicitly verify the results.
2022-02-04 08:34:27 -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
cf68f52875 Merge topic 'ep-patch-USES_TERMINAL'
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6940
2022-02-04 08:18:13 -05:00
Brad King
01b89d2547 Merge topic 'ep-patch-USES_TERMINAL' into release-3.23
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6940
2022-02-04 08:18:12 -05:00
Brad King
56aac8cf50 Merge topic 'GoogleTest-discover-spaces-in-parameters'
fd6b8fa40e GoogleTest: Preserve spaces in test parameters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6941
2022-02-04 08:13:07 -05:00
Brad King
c8a955584d Merge topic 'GoogleTest-discover-spaces-in-parameters' into release-3.23
fd6b8fa40e GoogleTest: Preserve spaces in test parameters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6941
2022-02-04 08:13:06 -05:00
Brad King
deb27767e0 Merge topic 'test-mfc-explicit'
9d621ceba1 Tests: Run MFC test only when explicitly enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6943
2022-02-04 08:08:24 -05:00
Brad King
3900a31f44 Merge topic 'test-mfc-explicit' into release-3.23
9d621ceba1 Tests: Run MFC test only when explicitly enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6943
2022-02-04 08:08:23 -05:00
Brad King
8809183d58 Tests: Optionally extend RunCMake.ExternalProject download server timeout
Some of the `RunCMake.ExternalProject` test cases use a download server
implemented in Python.  Normally we wait up to 30 seconds for it to
start.  However, on some machines running many tests concurrently, the
download server may take longer than that to start.  Add an undocumented
cache entry to use on those machines to extend the timeout.
2022-02-04 07:15:40 -05:00
Aron Yu
feebc8394f Windows: Allow manifest files to be bundled as content 2022-02-04 10:16:55 +01: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
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
43acc8e3c7 Merge topic 'ci-minor-cleanups'
040c509bce gitlab-ci: clarify name of windows fragment for building with ninja
bd14f07ce9 Tests: Skip Clang PCH_INSTANTIATE_TEMPLATES test in MSVC ABI
c26b064b8c Tests: Suppress MSVC CRT deprecation warnings in pseudo_llvm-rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6947
2022-02-03 09:57:46 -05:00
Brad King
8d4e353ede Merge topic 'ci-minor-cleanups' into release-3.23
040c509bce gitlab-ci: clarify name of windows fragment for building with ninja
bd14f07ce9 Tests: Skip Clang PCH_INSTANTIATE_TEMPLATES test in MSVC ABI
c26b064b8c Tests: Suppress MSVC CRT deprecation warnings in pseudo_llvm-rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6947
2022-02-03 09:57:45 -05:00
Craig Scott
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword
This brings the patch step into line with all the others which already
had their own `USES_TERMINAL_<step>` keyword. All steps (including
patch) already have their own `LOG_<step>` keyword too, so the lack of
`USES_TERMINAL_PATCH` was inconsistent.
2022-02-03 09:27:35 -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
9d621ceba1 Tests: Run MFC test only when explicitly enabled
Previously we used a complicated heuristic to decide whether or not to
run the MFC test, but it sometimes decided incorrectly to run the test.
Since that was first written, we have developed a convention for other
tests to enable them via undocumented cache entries that are added only
on machines known to meet the tests' requirements.  Do that for MFC.
2022-02-03 06:45:53 -05:00
Evgeniy Shcherbina
fd6b8fa40e GoogleTest: Preserve spaces in test parameters
Before the fix the gtest_discover_tests() function would strip the
user data in test parameters (everything to the right of GetParam())
of spaces. Now the parameters aren't altered in any way.

Fixes #23058
2022-02-03 14:12:53 +03:00
Kyle Edwards
c18409cdac CMakePresets.json: Ensure configurePreset is reachable from current file 2022-02-02 15:17:30 -05:00
Brad King
bd14f07ce9 Tests: Skip Clang PCH_INSTANTIATE_TEMPLATES test in MSVC ABI 2022-02-02 15:02:51 -05:00