Commit Graph

31041 Commits

Author SHA1 Message Date
Brad King
6c440ea3ce cmake: Model normal and try-compile project kinds explicitly
Construct with the project kind instead of mutating state after
construction.
2021-07-12 12:21:52 -04:00
Brad King
2065bd73cb cmState: Construct with mode 2021-07-12 12:21:44 -04:00
Brad King
c9cd039e5f Merge topic 'LWYU-externalization'
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
9c5132a586 PGI: Fix "LINKER:" prefix generated separator
8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6306
2021-07-12 08:43:32 -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
Kitware Robot
52a73d1654 CMake Nightly Date Stamp 2021-07-12 00:01:19 -04:00
Kitware Robot
3c521b89f1 CMake Nightly Date Stamp 2021-07-11 00:01:06 -04:00
Kitware Robot
4f5957d72d CMake Nightly Date Stamp 2021-07-10 00:01:09 -04:00
Marc Chevrier
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.

Fixes: #20174
2021-07-09 14:50:50 +02:00
Kitware Robot
a5e865c178 CMake Nightly Date Stamp 2021-07-09 00:01:15 -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
NAKAMURA Takumi
8a812dde61 cmGlobalGenerator: Use cmMakefile::CreateNewTarget to add global targets
`cmMakefile::CreateNewTarget` updates also `cmMakefile::OrderedTargets`.
2021-07-08 12:17:37 -04:00
NAKAMURA Takumi
854dcb0d01 cmMakefile: Split out CreateNewTarget from AddNewTarget
`CreateNewTarget` tells whether the target is inserted or not.
2021-07-08 12:15:10 -04:00
Brad King
a42b753c41 Merge topic 'find_package-required-var'
a2e9fe38e4 find_package: Add variable to make package REQUIRED

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6316
2021-07-08 08:06:12 -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
c3a5dec0e8 Merge topic 'CPATH_symlinks'
c00f928ce1 Do not exclude include directory symlinks to entries of CPATH
5c02964aff cmLocalGenerator: Simplify CPATH lookup loop
86595b3002 cmLocalGenerator: Clarify check for membership in multiple sets
10969fd003 cmLocalGenerator: Remove unnecessary parentheses in a condition
3fd56472c6 cmLocalGenerator: Store realpath lookup result in a variable
429fb28f25 cmLocalGenerator: Factor out repeated condition into local variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6313
2021-07-08 07:54:53 -04:00
Marc Chevrier
8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation 2021-07-08 13:48:42 +02:00
Kitware Robot
94cad518bc CMake Nightly Date Stamp 2021-07-08 00:01:09 -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
Brad King
85ea0a9112 Merge topic 'xcode13-old-buildsystem'
71a2664ebb Xcode: Ignore deprecated build system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6309
2021-07-07 09:26:35 -04:00
Alexander Grund
c00f928ce1 Do not exclude include directory symlinks to entries of CPATH
Extend the fix from commit 2d0b0e2b9d (Do not exclude include
directories made implicit by CPATH, 2019-05-29, v3.14.5~2^2) to cover
include directories that are symlinks to paths listed in `CPATH`.

Compare resolved paths against resolved entries of `CPATH`.
Resolve the entries as late as possible in case symlinks change.

Fixes: #22383
2021-07-07 08:04:59 -04:00
Alexander Grund
5c02964aff cmLocalGenerator: Simplify CPATH lookup loop 2021-07-07 08:04:30 -04:00
Alexander Grund
86595b3002 cmLocalGenerator: Clarify check for membership in multiple sets 2021-07-07 08:04:30 -04:00
Alexander Grund
10969fd003 cmLocalGenerator: Remove unnecessary parentheses in a condition 2021-07-07 08:04:29 -04:00
Alexander Grund
3fd56472c6 cmLocalGenerator: Store realpath lookup result in a variable 2021-07-07 08:04:15 -04:00
Kitware Robot
0f1efb58c8 CMake Nightly Date Stamp 2021-07-07 00:01:11 -04:00
Alexander Grund
429fb28f25 cmLocalGenerator: Factor out repeated condition into local variable 2021-07-06 19:19: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
7fdd806630 Merge topic 'makefile-normalize-depfile'
30926620bb Merge branch 'backport-3.21-makefile-normalize-depfile'
6bc6ffb9a9 Merge branch 'backport-3.20-makefile-normalize-depfile'
6a6efdcaed Makefiles: Normalize compiler-generated depfile paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6297
2021-07-06 09:48:45 -04:00
Gregor Jasny
71a2664ebb Xcode: Ignore deprecated build system
With Xcode 13 the key to suppress the check has changed.
Tested with Xcode 12.5 and 13.0-beta2.
2021-07-06 09:29:17 +02:00
Kitware Robot
a27fa90aa1 CMake Nightly Date Stamp 2021-07-06 00:01:10 -04:00
Kitware Robot
28979a5968 CMake Nightly Date Stamp 2021-07-05 00:01:22 -04:00
Kitware Robot
7f6552745d CMake Nightly Date Stamp 2021-07-04 00:01:09 -04:00
Kitware Robot
51485993e7 CMake Nightly Date Stamp 2021-07-03 00:01:12 -04:00
Brad King
30926620bb Merge branch 'backport-3.21-makefile-normalize-depfile' 2021-07-02 10:36:07 -04:00
Brad King
6bc6ffb9a9 Merge branch 'backport-3.20-makefile-normalize-depfile' 2021-07-02 10:01:09 -04:00
Marc Chevrier
6a6efdcaed Makefiles: Normalize compiler-generated depfile paths
Even though Makefile generators pass source files and include
directories by absolute path to the compiler, the compiler may generate
depfile paths relative to the current working directory.  For example,
`ccache` with `CCACHE_BASEDIR` may transform paths this way.  When
reading a depfile, convert relative dependencies to absolute paths
before placing them in `compiler_depend.make`, which is later evaluated
in the top-level build directory.

Fixes: #22364
2021-07-02 09:24:57 -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
c1346f67c8 Merge topic 'autogen-deps'
af11ea8d0c AutoGen: Fix needless compilation of mocs_compilation.cpp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6288
2021-07-02 08:59:40 -04:00
Kitware Robot
4f69bf0964 CMake Nightly Date Stamp 2021-07-02 00:01:10 -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
Joerg Bornemann
af11ea8d0c AutoGen: Fix needless compilation of mocs_compilation.cpp
For an AUTOMOC'ed target foo, when depfiles are used, there are the
following dependencies:

foo_autogen -> foo_autogen/timestamp
foo_autogen/mocs_compilation.cpp -> foo_autogen/timestamp

The first is used to trigger AUTOGEN.
The second erroneously triggers a recompilation of
mocs_compilation.cpp when any source file of target foo is touched.

Remove the latter dependency and replace it with an order-only
dependency from foo_autogen/mocs_compilation.cpp to
foo_autogen_timestamp_deps.

That is achieved by making mocs_compilation.cpp or its
per-configuration variants byproduct(s) of the timestamp file.

Fixes: #22338
2021-07-01 15:31:02 +02:00
Kitware Robot
5333ee1de4 CMake Nightly Date Stamp 2021-07-01 00:01:13 -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
03bd9c4c10 cmMakefile: Add helper to initialize CMAKE_CONFIGURATION_TYPES
Factor out duplicate code from the Ninja Multi-Config, Visual Studio,
and Xcode generators.
2021-06-30 10:55:40 -04:00
Brad King
83a3db5631 export: Increase maximum policy version in exported files to 3.20
The files generatd by `install(EXPORT)` and `export()` commands
are known to work with policies as of CMake 3.20, so enable them
in sufficiently new CMake versions.
2021-06-30 10:13:56 -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