Commit Graph

3715 Commits

Author SHA1 Message Date
Brad King
418313a7d6 Merge topic 'FindXCTest-xcode-12.5'
0b5301a778 FindXCTest: Fix output directory for test bundle with Xcode 12.5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6379
2021-07-27 09:11:33 -04:00
Yauheni Khnykin
0b5301a778 FindXCTest: Fix output directory for test bundle with Xcode 12.5
The fix from commit eafe740ead (FindXCTest: Fix output directory for
test bundle with new build system, 2021-02-09, v3.19.5~5^2) is not
necessary with Xcode 12.5, which seems to have changed/fixed the
behaviour again.

Fixes: #22462
2021-07-26 13:31:10 -04:00
Brad King
f68bff274b Merge topic 'ninja-multi-test-fix'
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6383
2021-07-26 09:36:49 -04:00
Kyle Edwards
08131e83bc Tests: Clean up Ninja Multi-Config test from cb777dd 2021-07-23 13:22:59 -04:00
Brad King
ca2c63f423 Merge topic 'nmc-target-objects'
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6371
2021-07-23 09:39:26 -04:00
Brad King
e06c60f7e9 Merge topic 'nmc-target-objects' into release-3.21
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6371
2021-07-23 09:39:25 -04:00
Brad King
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
Since commit 2ae72ef74b (Xcode: Enable multi-arch TARGET_OBJECTS genex
in [INTERFACE_]LINK_LIBRARIES, 2021-05-26, v3.21.0-rc1~126^2) the
TARGET_OBJECTS genex, when referenced for linking, is now evaluated with
EvaluateForBuildsystem enabled.  This causes the object file paths to be
computed with a buildsystem-specific placeholder for the configuration.

This is normally fine because the placeholder will be evaluated by the
native buildsystem tool using the proper configuration.  However, the
Ninja Multi-Config generator's `${CONFIGURATION}` placeholder may not
have the correct value for cross-config object files.  Switch back to
using the per-config location of each object file for this generator.

Fixes: #22436
2021-07-21 11:46:15 -04:00
Brad King
b8021454ce Merge topic 'message-color'
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6369
2021-07-21 11:34:05 -04:00
Brad King
e98bfa484f Merge topic 'message-color' into release-3.21
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6369
2021-07-21 11:34:04 -04:00
Brad King
6e04e06e67 Merge topic 'CMakeDependentOption-revert-parens' into release-3.21
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6368
2021-07-21 11:32:48 -04:00
Brad King
abf8e92b44 Merge topic 'CMakeDependentOption-revert-parens'
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6368
2021-07-21 11:32:48 -04:00
Brad King
992467c30c Merge topic 'toolchain-CMP0126'
144be54dd3 try_compile: Propagate CMP0126 to the generated test project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6366
2021-07-21 11:31:29 -04:00
Brad King
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows
Since commit 0a0a0f8a74 (cmMessenger: Color messages to terminal by
type, 2021-05-18, v3.21.0-rc1~146^2) the message output no longer goes
through our custom streambuf on Windows that converts output encoding.
This can cause messages to be printed with the wrong encoding in a
Windows Console.  It also causes messages to have a mix of LF and CRLF
newlines because `stderr` converts LF to CRLF but our custom streambuf
does not.

Revert to using just `cerr` for messages on Windows.  Another approach
will be needed to achieve color output on Windows later.

Fixes: #22444
2021-07-20 13:30:11 -04:00
Brad King
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"
Revert commit 0665d9092e (CMakeDependentOption: Allow parentheses in the
depends string, 2021-06-13, v3.21.0-rc1~32^2).  It broke existing use
cases with parentheses in regular expressions.  Also add a test for this.

Fixes: #22447
2021-07-20 12:18:53 -04:00
Brad King
c9d440fcaa Merge topic 'find_library_usable_from_script_mode'
aa3ab3eb92 find_library: Infer library prefix and suffix when in script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6338
2021-07-20 11:48:17 -04:00
Brad King
144be54dd3 try_compile: Propagate CMP0126 to the generated test project
Set policy CMP0126 to the value used in the calling project.
It may affect toolchain file behavior.
2021-07-20 09:47:02 -04:00
Brad King
a9900c8364 Merge topic 'cmake-presets-no-binary-dir-no-s'
aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6358
2021-07-19 12:59:01 -04:00
Robert Maynard
aa3ab3eb92 find_library: Infer library prefix and suffix when in script mode
This aligns `find_library` with the documentation that states it
can be called from script mode. This is done by infering the
proper prefix and suffix values when `find_library` is called
when the `CMAKE_FIND_LIBRARY*` are not set. This also means that
`find_library` won't produce obscure error messages about unset
definitions.

Fixes: #22027
2021-07-19 12:55:18 -04:00
Kyle Edwards
aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir
When resolving binaryDir into a full path from a relative path, we
forgot to check if binaryDir is altogether empty, causing empty
binaryDir's to resolve to the source directory. Fix this.

Fixes: #22434
2021-07-16 10:25:40 -04:00
Brad King
89039dfed8 Merge topic 'FindPkgConfig-LIBRARY_PATH'
36979f5b43 FindPkgConfig: Tolerate PKG_CONFIG_SYSTEM_LIBRARY_PATH in environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6345
2021-07-14 09:28:39 -04:00
Brad King
5e8a29c10b Merge topic 'cpack-deb-debuginfo'
9dc007e17c Refactor: Drop redundand `std::endl` calls in the middle of output
afcc5449e8 Refactor: Use `cmStrToLong` instead of `std::strtol`
13549674cc Refactor: Avoid duplicate calls to `GetOption("GEN_DBGSYMDIR")`
7add10f288 Refactor: Deduplicate code of `createDebPackages()`
593ff734b0 CPack/DEB: dbgsym package not generated for non-component packaging
c8f298ae08 Refactor: Extract packaged files finder into a function
7fd3134ea1 Refactor: cmCPackDebGenerator::PackageComponents handle `else` first
008321595a Refactor: Change return value to bool for private members
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6342
2021-07-14 09:26:36 -04:00
Brad King
bf8bf11fe5 Merge topic 'doc-cmake-build-signature'
161f1f42d6 Help: Clarify 'cmake --build' signature alternatives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6343
2021-07-14 09:22:27 -04:00
Brad King
36979f5b43 FindPkgConfig: Tolerate PKG_CONFIG_SYSTEM_LIBRARY_PATH in environment
Tell `pkg-config --libs` not to filter out `-L` flags for entries of
`PKG_CONFIG_SYSTEM_LIBRARY_PATH` (and `LIBRARY_PATH` for `pkgconf`).
We should always search everywhere the `.pc` file expects.

Fixes: #22148
2021-07-13 10:33:16 -04:00
Brad King
161f1f42d6 Help: Clarify 'cmake --build' signature alternatives
Documentation added by

* commit 4f4f2028b8 (Help: Add documentation for buildPresets and
                     testPresets, 2021-01-13, v3.20.0-rc1~51^2~7)
* commit 676ecf0d37 (cmake-presets: Add build and test presets,
                     2020-12-14, v3.20.0-rc1~51^2~6)

used square brackets in the `cmake --build` signature to indicate
non-optional alternatives, which is not a typical convention.
A common convention is to use parentheses instead, but in this
case it is probably clearer to list the two signatures separately.

Fixes: #22413
2021-07-13 09:41:26 -04:00
Alex Turbov
593ff734b0 CPack/DEB: dbgsym package not generated for non-component packaging
Fix: #19735
2021-07-13 08:36:12 -04:00
Brad King
3265fa51cd Merge topic 'ctest-environment-modifications'
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
4c757fa3c8 Help/prop_test/ENVIRONMENT: clarify the scope of the changes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6299
2021-07-13 08:24:36 -04:00
Brad King
8fcd3ecb2a Merge topic 'vs-CMAKE_MSVCIDE_RUN_PATH'
542bd343e3 VS: Always enable CMAKE_MSVCIDE_RUN_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6334
2021-07-13 08:20:36 -04:00
Kyle Edwards
17aa96bb7a Merge branch 'master' into file-grd-arch 2021-07-12 16:12:46 -04:00
Kyle Edwards
b2c03347b0 file(GET_RUNTIME_DEPENDENCIES): Check architecture of dependencies
Fixes: #22106
2021-07-12 16:11:38 -04:00
Asit Dhal
542bd343e3 VS: Always enable CMAKE_MSVCIDE_RUN_PATH
Do not require a language to be enabled.

Fixes: #22343
2021-07-12 11:19:01 -04:00
Brad King
ca696c73e1 Merge topic 'target-stable-order'
9e9ab61e2f cmGlobalGenerator: Process targets in a stable order
8a812dde61 cmGlobalGenerator: Use cmMakefile::CreateNewTarget to add global targets
854dcb0d01 cmMakefile: Split out CreateNewTarget from AddNewTarget

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6267
2021-07-12 08:39:46 -04:00
Brad King
89b61d9197 Merge topic 'intel-oneapi-std-windows'
a82af0e2ce Merge branch 'backport-3.20-intel-oneapi-std-windows'
1c227583a4 Tests: Fix RunCMake.try_compile C/CXX standards with IntelLLVM MSVC mode
1c14691a86 CMakeCCompilerId: Fix C standard detection in Clang and IntelLLVM MSVC mode
6eea123e3a Tests: Fix RunCMake.try_compile C/CXX standards with IntelLLVM MSVC mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6328
2021-07-12 08:33:31 -04:00
Brad King
6eea123e3a Tests: Fix RunCMake.try_compile C/CXX standards with IntelLLVM MSVC mode
Since commit 84036d30d4 (IntelLLVM: Fix C/C++ standard level flags on
Windows, 2021-07-07, v3.21.0-rc3~8^2~1) we activate C/C++ standard level
logic for IntelLLVM when targeting the MSVC ABI.  Update the
`RunCMake.try_compile` test to be aware of this even when CMake is
itself configured by an older CMake that does not know this.
2021-07-09 11:04:52 -04:00
Ben Boeckel
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
This property allows projects to modify environment variables at test
time rather than trying to guess what the state should be based on what
is present at configure time. Of particular interest is the ability to
use a `PATH` present at test time while adding entries known to be
necessary for the test itself.

There are multiple operations provided to modify variables, including:

  - setting and unsetting
  - appending and prepending as:
    - strings
    - path lists
    - CMake lists

Additionally, a `reset` action is provided to cancel any prior
modifications to that particular variable in the case of incremental
additions to the test property.
2021-07-09 08:45:18 -04:00
NAKAMURA Takumi
9e9ab61e2f cmGlobalGenerator: Process targets in a stable order
`cmMakefile::Targets` is meant for efficient lookup but does not
have a stable order.  Use `cmMakefile::OrderedTargets` instead.
2021-07-08 15:16:46 -04:00
Eugene Shalygin
a2e9fe38e4 find_package: Add variable to make package REQUIRED
Add a `CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable is complement
to `CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` with just the opposite
behaviour: it turns non-required find_package call into the required one.

While optional package dependencies usually result in simple and clean
build logic, sometimes people want to be sure those optional
dependencies will be found and used. Examples are reproducible builds
and build instructions for 3rd parties. People choose to make
find_package calls REQUIRED and put them behind an option(). Such
workarounds blend build logic with build environment management and do
not look elegant.
2021-07-08 08:03:38 -04:00
Brad King
2cc6aa4ef4 Merge topic 'cmake-presets-list-no-generator'
d9a3c9fad5 CMakePresets.json: Make --list-presets show presets with no generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6314
2021-07-07 09:27:46 -04:00
Kyle Edwards
d9a3c9fad5 CMakePresets.json: Make --list-presets show presets with no generator
Fixes: #22389
2021-07-06 14:36:27 -04:00
Brad King
058253aa87 Merge topic 'ci-fixups'
46c89c77de gitlab-ci: Rename CI config variable to avoid conflict with CMAKE_BUILD_TYPE
3ede66e17a Tests: Fix newline matching in several RunCMake.* cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6298
2021-07-06 09:47:50 -04:00
Brad King
3736088310 Merge topic 'ctest_not_dart'
0962cbf21d help: update ctest attached file example
5489ce74b3 ctest: support <CTestMeasurement> for runtime measurements
7817aa6fa4 ctest: improve test for runtime labels

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6296
2021-07-02 09:00:56 -04:00
Brad King
3ede66e17a Tests: Fix newline matching in several RunCMake.* cases
The RunCMake infrastructure's `*-stdout.txt` expected output files
interpret `\n` as a `\` and `n` rather than a newline.  Use a literal
newline instead.  Otherwise the cases that were trying to match any
configuration name via `[^\n]*` would fail on `RelWithDebInfo` because
it contains the letter `n`.
2021-07-02 08:19:34 -04:00
Zack Galbreath
5489ce74b3 ctest: support <CTestMeasurement> for runtime measurements
Teach CTest to parse output for <CTestMeasurement> in addition to
<DartMeasurement> for measurements defined at runtime.

Use a new class (cmCTestTestMeasurementXMLParser) derived from cmXMLParser
to parse the data and attributes these XML elements. This is an improvement
over our previous approach of using a series of regular expressions.

As part of this commit we also rename some member variables and methods
to make their purpose more clear.

DartStuff                        -> AllTestMeasurementsRegex
DartStuff1                       -> SingleTestMeasurementRegex
DartString                       -> TestMeasurementsOutput
GenerateDartOutput()             -> GenerateCTestXML()
GenerateRegressionImages()       -> RecordCustomTestMeasurements()
cmCTestRunTest::DartProcessing() -> ParseOutputForMeasurements()
2021-07-01 15:16:23 -04:00
Brad King
635a252564 Merge topic 'env-init-configs'
ef56eefc9b cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable
e216b9bbd3 cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable
6986a382a9 Help: Document when CMAKE_BUILD_TYPE and CMAKE_CONFIGURATION_TYPES are set
e96169a3ec Help: Cross-reference CMAKE_CONFIGURATION_TYPES from CMAKE_BUILD_TYPE
03bd9c4c10 cmMakefile: Add helper to initialize CMAKE_CONFIGURATION_TYPES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6291
2021-07-01 11:29:41 -04:00
Brad King
a10ca7f667 Merge topic 'post-rel-dev'
2c209097b9 Configure CMake itself with policies through CMake 3.20
83a3db5631 export: Increase maximum policy version in exported files to 3.20
d76cb12905 Add deprecation warnings for policies CMP0088 and below

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6290
2021-07-01 11:27:31 -04:00
Brad King
3a6cb03b6c Merge topic 'cpackdeb-md5sums-order'
a0d3494afa Tests: update MD5SUMS test to have several files
9028195a22 CPackDeb: sort package files before generating deb file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6287
2021-07-01 11:26:28 -04:00
Zack Galbreath
7817aa6fa4 ctest: improve test for runtime labels
Check for the whole expected output string rather than particular substrings.
This verifies that newlines are stripped for any <CTestLabel> lines found
in the test output.
2021-07-01 11:12:28 -04:00
Brad King
ef56eefc9b cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable
When no `CMAKE_CONFIGURATION_TYPES` 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
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
d76cb12905 Add deprecation warnings for policies CMP0088 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.14 and below to encourage projects to port
away from setting policies to OLD.
2021-06-30 10:07:42 -04:00
Alexey Rogachevskiy
a0d3494afa Tests: update MD5SUMS test to have several files
The test is now updated to check the order of files
in the md5sums.
2021-06-30 09:05:28 -04:00