Commit Graph

8704 Commits

Author SHA1 Message Date
Brad King
e216b9bbd3 cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable
When no `CMAKE_BUILD_TYPE` is explicitly specified while creating a new
build tree, check for an environment variable of the same name.

Issue: #20983
2021-06-30 10:55:40 -04:00
Brad King
a2f2634a5d Merge topic 'CMP0126-WARNING'
616972197a Merge branch 'backport-3.21-CMP0126-WARNING' into CMP0126-WARNING
16208ac113 CMP0126: Add control for warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6282
2021-06-30 07:32:56 -04:00
Brad King
a63ae2f1b8 Merge topic 'rpm-suggests'
9b53eca317 CPack/RPM: Fix weak dep support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6274
2021-06-30 07:29:29 -04:00
Brad King
85fe60ef03 Merge topic 'tll-out-of-dir'
e27a76f131 target_link_libraries: Restore transitive out-of-dir linking

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6285
2021-06-30 07:27:49 -04:00
Brad King
e27a76f131 target_link_libraries: Restore transitive out-of-dir linking
Refactoring in commit 7f506b95a7 (cmGeneratorTarget: Refactor link item
lookup, 2021-05-26, v3.21.0-rc1~103^2~4) accidentally dropped the
persistent lookup scope tracking across multiple items that was added by
commit f0e67da061 (target_link_libraries: Fix out-of-dir linking of a
list of targets, 2020-01-14, v3.17.0-rc1~149^2).  This broke a
transitive out-of-dir linking case not covered by our test suite.
Restore the scope tracking and add a test case.

Fixes: #22363
2021-06-29 16:52:12 -04:00
Alex Sweet
9b53eca317 CPack/RPM: Fix weak dep support
RPM 4.11.3 for el7 contains backported support for the RPM weak dep tags.
It only supports querying those tags, but rpmbuild can not make use of them.
Since CPack relies on rpmbuild --querytags to check for support, this
commit switches to rpm --suggests to check for support of weak
dependencies.

Fixes: #22350
2021-06-29 11:14:54 -04:00
Brad King
d837efafa5 Merge topic 'test-CTestTestSerialInDepends-lockfile'
a5011a2fbf Tests: Cleanup CTestTestSerialInDepends lockfile at test start

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6273
2021-06-29 09:24:49 -04:00
Brad King
dd6ce26f7e Merge topic 'tests-tolerate-NINJA_STATUS'
63177678d0 Tests/RunCMake/Ninja.*: Sanitize NINJA_STATUS since we expect default behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6271
2021-06-29 09:22:05 -04:00
Marc Chevrier
616972197a Merge branch 'backport-3.21-CMP0126-WARNING' into CMP0126-WARNING 2021-06-29 13:41:10 +02:00
Marc Chevrier
16208ac113 CMP0126: Add control for warnings
Fixes: #22353
2021-06-29 13:36:28 +02:00
NAKAMURA Takumi
63177678d0 Tests/RunCMake/Ninja.*: Sanitize NINJA_STATUS since we expect default behavior
FYI, NINJA_STATUS is "[%f/%t] " by default.
2021-06-28 10:38:05 -04:00
Alex Sweet
a5011a2fbf Tests: Cleanup CTestTestSerialInDepends lockfile at test start
When any test under CTestTestSerialInDepends starts, delete the lockfile
for that test in case it wasn't deleted at the end of the last test run.

Fixes: #22351
2021-06-28 10:32:05 -04:00
Brad King
c8d2e81e09 Merge topic 'target_compile_features-only-apply-to-enabled-languages'
a3cafa4237 compile_features: Ignore features that map to languages that aren't enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6255
2021-06-28 09:26:02 -04:00
Brad King
117b1545a9 Merge topic 'vs2022' into release-3.21
93c718791e VS: Use 64-bit MSBuild in VS 2022
c46b265839 VS: Add Visual Studio 17 2022 generator
b610b7a35c VS: Update v142 CL flag table for VS 17.0 Preview 1
43375c6418 Help: Remove unnecessary Sphinx versionadded markup in VS toolset selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6268
2021-06-28 09:22:38 -04:00
Brad King
be78a9bf68 Merge topic 'vs2022'
93c718791e VS: Use 64-bit MSBuild in VS 2022
c46b265839 VS: Add Visual Studio 17 2022 generator
b610b7a35c VS: Update v142 CL flag table for VS 17.0 Preview 1
43375c6418 Help: Remove unnecessary Sphinx versionadded markup in VS toolset selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6268
2021-06-28 09:22:38 -04:00
Brad King
18881f755b Merge topic 'test-RunCMake.GenEx-names'
a95cbf3890 Tests: Shorten RunCMake.GenEx-* case names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6269
2021-06-28 09:21:16 -04:00
Robert Maynard
a3cafa4237 compile_features: Ignore features that map to languages that aren't enabled
Remove the Cuda/ConsumeCompileFeatures test as it only existed to
validate that using `cxx_std_XY` would cause the paired language (CUDA) to also build in mode XY.
2021-06-25 13:39:50 -04:00
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Brad King
a95cbf3890 Tests: Shorten RunCMake.GenEx-* case names
Reduce the length of the longest path on disk needed by the tests.
2021-06-25 11:29:46 -04:00
Alex Richardson
115ff6a347 cmELF: Include the ELF parsing code unconditionally
Now that the ELF definitions are provided on all platforms there is no
need to keep the CMake_USE_ELF_PARSER option.
2021-06-24 10:57:51 -04:00
Alex Richardson
5dfa3ddbe5 cmELF: Allow building without system ELF headers
Use ELF headers vendored in `Utilities/cmelf` to get the ELF constants
and types. Using the same ELF definition header for all compilation
targets allows removing some #ifdefs depending on the host OS since we
know all required ELF constants will always be present. To reduce the
size of this commit, the CMake_USE_ELF_PARSER definite will be removed
in a separate commit.

This allows me to use CMAKE_BUILD_WITH_INSTALL_RPATH=False and the Ninja
generator on macOS, whereas before it would always give me the following
error message (despite cross-compiling for an ELF-based platform):

```
The install of the <name> target requires changing an RPATH from
  the build tree, but this is not supported with the Ninja generator unless
  on an ELF-based platform.  The CMAKE_BUILD_WITH_INSTALL_RPATH variable may
  be set to avoid this relinking step.
```
2021-06-24 10:57:51 -04:00
Brad King
782b6bfc26 Merge topic 'test-xcode-13' into release-3.21
1dd0eae4fc Tests: Fix xcode version detection for Xcode 13 on ARM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6248
2021-06-21 10:01:25 -04:00
Brad King
623d00ca05 Merge topic 'test-xcode-13'
1dd0eae4fc Tests: Fix xcode version detection for Xcode 13 on ARM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6248
2021-06-21 10:01:25 -04:00
Brad King
a01a88dc95 Merge topic 'FindPkgConfig-PKG_CONFIG-args'
35d3e00e4e FindPkgConfig: split args if loaded from environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6222
2021-06-21 09:53:51 -04:00
Brad King
d60d6c269a Merge topic 'ctest_runtime_labels'
bd38749fd4 ctest: allow test output to add labels

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6234
2021-06-21 09:52:36 -04:00
Brad King
1dd0eae4fc Tests: Fix xcode version detection for Xcode 13 on ARM
Running `xcode -version` on an ARM box prints content to stderr:

    objc[...]: Class ... is implemented in both...
    One of the two will be used. Which one is undefined.

Capture and parse only stdout.  Otherwise we might configure test
behavior for the wrong version of Xcode.
2021-06-18 14:04:32 -04:00
Christopher Degawa
35d3e00e4e FindPkgConfig: split args if loaded from environment
It's common for some people to use the PKG_CONFIG environment variable
to not only load a custom pkg-config/pkgconf but also to load some
default arguments such as `--static` or `--keep-system-libs` which often
worked since shell scripts would call `$PKG_CONFIG --libs pkg` without
quotes, but this breaks FindPkgConfig since it uses the full string as
`argv[0]` and might try looking for a binary called `pkgconf --static`,
instead of looking for `pkgconf` and adding `--static` as the `argv[1]`

Additionally adds RunCMake.FindPkgConfig ARGN test case

Fixes: #22305
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
2021-06-18 11:10:12 -04:00
Zack Galbreath
bd38749fd4 ctest: allow test output to add labels
Parse test output for <CTestLabel>...</CTestLabel>.
If found, add this value to the list of labels associated with this test.
2021-06-17 14:09:01 -04:00
Ben Boeckel
5a5c85dffd Tests/IncludeDirectories: support MSVC in system include tests 2021-06-17 14:02:52 -04:00
Ben Boeckel
399a3204bb Tests/IncludeDirectories: align sibling predicates 2021-06-17 14:02:52 -04:00
Ben Boeckel
20ab49193b Tests/IncludeDirectories: factor out applying flags to targets 2021-06-17 14:02:52 -04:00
Ben Boeckel
809f7b0c3a Tests/IncludeDirectories: fix copy pasta for otherlib 2021-06-17 14:02:52 -04:00
Brad King
b094324948 Tests/IncludeDirectories: Include system headers via angle brackets
This is typically how projects include them, and cl's `-external:{I,W}`
flags suppress warnings only when included through angle brackets.
2021-06-17 14:02:52 -04:00
Brad King
1aa16906e6 Merge topic 'fix-flow-control-override'
c017098d4d CMake: Allow override of unexpected non-flow-control commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6232
2021-06-17 06:47:42 -04:00
Kyle Edwards
c017098d4d CMake: Allow override of unexpected non-flow-control commands
Fixes: #22310
2021-06-16 10:39:39 -04:00
Daniel Schürmann
0665d9092e CMakeDependentOption: Allow parentheses in the depends string
`if()` takes the condition as a list of arguments.
Parentheses need to be separated as well.

Fixes: #22303
2021-06-14 13:45:49 -04:00
Brad King
f245a20ad0 Merge topic 'xcode13-linker-output'
a7bbbbf73b Tests: ignore Xcode DVTPlugInManager output
8dcdd4351f Tests: recognize Xcode 13 linker warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6216
2021-06-14 09:45:44 -04:00
Brad King
f597bb396e Merge topic 'dir-IMPORTED_TARGETS'
e13704ce72 Add directory property to list imported targets
ea6d338ea1 cmState: Record imported target names in each directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6215
2021-06-11 06:11:42 -04:00
Brad King
15b1d5ab9c Merge topic 'ci-rpm'
369725faa5 gitlab-ci: add job to run CPack RPM tests
1186ed64d0 ci: add rpm-build to Fedora base image
60380bd77c Tests: Fix RunCMake.CPack_RPM.DEBUGINFO test case
5130ff6878 Tests: Fix CPackComponentsForAll-RPM-IgnoreGroup test on Fedora 34

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6214
2021-06-11 06:10:34 -04:00
Brad King
557e47f154 Merge topic 'test-CPackComponentsForAll-errors'
45935ac973 Tests: Improve CPackComponentsForAll test error formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6212
2021-06-11 06:08:09 -04:00
Brad King
4217e1cf3a Merge topic 'FindBLAS-mkl-gnu'
daa0a1f877 Find{BLAS,LAPACK}: Add tests covering Intel MKL with GNU compiler
624110b90d FindBLAS: Revert "Do not statically link against iomp5 ... Intel MKL"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6213
2021-06-11 06:05:54 -04:00
Gregor Jasny
a7bbbbf73b Tests: ignore Xcode DVTPlugInManager output 2021-06-10 22:50:06 +02:00
Gregor Jasny
8dcdd4351f Tests: recognize Xcode 13 linker warning
The linker shipped with Xcode 13 changed the architecture
mismatch linker warning into:

```
ld: warning: ignoring file libfoo.a, building for macOS-x86_64 but attempting to link with file built for macOS-i386
```
2021-06-10 22:24:31 +02:00
Brad King
e13704ce72 Add directory property to list imported targets
Model the change after commit cbca65826c (Add directory property to list
buildsystem targets, 2016-09-19, v3.7.0-rc1~79^2~1).

Fixes: #22291
2021-06-10 15:52:12 -04:00
Brad King
60380bd77c Tests: Fix RunCMake.CPack_RPM.DEBUGINFO test case
Since commit c826745f5a (CPack/DEB: Do not crash when asked for debug
symbols when there are none, 2020-10-29, v3.20.0-rc1~461^2) the test
fails because CPackRPM warns about no sources in which to find debug
symbols.  Add expected output for this case.
2021-06-10 14:44:02 -04:00
Brad King
5130ff6878 Tests: Fix CPackComponentsForAll-RPM-IgnoreGroup test on Fedora 34
Update the cross-arch case from commit f174b919d6 (Tests: CpackRPM test
component architecture, 2015-02-19, v3.3.0-rc1~415^2~1) to use
`armv7hl`, which is supported by current RPM versions.

Fixes: #19983
2021-06-10 14:06:21 -04:00
Brad King
daa0a1f877 Find{BLAS,LAPACK}: Add tests covering Intel MKL with GNU compiler 2021-06-10 13:00:45 -04:00
Brad King
45935ac973 Tests: Improve CPackComponentsForAll test error formatting
Format message content for `message(FATAL_ERROR)`.
2021-06-10 10:53:02 -04:00
Brad King
5fd68d3ef7 Merge topic 'vs-custom-depfile'
526e2ef71c VS: Add support for add_custom_command DEPFILE
794ad78abb Help: Generalize release note filename for add_custom_command DEPFILE
7291f31254 cmTransformDepfile: Add support for MSBuild AdditionalInputs format
a6de8ec51b cmTransformDepfile: Make directory for transformed depfile automatically

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6206
2021-06-10 08:23:45 -04:00
Brad King
cf85c6bf85 Merge topic 'ctest_custom_details'
02f1271bdf ctest: allow test output to override the 'details' field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6204
2021-06-10 08:20:18 -04:00