summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
Commit message (Collapse)AuthorAgeFilesLines
* AddCacheEntry: Suppress raw pointer usageMarc Chevrier2023-05-301-1/+1
|
* SetProperty: suppress raw pointer usageMarc Chevrier2023-05-261-5/+6
|
* Source: Improve some code readability and efficiencyMeekness Adesina2023-05-191-5/+7
| | | | | - Replace raw loop with STL find algorithm for improved efficiency - Update functions for enhanced readability and understandability
* Merge topic 'block-var-scope'Brad King2022-11-081-10/+11
|\ | | | | | | | | | | | | | | | | 96ddcbee60 cmState: Clarify name of member tracking the active scope in a directory cb53d9309e block: Fix variable scope protection from modification by subdirectories Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7885
| * cmState: Clarify name of member tracking the active scope in a directoryBrad King2022-11-071-11/+11
| | | | | | | | | | | | | | | | | | | | The `DirectoryEnd` member added by commit 52dbe654de (cmState: Record the end position of each directory., 2015-08-01, v3.4.0-rc1~251^2~1) actually tracks the current top-most scope in a directory's stack. This is evidenced by the use case in commit 3f4e5e8c3d (cmState: Return end snapshot for GetBuildsystemDirectoryParent., 2015-09-01, v3.4.0-rc1~100^2~1). Rename the member to `CurrentScope` to clarify this role.
| * block: Fix variable scope protection from modification by subdirectoriesBrad King2022-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `cmStateSnapshot::RaiseScope` raises a variable in to a parent directory scope, it uses `GetBuildsystemDirectoryParent` to find the current top-most scope on the directory's stack. Since commit 3f4e5e8c3d (cmState: Return end snapshot for GetBuildsystemDirectoryParent., 2015-09-01, v3.4.0-rc1~100^2~1), that depends on the `DirectoryEnd` field in the directory's state. However, when variable-only scopes were added by commit 6954c8936f (cmState: Add a VariableScope snapshot type., 2015-08-01, v3.4.0-rc1~179^2~1), we neglected to account for the addition of that field by commit 52dbe654de (cmState: Record the end position of each directory., 2015-08-01, v3.4.0-rc1~251^2~1). Prior to commit 44a2f3f332 (Add new flow-control commands for variables and policies scopes management, 2022-08-05, v3.25.0-rc1~257^2) this problem went unnoticed because there was no way to have a variable scope at the top of a directory's stack while processing a subdirectory. Now the `block()/endblock()` commands enable the behavior, so fix tracking of a variable scope as the top-most scope in a directory. Fixes: #24138
* | cmake: Honor CMAKE_GENERATOR env var in --help outputJuan Ramos2022-10-211-0/+2
|/
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-1/+1
| | | | | | | | 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.
* Dependency providers: Add find_package and FetchContent supportCraig Scott2022-05-241-0/+9
| | | Fixes: #22619
* define_property(): Add INITIALIZE_FROM_VARIABLE argumentKyle Edwards2022-01-201-2/+4
| | | | Fixes: #20698
* cmMessenger: Adopt backtrace printing functionsBrad King2021-12-081-10/+10
| | | | | | Move backtrace printing functions from `cmListFileBacktrace` over to `cmMessenger`, their primary caller. Thread `cmMessenger` instances through APIs needed to update other call sites.
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-1/+1
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-18/+18
|
* Merge topic 'enh-AddCacheEntry-accepts-new-types'Marc Chevrier2021-09-101-1/+1
|\ | | | | | | | | | | | | | | f84193292c Use new AddCacheEntry signatures 3c2e58eeb8 AddCacheEntry accept cmProp or std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6495
| * AddCacheEntry accept cmProp or std::stringMarc Chevrier2021-09-101-1/+1
| |
* | Refactor: Convert parallel string/backtrace vectors to BT vectorsKyle Edwards2021-09-031-5/+0
|/
* Enhancement: SetProperty accept cmProp or std::stringMarc Chevrier2021-08-251-0/+4
| | | | | Methods SetProperty of classes cmPropertyMap, cmStateDirectory and cmMakefile accept now cmProp or std::string as argument.
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-9/+9
| | | | | | 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.
* cmake: Model normal and try-compile project kinds explicitlyBrad King2021-07-121-13/+10
| | | | | Construct with the project kind instead of mutating state after construction.
* cmState: Construct with modeBrad King2021-07-121-8/+4
|
* Merge topic 'fix-flow-control-override'Brad King2021-06-171-1/+8
|\ | | | | | | | | | | | | c017098d4d CMake: Allow override of unexpected non-flow-control commands Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6232
| * CMake: Allow override of unexpected non-flow-control commandsKyle Edwards2021-06-161-1/+8
| | | | | | | | Fixes: #22310
* | cmState: Record imported target names in each directoryBrad King2021-06-101-0/+1
|/ | | | | Model the change after commit 089868a244 (cmState: Record buildsystem target names in each directory, 2016-09-16, v3.7.0-rc1~79^2~3).
* clang-tidy: fix `readability-use-anyofallof` warningsBen Boeckel2021-01-271-6/+3
|
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+1
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Merge topic 'cmake-presets-path-arg'Craig Scott2020-10-271-0/+5
|\ | | | | | | | | | | | | b7d7eca66d CMakePresets.json: Rework how --preset argument is handled Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5416
| * CMakePresets.json: Rework how --preset argument is handledKyle Edwards2020-10-261-0/+5
| | | | | | | | | | | | | | | | 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
* | cmState: Prohibit override of flow control commandsKyle Edwards2020-10-221-3/+28
|/
* cmake_language: Add signature to DEFER calls to later timesBrad King2020-09-291-0/+15
| | | | Fixes: #19575
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* cmIsOn: add overload accepting const std::string*Vitaly Stakhovsky2020-07-141-2/+1
|
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-2/+0
|
* cmPropertyDefinitionMap: simplify and shortenTushar Maheshwari2020-05-151-23/+7
|
* cmState::GetInitializedCacheValue: return cmPropVitaly Stakhovsky2020-04-301-2/+1
| | | | cmProp alias is used; no actual change in type
* cmCacheManager: Cleanup CacheIterator interfaceTushar Maheshwari2020-04-181-32/+11
| | | | | | - Expose required functionality from CacheEntry. - Modify usage in cmState member functions. - Remove cmState access to CacheEntry members.
* cmTarget::GetProperty: return cmPropVitaly Stakhovsky2020-03-301-0/+2
|
* Merge topic 'cmprop-getglobalprop'Brad King2020-03-271-13/+31
|\ | | | | | | | | | | | | c84cf42897 cmState::GetGlobalProperty: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4521
| * cmState::GetGlobalProperty: return cmPropVitaly Stakhovsky2020-03-251-13/+31
| |
* | cmState::GetCacheEntryProperty: return cmPropVitaly Stakhovsky2020-03-251-4/+3
| |
* | Merge topic 'cmprop-state'Brad King2020-03-251-12/+26
|\ \ | |/ |/| | | | | | | | | ef408dd232 cmState::GetTargetTypeName: return type is *cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4505
| * cmState::GetTargetTypeName: return type is *cmPropVitaly Stakhovsky2020-03-191-12/+26
| |
* | cmCacheManager::GetProperty: return cmPropVitaly Stakhovsky2020-03-191-1/+2
|/
* cmState::GetCacheEntryValue: return cmPropVitaly Stakhovsky2020-03-171-6/+5
|
* Merge topic 'prop_t'Brad King2020-03-171-1/+2
|\ | | | | | | | | | | | | 60f57d0dcc cmPropertyMap: Introduce cmProp as return type for GetProperty() functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4471
| * cmPropertyMap: Introduce cmProp as return type for GetProperty() functionsVitaly Stakhovsky2020-03-131-1/+2
| | | | | | | | | | | | | | 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.
* | cmPropertyDefinition: Construct directly in defined stateVitaly Stakhovsky2020-03-131-2/+2
|/ | | | | Move `cmPropertyDefinitionMap::DefineProperty` functionality directly into the constructor to avoid an intermediate state.
* Ninja Multi-Config: Use build.ninja if cmake --build has no --configKyle Edwards2020-02-041-0/+10
| | | | | | 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.
* AppendProperty: convert value param to std::stringVitaly Stakhovsky2020-01-251-2/+2
|
* cmCacheManager: more members use std::stringVitaly Stakhovsky2020-01-061-16/+10
|