199 Commits

Author SHA1 Message Date
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
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Regina Pfeifer
d25a5a7ec9 clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators.  Leave new expressions and cast
expressions for later.
2019-09-10 22:21:41 +02:00
Regina Pfeifer
d63c1e4e6e clang-tidy: modernize-return-braced-init-list 2019-09-06 22:27:39 +02:00
Gabor Bencze
11f35d340e cmCommand refactor: remove unused AddDisallowedCommand overload 2019-08-26 11:48:47 -04:00
Brad King
de2c73d84f Merge topic 'free-disallowed'
c55fb044a9 cmBuildNameCommand: Implement as free function
86bf1eef75 cmState: Support free function disallowed commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3688
2019-08-21 10:47:47 -04:00
Sebastian Holtermann
20e580be01 Source sweep: Use cmIsOn instead of cmSystemTools::IsOn
This replaces invocations of

- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
2019-08-17 12:14:14 +02:00
Regina Pfeifer
c55fb044a9 cmBuildNameCommand: Implement as free function 2019-08-16 10:47:22 +02:00
Regina Pfeifer
86bf1eef75 cmState: Support free function disallowed commands 2019-08-13 13:48:10 +02:00
Sebastian Holtermann
f71f7ce3f0 cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Sebastian Holtermann
9b5cc42531 cmDefinitions: Remove const char* based Set method
- Removes `cmDefinitions::Set` method overload that takes a `const char*`
  value argument.
- Updates calls to `cmDefinitions::Set` to use the `cm::string_view` based
  version instead.
2019-07-24 11:11:25 +02:00
Regina Pfeifer
dfaa87f1b3 cmState: Support BuiltinCommands as free functions 2019-07-22 15:27:56 +02:00
Regina Pfeifer
de77d355ac cmState: Add scripted commands by value 2019-07-21 09:25:32 +02:00
Regina Pfeifer
0101ace131 cmUnexpectedCommand: Replace with lambda expression 2019-07-21 09:25:32 +02:00
Regina Pfeifer
015001aaf1 cmState: Hold commands by value 2019-07-21 09:25:32 +02:00
Marc Chevrier
1591f138f1 modernize: manage cmCommand instances using unique_ptr. 2019-07-14 15:37:30 +02:00
Marc Chevrier
d9b2c7dae2 Introduce memory management helper: cm_memory.hxx 2019-07-14 15:37:30 +02:00
Alex Turbov
5e52de7d57 modermize: replace some raw pointers w/ unique_ptr 2019-06-24 09:36:09 -04:00
Sebastian Holtermann
8d934d861b cmPropertyMap: Make std::map container private 2019-06-08 12:25:35 +02:00
Robert Maynard
616282a5ce CMake: Provide language level compile features lists
Now CMake stores what compile features are associated with each
language level and exposes them as global properties.
2019-03-20 09:10:07 -07:00
Taylor Holberton
198650ae73 set: warn if CACHE type is not recognized 2019-01-30 10:47:24 -05:00
Brad King
68eabb3576 Avoid -Wstring-plus-int warning
In `cmState::GetGlobalProperty` we use a macro to produce a string of
the form ";a;b;c" and want to return "a;b;c" by skipping the leading
";".  Switch from pointer arithmetic to indexing+addressing to silence
the "warning: adding 'int' to a string does not append to the string"
diagnostic from Clang.
2019-01-23 13:17:22 -05:00
Brad King
65a3abf999 Merge topic 'GHS_updates'
21ab58d3f8 GHS: Update test suite
72e0c115b7 GHS: Add Compiler ID detection
436cc5e991 GHS: try_compile() now uses GHS platform variables
4a1ec0de3d GHS: Fix toolset selection
1a66acdef2 GHS: Append ".gpj" to target name when generating build command
0c9e47d7cd GHS: Integrity Application updates
8044318431 GHS: Add support for some of the source file properties
73092b2213 GHS: Add support for object libraries
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2231
2019-01-18 06:58:35 -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
Fred Baksik
436cc5e991 GHS: try_compile() now uses GHS platform variables
-- Forward GHS platform variables to try_compile()
   CMAKE_TRY_COMPILE_PLATFORM_VARIABLES only worked for source signature try_compile()
-- Update tests to no longer add GHS platform variables to try_compile()
-- Avoid linker error in GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt by building library
2019-01-16 10:42:00 -05:00
Regina Pfeifer
b2aa3aedea clang-tidy: Use default member initialization 2018-12-15 10:52:37 +01:00
Cengizhan Pasaoglu
c67ab22cdc Using front() and back() instead of calculations 2018-11-06 21:43:33 +03:00
Brad King
87dfd53b27 Merge topic 'set_directory_properties-script-mode'
50572d638b set_directory_properties: Restore in script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2544
2018-10-30 11:01:36 -04:00