Commit Graph

153 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
Craig Scott
2aa83fa15b Dependency providers: Add find_package and FetchContent support
Fixes: #22619
2022-05-25 08:46:18 +10:00
Brad King
11cc728e75 cmConstStack: Factor out of cmListFileBacktrace
This presents value semantics for a stack of constant values.
Internally it shares ownership to avoid copies.  Previously
this was implemented by `cmListFileBacktrace` explicitly,
but the approach can be re-used for other kinds of stacks.
2022-04-02 05:55:31 -04: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
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
3c2e58eeb8 AddCacheEntry accept cmProp or std::string 2021-09-10 15:45:51 +02: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
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
Kyle Edwards
c017098d4d CMake: Allow override of unexpected non-flow-control commands
Fixes: #22310
2021-06-16 10:39:39 -04: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
Oleksandr Koval
967792a662 cmState: store commands in unordered_map 2020-09-11 20:31:11 +03:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Brad King
0b837ab371 cmState: Drop unused and unimplemented SetCacheValue method
Fixes: #20758
2020-05-26 12:54:49 -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
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
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
bd89133543 cmState::GetCacheEntryValue: return cmProp 2020-03-17 12:09:20 -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
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
Gabor Bencze
11f35d340e cmCommand refactor: remove unused AddDisallowedCommand overload 2019-08-26 11:48:47 -04:00
Regina Pfeifer
86bf1eef75 cmState: Support free function disallowed commands 2019-08-13 13:48:10 +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
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints.  Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
2019-07-10 11:48:56 -04:00
Alex Turbov
5e52de7d57 modermize: replace some raw pointers w/ unique_ptr 2019-06-24 09:36:09 -04:00
Sebastian Holtermann
735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02: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
Taylor Holberton
198650ae73 set: warn if CACHE type is not recognized 2019-01-30 10:47:24 -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
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
Brad King
50572d638b set_directory_properties: Restore in script mode
Since commit v3.10.0-rc1~391^2~3 (Add directory property 'LABELS' and
CMAKE_DIRECTORY_LABELS variable, 2017-06-23) this command was
accidentally not allowed in script mode.  It was dropped because
`ctest -S` mode needs to start with CMake's normal script mode and
then replace the `set_directory_properties` implementation.  Restore
the normal `set_directory_properties` in script mode and then add
special logic to replace it in ctest.  Also add a test case.

Fixes: #18523
2018-10-29 11:37:32 -04:00
Vitaly Stakhovsky
13d10ee616 cmState::GetInitializedCacheValue: Return as const std::string* 2018-09-10 09:31:48 -04:00