1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-15 00:21:09 +08:00

419 Commits

Author SHA1 Message Date
Arctic Lampyrid
6116bcb066 fileapi: Add CONFIGURE_DEPENDS glob info to cmakeFiles object
Fixes: #25668
Co-authored-by: Brad King <brad.king@kitware.com>
2024-03-19 14:55:25 -04:00
Arctic Lampyrid
f578515d02
cmGlobCacheEntry: Add helper to carry CONFIGURE_DEPENDS glob cache arguments 2024-03-20 02:30:53 +08:00
leha-bot
9f6c937408 Source/cmake.h: Add ScriptModeExitCode for proper storing exit code
From executed CMake script in SCRIPT_MODE.
2024-01-16 10:41:31 +03:00
Brad King
241ee252ce IWYU: Update for Debian 12 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 12.
2023-07-28 09:14:08 -04:00
Craig Scott
99b2ccf80d cmake_file_api: New project command
Projects can use the new command to request file API replies for the current
run. No query files are generated, the query is tracked internally. Replies are
created in the file system at generation time in the usual way.

Fixes: #24951
2023-06-05 06:20:50 -04:00
Brad King
c4f273e722 Merge topic 'AddCacheEntry-suppress-raw-pointer-usage'
4fc322bab4 AddCacheEntry: Suppress raw pointer usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8520
2023-05-31 09:35:25 -04:00
Marc Chevrier
4fc322bab4 AddCacheEntry: Suppress raw pointer usage 2023-05-30 16:41:59 +02:00
Glen Chung
a9a592f96e cmake: Add debugger
- Depends on cppdap and jsoncpp.
- Add --debugger argument to enable the Debugger.
- Add --debugger-pipe argument for DAP traffics over named pipes.
- Support breakpoints by filenames and line numbers.
- Support exception breakpoints.
- Call stack shows filenames and line numbers.
- Show Cache Variables.
- Show the state of currently defined targets,
  tests and directories with their properties.
- Add cmakeVersion to DAP initialize response.
- Include unit tests.

Co-authored-by: Ben McMorran <bemcmorr@microsoft.com>
2023-05-30 09:46:12 -04:00
Marc Chevrier
aa5fed5052 SetProperty: suppress raw pointer usage 2023-05-26 14:48:22 +02:00
Artin Alavi
8e579b0228 presets: Add trace options to configure presets
Add JSON schema version 7 to support them.

Fixes: #22543
2023-03-30 09:18:53 -04:00
Brad King
48292c8624 try_compile: Record stack of in-progess checks in configure log
Many `try_compile` and `try_run` calls occur inside check modules
between `message(CHECK_START)` and `message(CHECK_{PASS,FAIL})` pairs.
Add a field to configure log entries to report this context.

Issue: #23200
2023-01-16 17:18:07 -05:00
Brad King
189557bd74 cmake: Make entire in-progress check stack available internally
Represent it as a `vector` so we can iterate over the whole stack.
2023-01-16 16:58:49 -05:00
Matthew Woehlke
746c776caf ConfigureLog: Add infrastructure for structured configure event logging
Add infrastructure for a "configure log".  Use YAML for a balance of
machine- and human-readability to records details of configure-time
events in a structured format.

Teach the RunCMake test framework to support matching the configure log.

Issue: #23200
2022-12-16 10:11:37 -05:00
Alex Turbov
74b735dea8 cmDocumentation: char*[][2]cmDocumentationEntry[N]
Use fixed size arrays of `cmDocumentationEntry` items instead of
open arrays of two `char` pointers when describe program options
help screens.

Also, drop `const char*[][2]` overloads of methods of
`cmDocumentation` and `cmDocumentationSection` classes in the sake
of generic (template) appenders introduced earlier.
2022-11-17 16:37:11 +04:00
Kyle Edwards
553794e987 cmake::CreateProfilingEntry: Refactor to take lambda for args 2022-11-11 11:45:00 -05:00
Brad King
3469d53b3f Merge topic 'extended-profiling'
0fe7aae91f cmake: Add profiling events for configure and generate
3d6a8d7eac cmMakefileProfilingData: Refactor to use RAII

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7828
2022-10-28 10:04:01 -04:00
Brad King
ab88011579 Merge topic 'cmake-presets-workflow-arguments'
7ecbe324b0 cmake --workflow: add --fresh option
7d9aa0f00c cmake::Workflow: Refactor to use enum class argument
322193afcd cmake --workflow: print usage and exit on unrecognized argument
70aef29427 cmake --workflow: print usage message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7825
2022-10-27 09:43:39 -04:00
Kyle Edwards
3d6a8d7eac cmMakefileProfilingData: Refactor to use RAII
And add a more generic StartEntry() method.
2022-10-26 17:54:08 -04:00
Kyle Edwards
7ecbe324b0 cmake --workflow: add --fresh option
Fixes: #24073
2022-10-26 12:01:25 -04:00
Kyle Edwards
7d9aa0f00c cmake::Workflow: Refactor to use enum class argument 2022-10-26 12:01:01 -04:00
Matthew Woehlke
5ba51621af try_compile: Propagate --trace through try_compile
Add ability to specify another cmake instance from which to get the
trace output target. Use this during try_compile.
2022-10-11 12:10:18 -04:00
Kyle Edwards
374d82bbcd cmake: Add --workflow mode
Fixes: #23118
2022-09-27 11:09:06 -04:00
Robert Maynard
f808d8afb9 CMake: Support upcoming C++26 language level 2022-08-31 13:46:18 -04:00
Alexandru Croitor
23bbac941a Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub command
The new sub-command writes a string representation of the
current log level to the output variable given to the
sub-command.

Given that the log-level might be set either via the --log-level
command line option or via the CMAKE_MESSAGE_LOG_LEVEL
cache / regular variables, the priority for each of the log level
sources is as follows, with the first one being the highest:
1) --log-level
2) CMAKE_MESSAGE_LOG_LEVEL regular variable
3) CMAKE_MESSAGE_LOG_LEVEL cache variable
4) default log level (STATUS)

Fixes: #23572
2022-06-28 16:03:22 +02:00
Alexandru Croitor
2b6ef864e0 Move LogLevel enum out of cmake.h header
Move LogLevel enum into the cmMessageType.h header in preparation
for a new log level querying feature.
Wrap the enum into a new Message namespace.
Adjust all code usages.
2022-06-24 16:24:33 +02:00
Martin Duffy
65f7053d6c COMPILE_WARNING_AS_ERROR: Add command-line option
Add command-line option `--compile-no-warning-as-error` to ignore value of
`COMPILE_WARNING_AS_ERROR`.

Issue: #19085
2022-05-18 10:30:30 -04:00
Brad King
9f1471739d cmake: Add --fresh option to clear the cache and start from scratch
Simplify the workflow to re-run CMake from scratch as if a build tree
were never before processed, regardless of whether it has been.

Fixes: #23119
2022-03-22 09:27:47 -04:00
Robert Maynard
b44ad7992a cmake: Always prefer the last source directory provided
Fixes: #23334
2022-03-17 15:23:01 -04:00
Robert Maynard
7083b19498 cmake: When given multiple source paths use last instead of first
When given two source paths via `-S` or just directory paths prefer
the last one. When the paths are mixed always prefer the last `-S`
entry.

Fixes: #23238
2022-02-17 16:54:30 -05:00
Craig Scott
8efd4b5378 cmake::GetDebugFindPkgOutput: Use consistent argument name
The argument name used in the class declaration didn't match the one
used in the implementation file. The one in the header appears to be a
cut-n-paste from GetDebugFindOutput(), but the implementation makes
it clear that "pkg" better infers what the argument represents than "var".
2022-02-14 21:12:44 +11:00
Brad King
63154cbf45 Merge topic 'vs-package-restore'
9aa7831f05 Presets: add resolve packages setting to build presets.
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages.
193b8fca52 cmBuildOptions: Split build arguments into separate object.
6a10103493 Help: Update preset schema description for version 3 entries.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6761
2022-01-24 11:46:29 -05:00
Carsten Rudolph
193b8fca52 cmBuildOptions: Split build arguments into separate object. 2022-01-22 06:35:38 -05:00
Robert Maynard
eacf1f879b cmake: Warn about unnecessary paths on command line
We can't make it an error as that would break existing behavior.

Fixes: #23110
2022-01-20 14:38:12 -05:00
Kyle Edwards
fd6ea2f67f Refactor: Rename cmCMakePresetsFile to cmCMakePresetsGraph
And change all references to "file" to say "graph" instead.
2022-01-06 18:52:30 -05:00
John Parent
d7b18895bc cmake: Add filtered debug-find options
Add a `--debug-find-pkg=` option to debug find calls for specific
packages.

Add a `--debug-find-var=` option to debug find calls for specific
return variables.

Fixes: #21880
2021-12-17 08:55:21 -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
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Marc Chevrier
f5fa6d53b0 class cmake: Store working directory at cmake launch 2021-05-11 18:16:08 +02:00
Robert Maynard
d5c3e4ac32 cmake: add support for --toolchain command argument 2021-04-15 10:13:49 -04:00
Robert Maynard
38140713ad cmake: add support for --install-prefix command argument
Fixes: #21781
2021-03-04 10:50:24 -05:00
Raul Tambre
dcd599757f C23 support 2021-02-25 18:22:10 +02:00
Raul Tambre
93b7d3d292 C17 support
Implements #17755.
2021-02-25 18:22:10 +02:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00
Raul Tambre
9f3c70a333 CUDA, CXX, OBJCXX: C++23 support with Clang 12
Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b
in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
2020-12-08 18:43:59 +02:00
Brad King
5ca2910f5f Merge topic 'cmake-presets-help-flag'
c619be2784 ccmake: Don't list --preset in --help

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5428
2020-10-28 07:47:38 -04:00
Kyle Edwards
c619be2784 ccmake: Don't list --preset in --help
And show available options in cmake-gui.

Fixes: #21313
2020-10-27 10:29:24 -04:00
Cengizhan Pasaoglu
bd705788f6 Constify some code as suggested by clang-tidy 2020-10-20 00:04:04 +03:00