1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-23 12:50:54 +08:00

1464 Commits

Author SHA1 Message Date
Brad King
96189e99e1 Merge topic 'cmAppend'
006229278b Use cmAppend to append ranges to std::vector instances
999516478d cmAlgorithms: Add cmAppend function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3366
2019-05-24 10:39:01 -04:00
Sebastian Holtermann
006229278b Use cmAppend to append ranges to std::vector instances 2019-05-23 16:19:49 +02:00
Sebastian Holtermann
7b4b61a4d3 cmMakefile: Define cmTargetMap type in cmMakefile instead of cmTarget
The `cmTargetMap` type is only used in the context of `cmMakefile`.
Therefore it is the most appropriate place to declare it.

This moves the `cmTarget.h/cmTargets` type definition to
`cmMakefile::cmTargetMap`.
2019-05-23 13:00:33 +02:00
Rosen Matev
9f76961de8 Support job pools in custom commands and targets
Provide a way for custom commands and targets to set the pool variable
of the ninja build statement. Setting `JOB_POOL` is not compatible with
`USES_TERMINAL`, which implies the `console` pool.

The option is silently ignored with other generators.

Closes: #18483
2019-05-14 15:58:00 +02:00
Bartosz Kosiorek
1527defbfe cmMakefile: Enforce explicit use of project() command
Fixes: 17714
2019-05-06 10:58:10 +02:00
Sebastian Holtermann
204c5ccb43 cmMakefile: Use std::unordered_map::emplace to add cmTargets to the list
When adding cmTargets to a cmMakefile, use std::unordered_map::emplace instead
of std::unordered_map::insert.
2019-03-21 20:43:48 +01:00
Zsolt Parragi
c7213ca870 Features: Do not use a lower-than-default standard for requested features
`AddRequiredTargetC(xx)` feature didn't take the default compiler
standard into account, which possibly resulted in the use of an older
standard when some features requested it.

Fixes: #18686
2019-02-26 14:35:55 -05:00
Brad King
a6cb73b97f Merge topic 'deprecate-policy-old'
02587d80cf Add deprecation warnings for policies CMP0066 and below

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3003
2019-02-25 08:12:54 -05:00
Brad King
a4d99e4dec Merge topic 'cmrange-improvements'
b8031308f3 cmRange: Add unit tests
a8d51ef8b7 cmRange: Add functions filter and transform
da4773e8b8 cmRange: Add functions all_of, any_of, none_of
17a367e77f cmRange: Stylistic cleanup
9eb0e73f46 cmRange: Move to dedicated header file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Artur Ryt <artur.ryt@gmail.com>
Merge-request: !2972
2019-02-25 08:03:01 -05:00
Brad King
02587d80cf Add deprecation warnings for policies CMP0066 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.7 and below to encourage projects to port away
from setting policies to OLD.
2019-02-21 11:02:46 -05:00
Regina Pfeifer
9eb0e73f46 cmRange: Move to dedicated header file 2019-02-21 08:24:25 -05:00
Vitaly Stakhovsky
9dd255548d cmSystemTools::Error: consolidate parameters into single std::string 2019-02-20 11:18:11 -05:00
Vitaly Stakhovsky
0281f9a4ca cmMakefile::ConfigureFile: Accept std::string parameters 2019-02-18 20:48:19 -05:00
Albert Astals Cid
ae5e97a005 Delete some default constructors and assignment operators
They are unused, but if someone used them they would lead to
problems since they would copy the internal raw pointers
and the destructor would cause double delete
2019-02-15 07:25:47 -05:00
Vitaly Stakhovsky
950c099d83 cmake: Progress functions use std::string param 2019-02-11 10:32:43 -05:00
Brad King
4b37b4f1bb Merge topic 'modernize-for-loops'
01b2d6ab74 Modernize: Use ranged for-loops when possible
15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2901
2019-02-11 08:08:22 -05:00
Brad King
d9ddb30e92 Merge topic 'fix-exclude-dir-with-iface'
f87e724e8c Fix EXCLUDE_FROM_ALL on directory with an interface library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2937
2019-02-11 07:44:40 -05:00
Brad King
bf12794504 Merge topic 'getreqdef'
00ba28ffd0 cmMakefile::GetRequiredDefinition: return const std::string&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2930
2019-02-08 08:48:51 -05:00
Brad King
f87e724e8c Fix EXCLUDE_FROM_ALL on directory with an interface library
Since commit dc6888573d (Pass EXCLUDE_FROM_ALL from directory to
targets, 2019-01-15, v3.14.0-rc1~83^2) we automatically forward the
`EXCLUDE_FROM_ALL` to targets as they are created.  This regressed
support for interface libraries on which the property is not allowed.

Skip forwarding the `EXCLUDE_FROM_ALL` property for interface libraries.
It is not needed on them because they do not participate in the
generated build system anyway.

Fixes: #18896
2019-02-08 08:17:48 -05:00
Artur Ryt
01b2d6ab74 Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some
reverse-iterator loops with range loops.

Fixes: #18858
2019-02-07 22:39:05 +01:00
Vitaly Stakhovsky
00ba28ffd0 cmMakefile::GetRequiredDefinition: return const std::string& 2019-02-07 07:35:16 -05:00
Artur Ryt
f3534386b5 Prefer front/back/data over dereferencing begin/rbegin iter
Changed for sequenced containers: vector, list, string and array
2019-02-06 10:43:16 -05:00
Brad King
bcec7d0778 Merge topic 'copyfile-stdstring'
c31b6e616d cmSystemTools: copy file member functions accept std::string params

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2877
2019-01-30 08:08:59 -05:00
Brad King
d75fec5a88 Merge topic 'tidy-use-equals-default'
094f01d0f0 cleanup: Prefer compiler provided special member functions
55671b41d2 clang-tidy: Use `= default`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !2841
2019-01-29 14:07:24 -05:00
Vitaly Stakhovsky
c31b6e616d cmSystemTools: copy file member functions accept std::string params
Cleaned up `c_str()`s.
`cmSystemTools::CopyFileIfDifferent()` removed as redundant.
2019-01-29 10:34:18 -05:00
Vitaly Stakhovsky
186d9b083d cmSystemTools::Message: Add overload accepting std::string 2019-01-28 09:35:51 -05:00
Brad King
40628b2519 Merge topic 'max-recursion-depth'
a6982cff0d cmMakefile: Impose maximum recursion limit

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Juraj Oršulić <juraj.orsulic@fer.hr>
Merge-request: !2746
2019-01-25 08:09:37 -05:00
Brad King
24b6e4830d Merge topic 'exclude_from_all'
dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2816
2019-01-25 08:06:54 -05:00
Brad King
40745ad35a Merge topic 'cmake-files-directory'
3e867ed400 cmake: inlined files dir constant and removed it from cmake.h

Acked-by: Kitware Robot <kwrobot@kitware.com>
Rejected-by: vvs31415 <vstakhovsky@fastmail.com>
Merge-request: !2655
2019-01-25 08:01:26 -05:00
Regina Pfeifer
094f01d0f0 cleanup: Prefer compiler provided special member functions 2019-01-25 06:45:00 -05:00
Regina Pfeifer
55671b41d2 clang-tidy: Use = default
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
2019-01-25 06:44:32 -05:00
Kyle Edwards
a6982cff0d cmMakefile: Impose maximum recursion limit
In order to keep infinitely-recursive scripts from causing a stack
overflow in the CMake executable, CMake now imposes a maximum
recursion limit before issuing an error message. The limit can be
adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH.

Fixes: #18694
2019-01-23 09:52:29 -05:00
Vitaly Stakhovsky
2993fc347a cmMakefile: GetModulesFile() accepts std::string param 2019-01-21 12:56:51 -05:00
Zack Galbreath
dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets
When a target is created it now inherits the EXCLUDE_FROM_ALL property
from its directory. This change makes it possible to include a target
in "all", even if its directory has been marked as EXCLUDE_FROM_ALL.
2019-01-21 11:38:24 -05:00
Bruno Manganelli
3e867ed400 cmake: inlined files dir constant and removed it from cmake.h 2019-01-21 15:34:16 +00:00
Brad King
c7428e1729 Merge topic 'read-list-file'
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2821
2019-01-21 07:57:33 -05:00
Regina Pfeifer
ef61997b1b clang-tidy: Use emplace 2019-01-17 13:12:02 -05:00
Vitaly Stakhovsky
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument
Same for cmMakefile::ReadDependentFile(); some cleanup
2019-01-17 12:36:07 -05:00
Kyle Edwards
4568d046c4 Properties: Add CMAKE_ROLE global property
This property allows scripts to determine whether they're in project
mode, script mode, find-package mode, CTest, or CPack.
2019-01-17 09:44:29 -05:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Brad King
6845e2559d Add deprecation warnings for policies CMP0065 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for some policies
to encourage projects to port away from setting policies to OLD.
2019-01-11 14:47:20 -05:00
Artur Ryt
cbf0c0fce4 cmake: Enable --warn-uninitialized inside string(CONFIGURE) and configure_file
Fixes: #18489
2018-12-30 08:31:09 +11:00
Artur Ryt
67ac4ed1dc cmMakefile: Move uninitialized vars logic into MaybeWarnUninitialized() 2018-12-28 15:16:37 +01:00
Artur Ryt
5257af3634 cmMakefile: move common logic to IsProjectFile function 2018-12-28 15:16:37 +01:00
Regina Pfeifer
b2aa3aedea clang-tidy: Use default member initialization 2018-12-15 10:52:37 +01:00
Artur Ryt
fe9a16c80f cmMakefile: Fix @CMAKE_CURRENT_LIST_LINE@ for ExpandVariablesInStringNew
Added check for variable name in @@ evaluation and test for
configuring @CMAKE_CURRENT_LIST_LINE@ with new CMP0053

Fixes: #18646
2018-12-12 08:29:14 -05:00
Artur Ryt
dda4755b46 cmMakefile: Fix ConfigureString not passing filename and line
It enables to use CMAKE_CURRENT_LIST_LINE in string(CONFIGURE)
Added tests for it for ${} and @@ notattion for old CMP0053
and ${} for new
2018-12-12 08:29:01 -05:00
Regina Pfeifer
5731ec30f0 clang-tidy: fix warnings from version 7
Fix some warnings that are new since clang-tidy version 4, and update
`.clang-tidy` to suppress the rest.
2018-11-20 10:36:08 -05:00
Kyle Edwards
0f5c1b404b find_package(): Add policy to remove the FindQt module
Removing FindQt.cmake gives Qt upstream a path forward to export its
own QtConfig.cmake files which can be found by find_package()
without having to explicitly specify CONFIG. Projects that still
want to use Qt3/4 can call find_package(Qt[34]), include(FindQt),
or add FindQt.cmake to their CMAKE_MODULE_PATH.
2018-11-14 15:05:06 -05:00
R2RT
53a5aec899 CMP0053: Fix double warning on uninitialized variables in -P mode
When `CMP0053` is not set to OLD or NEW then we compute both variants
in case we need to warn about a behavior change.  Do not allow both
code paths to produce an uninitialized variable warning.

Fixes: #18552
2018-11-05 08:31:09 -05:00