Commit Graph

226 Commits

Author SHA1 Message Date
Juan Ramos
3c3bce133d cmake: Honor CMAKE_GENERATOR env var in --help output 2022-10-20 19:53:14 -06:00
FeRD (Frank Dana)
98a10290a8 cmSystemTools: Fix 'ErrorOccurred' spelling
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.

Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
2022-06-13 09:05:24 -04:00
Craig Scott
2aa83fa15b Dependency providers: Add find_package and FetchContent support
Fixes: #22619
2022-05-25 08:46:18 +10:00
Kyle Edwards
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
2022-01-20 09:05:35 -05:00
Brad King
3d378541bb cmMessenger: Adopt backtrace printing functions
Move backtrace printing functions from `cmListFileBacktrace` over to
`cmMessenger`, their primary caller.  Thread `cmMessenger` instances
through APIs needed to update other call sites.
2021-12-08 10:03:48 -05:00
Sean McBride
37859e3244 Source: Fix clang -Wimplicit-fallthrough warnings 2021-09-28 10:53:54 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
9488f8a7b7 Merge topic 'enh-AddCacheEntry-accepts-new-types'
f84193292c Use new AddCacheEntry signatures
3c2e58eeb8 AddCacheEntry accept cmProp or std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6495
2021-09-10 09:47:39 -04:00
Marc Chevrier
3c2e58eeb8 AddCacheEntry accept cmProp or std::string 2021-09-10 15:45:51 +02:00
Kyle Edwards
ab94c369c9 Refactor: Convert parallel string/backtrace vectors to BT vectors 2021-09-03 09:52:14 -04:00
Marc Chevrier
6dfa581bab Enhancement: SetProperty accept cmProp or std::string
Methods SetProperty of classes cmPropertyMap, cmStateDirectory
and cmMakefile accept now cmProp or std::string as argument.
2021-08-25 10:09:02 +02:00
Marc Chevrier
e5cd39ca80 cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
2021-08-08 16:19:08 +02:00
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
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
Brad King
ea6d338ea1 cmState: Record imported target names in each directory
Model the change after commit 089868a244 (cmState: Record buildsystem
target names in each directory, 2016-09-16, v3.7.0-rc1~79^2~3).
2021-06-10 15:41:18 -04:00
Ben Boeckel
ef935b17ab clang-tidy: fix readability-use-anyofallof warnings 2021-01-27 08:54:18 -05:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Craig Scott
105ef112c9 Merge topic 'cmake-presets-path-arg'
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5416
2020-10-27 07:33:46 -04:00
Kyle Edwards
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled
If a path argument with no -S or -B leads to a cache directory,
use that directory as the binary directory. Otherwise, use the
binary directory from the preset.

Fixes: #21311
2020-10-26 22:32:45 +11:00
Kyle Edwards
8aee7fdb32 cmState: Prohibit override of flow control commands 2020-10-22 17:04:31 -04:00
Brad King
e8b0359a43 cmake_language: Add signature to DEFER calls to later times
Fixes: #19575
2020-09-29 17:12:33 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Vitaly Stakhovsky
7156911242 cmIsOn: add overload accepting const std::string* 2020-07-14 08:22:24 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Tushar Maheshwari
6728f0fa85 cmPropertyDefinitionMap: simplify and shorten 2020-05-15 18:58:02 +05:30
Vitaly Stakhovsky
e267c3fddf cmState::GetInitializedCacheValue: return cmProp
cmProp alias is used; no actual change in type
2020-04-30 10:45:45 -04:00
Tushar Maheshwari
80d8b20351 cmCacheManager: Cleanup CacheIterator interface
- Expose required functionality from CacheEntry.
- Modify usage in cmState member functions.
- Remove cmState access to CacheEntry members.
2020-04-18 18:35:57 +05:30
Vitaly Stakhovsky
3eec21a01c cmTarget::GetProperty: return cmProp 2020-03-30 15:00:14 -04:00
Brad King
a6611577c3 Merge topic 'cmprop-getglobalprop'
c84cf42897 cmState::GetGlobalProperty: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4521
2020-03-27 07:50:28 -04:00
Vitaly Stakhovsky
a7f2ff16a4 cmState::GetCacheEntryProperty: return cmProp 2020-03-25 14:46:52 -04:00
Brad King
952fbd9ee5 Merge topic 'cmprop-state'
ef408dd232 cmState::GetTargetTypeName: return type is *cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4505
2020-03-25 09:25:26 -04:00
Vitaly Stakhovsky
c84cf42897 cmState::GetGlobalProperty: return cmProp 2020-03-25 09:10:46 -04:00
Vitaly Stakhovsky
ef408dd232 cmState::GetTargetTypeName: return type is *cmProp 2020-03-19 08:55:03 -04:00
Vitaly Stakhovsky
0bf0e35e59 cmCacheManager::GetProperty: return cmProp 2020-03-19 08:18:42 -04:00
Vitaly Stakhovsky
bd89133543 cmState::GetCacheEntryValue: return cmProp 2020-03-17 12:09:20 -04:00
Brad King
d2e0b8bcfd Merge topic 'prop_t'
60f57d0dcc cmPropertyMap: Introduce cmProp as return type for GetProperty() functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4471
2020-03-17 08:05:29 -04:00
Vitaly Stakhovsky
60f57d0dcc cmPropertyMap: Introduce cmProp as return type for GetProperty() functions
Currently properties are usually stored internally as `std::string`.
However, family of GetProperty() functions return them as `const char *` using `c_str()`.
The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties
more naturally.
2020-03-13 13:32:17 -04:00
Vitaly Stakhovsky
73d52a862b cmPropertyDefinition: Construct directly in defined state
Move `cmPropertyDefinitionMap::DefineProperty` functionality
directly into the constructor to avoid an intermediate state.
2020-03-13 10:24:51 -04:00
Kyle Edwards
16a4ba5b31 Ninja Multi-Config: Use build.ninja if cmake --build has no --config
If cmake --build is called with no --config argument, and a
build.ninja file is available, use that instead of defaulting to the
Debug config.
2020-02-04 14:13:07 -05:00
Vitaly Stakhovsky
1398517f31 AppendProperty: convert value param to std::string 2020-01-25 10:37:00 -05:00
Vitaly Stakhovsky
93e9d10c7f cmCacheManager: more members use std::string 2020-01-06 00:26:28 -05:00
Vitaly Stakhovsky
232d5bc333 cmState: more members will use std::string 2020-01-02 07:56:34 -05:00
Kyle Edwards
5a8a9f7229 Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
2019-12-13 10:51:46 -05:00
Robert Maynard
2467a2b318 CUDA: Add cuda meta-features (e.g. `cuda_std_11`) support 2019-12-10 17:56:48 -05:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Daniel Eiband
61fdf326d8 cmState: Avoid lowering command name twice
The given command given to GetCommand is already lower case so we can use
GetCommandByExactName directly.
2019-09-21 12:56:05 +02:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00