Commit Graph

9920 Commits

Author SHA1 Message Date
Alex Lapenkou
136622a2b2 file(GET_RUNTIME_DEPENDENCIES): propagate transitive parent's rpath
This fixes incorrect runtime dependency resolution when the dependency
is located in rpaths of a transitive parent.  Instead of supplying only
the rpaths of the immediate parent, it combines the rpaths of all
transitive parents and passes them down.

Fixes: #24172
2022-12-02 09:00:06 -05:00
Brad King
4aa3149c67 Tests: Simplify RunCMake.file-GET_RUNTIME_DEPENDENCIES case cleaning 2022-11-29 17:47:38 -05:00
Brad King
14cf3b1039 Merge topic 'file-archive-zstd-compression-level'
ed519b1cba file(ARCHIVE_CREATE): Allow higher compression level for Zstd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7924
2022-11-17 08:15:04 -05:00
Brad King
311695e319 Merge topic 'test-FindBoost-python-versions'
6b1f933cb8 Tests: Update FindBoost.TestPython for Python 3.11 and 3.12

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7929
2022-11-17 08:06:19 -05:00
Brad King
6b1f933cb8 Tests: Update FindBoost.TestPython for Python 3.11 and 3.12
Follow up the python 3.11 and 3.12 support from:

* commit 43844c5d82 (FindPython: Add support for Python 3.11,
                     2021-12-07, v3.22.2~20^2)
* commit ca2877c039 (FindPython: add support for Python 3.12,
                     2022-05-11, v3.23.2~15^2)

with an update for the FindBoost test.
2022-11-16 14:34:07 -05:00
Brad King
d59f861e42 Merge topic 'test-genex-TARGET_PROPERTY'
11b21ae14a Tests: Move some cases to RunCMake.GenEx-TARGET_PROPERTY
a4d0e4ff8f Tests: Prepare RunCMake.GenEx-TARGET_PROPERTY for more independent cases
e855ed7fde Tests: Rename RunCMake.TargetPropertyGeneratorExpressions for consistency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7918
2022-11-16 09:37:06 -05:00
Brad King
48d52c2cfe Merge topic 'file-copy-error-path'
89b144789d file(COPY_FILE): Report if failure occurred on input or output path
91dd7898ee Merge branch 'upstream-KWSys' into file-copy-error-path
a9c659b1b6 KWSys 2022-11-15 (6c92b9b0)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !7916
2022-11-16 09:36:29 -05:00
Amir Masoud Abdol
ed519b1cba file(ARCHIVE_CREATE): Allow higher compression level for Zstd
This allows the Zstd compression-level to be set between 0-19.  I've
adjusted some of the tests, and error messages to indicates the selected
algorithm, and min/max of its compression-level.

Fixes: #24160
2022-11-16 09:15:01 -05:00
Brad King
b686b58208 Merge topic 'cmp0141-pch-reuse'
94164ea55e CMP0141: Fix PCH REUSE_FROM when MSVC_DEBUG_INFORMATION_FORMAT is empty

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7914
2022-11-16 08:57:04 -05:00
Brad King
11b21ae14a Tests: Move some cases to RunCMake.GenEx-TARGET_PROPERTY
Move some `TARGET_PROPERTY` cases from `RunCMake.GeneratorExpression`.
2022-11-15 10:45:21 -05:00
Brad King
a4d0e4ff8f Tests: Prepare RunCMake.GenEx-TARGET_PROPERTY for more independent cases
The existing cases all need to enable a language.  Move this out of the
`CMakeLists.txt` file and into the individual cases to make room for
other cases that may not need this.
2022-11-15 10:34:00 -05:00
Brad King
e855ed7fde Tests: Rename RunCMake.TargetPropertyGeneratorExpressions for consistency
Rename the test to `RunCMake.GenEx-TARGET_PROPERTY` for consistency with
the other `RunCMake.GenEx-*` test names.
2022-11-15 10:24:07 -05:00
Brad King
89b144789d file(COPY_FILE): Report if failure occurred on input or output path
When we know whether a failure was associated with the input or the
output path, include this information in the error message.
2022-11-15 09:28:45 -05:00
Brad King
eda68d229d Merge topic 'cmake-E-copy-t-mode'
8d9069e5b6 cmake -E copy: Add support for -t argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7913
2022-11-15 09:14:07 -05:00
Brad King
3379723239 Merge topic 'test-isolate-ctest-env'
e46a9d79fc Tests: Isolate more RunCMake cases from external ctest environment values
3b6c1c1a3b Tests: Factor out RunCMake ctest environment isolation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7909
2022-11-15 09:11:10 -05:00
Brad King
6f9544736a Merge topic 'better_handling_of_build_args'
01611f8258 cmake: --build improve detection of no build dir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7908
2022-11-15 08:55:19 -05:00
Brad King
82e49021fe Merge topic 'top-level-command-order'
59573bf5b9 project: Warn at top-level if `cmake_minimum_required` wasn't called
23f3dd9f7c RunCMake/project: Ignore exact line number in stderr checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7902
2022-11-15 08:51:20 -05:00
Kyle Edwards
8d9069e5b6 cmake -E copy: Add support for -t argument
Fixes: #23543
2022-11-15 07:47:07 -05:00
Brad King
94164ea55e CMP0141: Fix PCH REUSE_FROM when MSVC_DEBUG_INFORMATION_FORMAT is empty
Under the policy's NEW behavior, `[CMAKE_]MSVC_DEBUG_INFORMATION_FORMAT`
may be explicitly set to an empty string to tell CMake not to add any
flags for this abstraction.  In this case, fall back to checking the
language-wide flags as we do in the OLD behavior.

This revises commit 183b9a9eca (CMP0141: Fix PCH REUSE_FROM under policy
NEW behavior, 2022-10-31, v3.25.0-rc3~4^2).

Issue: #24106
2022-11-15 06:57:02 -05:00
Brad King
e46a9d79fc Tests: Isolate more RunCMake cases from external ctest environment values
Fix a few RunCMake cases that were running `ctest` without isolating it
from external environment values that affect its behavior.

Fixes: #24153
2022-11-14 11:08:45 -05:00
Brad King
3b6c1c1a3b Tests: Factor out RunCMake ctest environment isolation
Some RunCMake tests unset some environment variables that affect ctest's
behavior before running it.  Any test using the RunCTest helper needs to
do this, so do it in the helper itself.

Issue: #24153
2022-11-14 11:05:56 -05:00
Robert Maynard
01611f8258 cmake: --build improve detection of no build dir
Fixes #24157
2022-11-14 10:46:17 -05:00
Brad King
84eebdf18e Tests: Teach CheckSourceTree test to clean up more specific known files
Extend the list of files added by commit 2de1458c3c (Tests: Teach
CheckSourceTree test to clean up some specific known files, 2022-10-13).
2022-11-14 10:35:06 -05:00
Brad King
4bf832086a Merge topic 'ci-windows-arm64'
09c1b1db07 gitlab-ci: Add windows-arm64 native jobs for Ninja and VS
61ebd7d083 ci: Download cmake on windows-arm64
93a5d89b42 ci: Teach cmake download script on Windows to branch on host architecture
1ccffcf0ea ci: Factor out helper to load python into environment on Windows
781303c0e2 ci: Factor out helper to load qt into environment on Windows
b0d16c7f74 Tests: Fix CTest.UpdateGIT under repo-local defaultBranch config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !7905
2022-11-14 10:20:32 -05:00
Brad King
38c8866dd1 Merge topic 'msvc-19.34-cpp-modules'
0e9782b336 msvc: bless MSVC 19.34 support for C++ modules as experimental

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7745
2022-11-14 10:18:21 -05:00
Ben Boeckel
0e9782b336 msvc: bless MSVC 19.34 support for C++ modules as experimental
Visual Studio 17.4 now contains official support for what CMake needs.
2022-11-11 16:54:05 -05:00
friendlyanon
59573bf5b9 project: Warn at top-level if cmake_minimum_required wasn't called
The top-level project() call will now issue an AUTHOR_WARNING if it
wasn't called after cmake_minimum_required().

Fixes: #24071
2022-11-11 22:49:36 +01:00
Brad King
b0d16c7f74 Tests: Fix CTest.UpdateGIT under repo-local defaultBranch config
The default branch detection added by commit 26ec2e2b0c (Tests: Update
CTest.UpdateGIT test for custom defaultBranch, 2020-12-02,
v3.20.0-rc1~355^2) fails if the test is run inside a Git work tree whose
`.git` directory configures a `defaultBranch` that is different from the
global or system-wide value.  Fix the detection to ignore the locally
configured value so that we match the `git init` decision.
2022-11-11 15:05:01 -05:00
friendlyanon
23f3dd9f7c RunCMake/project: Ignore exact line number in stderr checks 2022-11-11 16:16:52 +01:00
Brad King
b0f02511e5 Merge topic 'ci-clang15-windows'
46b2849550 ci: Update LLVM/Clang to 15.0 in nightly CI jobs on Windows
3eb94e4d51 ci: Simplify LLVM/Clang CI job specs on Windows
8ba5835c8d ci: Factor out helper to load clang into environment on Windows
bf2e4a2e85 ci: Factor out helper to load ninja into environment on Windows
93ff726114 Tests: Fix TryCompile bad source case for clang-cl 15 on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7897
2022-11-11 08:26:32 -05:00
Brad King
93ff726114 Tests: Fix TryCompile bad source case for clang-cl 15 on Windows
When `pass.c bad#source.c` passes through `nmake`, the compiler gets
`pass.c bad`.  The clang-cl 15 compiler now fails on `bad` with an
error that we did not previously match.  Update our regex.
2022-11-10 12:57:55 -05:00
Brad King
566064ea5e Merge topic 'better-file-download-failure-msg'
8c3cf2716a file(DOWNLOAD EXPECTED_HASH): better error message when download failed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7888
2022-11-10 10:08:54 -05:00
Aurelien Regat-Barrel
8c3cf2716a file(DOWNLOAD EXPECTED_HASH): better error message when download failed 2022-11-09 22:44:36 +01:00
Ilia K
3166547cf6 ASM_MARMASM: Add support for Microsoft ARM assembler language
https://learn.microsoft.com/en-us/cpp/assembler/arm/arm-assembler-reference

Fixes: #23999
2022-11-09 10:22:46 -05:00
Brad King
ce4babb566 Tests: Fix ARM64 test conditions for non-VS generators 2022-11-09 10:22:46 -05:00
Brad King
16cb04dbe9 Merge topic 'file-set-file-api'
b3e9fb67bb file-api: support exporting file set information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7867
2022-11-09 09:34:40 -05:00
Brad King
9758dbd9d4 Merge topic 'use_folders_on_by_default'
d3acd22380 USE_FOLDERS: Treat as on by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Amir Masoud Abdol <amirmasoudabdol@icloud.com>
Merge-request: !7830
2022-11-08 14:28:21 -05:00
Ben Boeckel
b3e9fb67bb file-api: support exporting file set information
This includes listing the filesets themselves as well as which file set
(if any) each source file is associated with.

Fixes: #24128
2022-11-08 10:07:10 -05:00
Brad King
ebeb9ce406 Merge topic 'test-intel-remarks'
b2d030e8fe Tests: Teach RunCMake to ignore Intel -Rdebug-disables-optimization remarks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7366
2022-11-08 10:04:34 -05:00
Juan Ramos
d3acd22380 USE_FOLDERS: Treat as on by default
Add a policy to treat the `USE_FOLDERS` global property as ON by default
if it is not set.

Fixes: #21695
2022-11-08 09:32:18 -05:00
Brad King
7e0c00c251 Merge topic 'googletest-addtests-skipped'
f54963e60f GoogleTest: Reports skipped test with gtest_add_tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7868
2022-11-08 09:18:01 -05:00
Brad King
a0ad3209b5 Merge topic 'find-version-vars'
9e3f1723ff Find{BZip2,LibLZMA,ZLIB}: use *_VERSION as modern CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !7877
2022-11-08 09:04:43 -05:00
Brad King
eee0c6ec0d Merge topic 'block-var-scope'
96ddcbee60 cmState: Clarify name of member tracking the active scope in a directory
cb53d9309e block: Fix variable scope protection from modification by subdirectories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7885
2022-11-08 09:00:14 -05:00
Michael Hirsch
9e3f1723ff Find{BZip2,LibLZMA,ZLIB}: use *_VERSION as modern CMake
The old *_VERSION_STRING is silently left set for backward compat.
2022-11-07 16:22:31 -05:00
Brad King
cb53d9309e block: Fix variable scope protection from modification by subdirectories
When `cmStateSnapshot::RaiseScope` raises a variable in to a parent
directory scope, it uses `GetBuildsystemDirectoryParent` to find the
current top-most scope on the directory's stack.  Since commit 3f4e5e8c3d
(cmState: Return end snapshot for GetBuildsystemDirectoryParent.,
2015-09-01, v3.4.0-rc1~100^2~1), that depends on the `DirectoryEnd`
field in the directory's state.  However, when variable-only scopes were
added by commit 6954c8936f (cmState: Add a VariableScope snapshot type.,
2015-08-01, v3.4.0-rc1~179^2~1), we neglected to account for the
addition of that field by commit 52dbe654de (cmState: Record the end
position of each directory., 2015-08-01, v3.4.0-rc1~251^2~1).

Prior to commit 44a2f3f332 (Add new flow-control commands for variables
and policies scopes management, 2022-08-05, v3.25.0-rc1~257^2) this
problem went unnoticed because there was no way to have a variable scope
at the top of a directory's stack while processing a subdirectory. Now
the `block()/endblock()` commands enable the behavior, so fix tracking
of a variable scope as the top-most scope in a directory.

Fixes: #24138
2022-11-07 14:24:24 -05:00
Brad King
4ac37b8a0e Merge topic 'ExternalProject-INSTALL_BYPRODUCTS'
8c6b2928f4 ExternalProject: Add `INSTALL_BYPRODUCTS` option
6d6baffb85 Tests: Fix ExternalLibraryWithSubstitution test
4bcfff2df3 ExternalProject: Clarify `BYPRODUCTS` docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7866
2022-11-07 08:57:13 -05:00
Brad King
4e047870bc Merge topic 'CheckCompilerFlag-Swift'
2d5403ecaa CheckCompilerFlag: Add Swift Support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7865
2022-11-07 08:52:25 -05:00
DavidPerretSN
f54963e60f GoogleTest: Reports skipped test with gtest_add_tests
Skipped GTests were reported as success when tests where added with gtest_add_tests. This fixes this behaviour.

Fixes: #24130
2022-11-07 10:21:30 +01:00
Alois Klink
8c6b2928f4 ExternalProject: Add INSTALL_BYPRODUCTS option
Add an `INSTALL_BYPRODUCTS` option to `ExternalProject_Add` that can
be used to declare that files are `BYPRODUCTS` of the ExternalProject
install step.

This is often required by the Ninja generator to explicitly declare
dependencies. Previously, many users used `BUILD_BYPRODUCTS`, even if
their files were created by the install step, not the build step.

This commit essentially just copies the code for `BUILD_BYPRODUCTS`.

Fixes: #24120
Fixes: #23056
2022-11-05 16:26:45 +00:00
Evan Wilde
2d5403ecaa CheckCompilerFlag: Add Swift Support
Plumb through Swift `check_compiler_flag` support.
Add tests to check that valid flags work and invalid flags don't.
2022-11-04 09:32:06 -07:00