Commit Graph

291 Commits

Author SHA1 Message Date
Alex Turbov
a6070b480f Help: Use placeholder instead of listing choices in option lines
This avoids any ambiguity with whether the choices are literal
values or not. It also makes the option lines more concise.
2022-08-14 09:58:41 +04:00
Alex Turbov
28ecfd1690 Help: Short options first, then long, then Windows style 2022-08-14 09:58:41 +04:00
Alex Turbov
f4563f05db Help: Value for --graphviz= option actually is mandatory
Before it was `[file]` that AFAIK means optional.
2022-08-04 19:34:45 +04:00
Robert Maynard
14a0e750cb cmake: In -P mode ignore flags like --version after --
Fixes: #21031
2022-07-22 14:30:21 -04:00
Ben Boeckel
6ff03d463f clang-tidy: address google-readability-casting lints
At least those involving `static_cast`.
2022-05-24 09:09:43 -04:00
Brad King
758756d1ba Merge topic 'ignore-werror-command-arg'
65f7053d6c COMPILE_WARNING_AS_ERROR: Add command-line option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7268
2022-05-19 09:43:53 -04: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
Kyle Edwards
62f4a41647 Refactor: Use cmCommandLineArgument::setTo{True,Value}() 2022-04-18 16:22:51 -04:00
Brad King
8e4af2cb30 Merge topic 'correct_list-presets_parsing'
45299a8f9b cmake: --list=presets=[type] doesn't generate incorrect warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7164
2022-04-12 08:16:01 -04:00
Robert Maynard
45299a8f9b cmake: --list=presets=[type] doesn't generate incorrect warnings
Fixes #23407
2022-04-11 10:46:03 -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
Carsten Rudolph
f320a31087 cmake --build: prioritize --resolve-package-references over preset
Fixes: #23224
2022-02-15 10:20:02 -05:00
Brad King
5126b3b8d1 Merge topic 'message-flush'
634587e322 message: Restore explicit flushing of messages on stderr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6913
2022-01-28 09:36:02 -05:00
Brad King
634587e322 message: Restore explicit flushing of messages on stderr
In the `cmake` command-line tool, the `message()` command with no
message mode argument prints the message stderr using the C++ `cerr`
stream.  Since commit 0a0a0f8a74 (cmMessenger: Color messages to
terminal by type, 2021-05-18, v3.21.0-rc1~146^2) and an update by
commit c7a8c9c811 (cmMessenger: Revert to non-color messages on
Windows, 2021-07-20, v3.21.1~15^2), we print the newline at the end of
the message using just `\n`.  We've now observed some cases of output
on stdout and stderr getting jumbled when the two go to the same file
descriptor.  Previously the newline was printed with `endl`, which
implicitly flushes.  Flush explicitly to restore that behavior.

Fixes: #23155
2022-01-27 16:06:35 -05:00
Carsten Rudolph
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages. 2022-01-22 06:35:41 -05:00
Carsten Rudolph
193b8fca52 cmBuildOptions: Split build arguments into separate object. 2022-01-22 06:35:38 -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
Brad King
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows
Since commit 0a0a0f8a74 (cmMessenger: Color messages to terminal by
type, 2021-05-18, v3.21.0-rc1~146^2) the message output no longer goes
through our custom streambuf on Windows that converts output encoding.
This can cause messages to be printed with the wrong encoding in a
Windows Console.  It also causes messages to have a mix of LF and CRLF
newlines because `stderr` converts LF to CRLF but our custom streambuf
does not.

Revert to using just `cerr` for messages on Windows.  Another approach
will be needed to achieve color output on Windows later.

Fixes: #22444
2021-07-20 13:30:11 -04:00
Brad King
161f1f42d6 Help: Clarify 'cmake --build' signature alternatives
Documentation added by

* commit 4f4f2028b8 (Help: Add documentation for buildPresets and
                     testPresets, 2021-01-13, v3.20.0-rc1~51^2~7)
* commit 676ecf0d37 (cmake-presets: Add build and test presets,
                     2020-12-14, v3.20.0-rc1~51^2~6)

used square brackets in the `cmake --build` signature to indicate
non-optional alternatives, which is not a typical convention.
A common convention is to use parentheses instead, but in this
case it is probably clearer to list the two signatures separately.

Fixes: #22413
2021-07-13 09:41:26 -04:00
Brad King
96995d38cd Merge topic 'message-color'
0a0a0f8a74 cmMessenger: Color messages to terminal by type
bceb8e2ed2 cmMessenger: Pass title inside a metadata structure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6105
2021-05-21 10:38:50 -04:00
Marius Messerschmidt
0a0a0f8a74 cmMessenger: Color messages to terminal by type
Fixes: #16183
2021-05-20 07:38:45 -04:00
Robert Maynard
372bf1bcc4 cmCommandLineArgument: Understands which commands require partial matching
Allows us to provide better error messages when commands such as
`--target` are passed invalid input.
2021-05-19 11:07:16 -04:00
Marius Messerschmidt
bceb8e2ed2 cmMessenger: Pass title inside a metadata structure 2021-05-19 09:06:27 -04:00
Robert Maynard
5aa0dec6b0 cmake: --build and --install error out when encountering bad flags
Fixes #22186
2021-05-13 09:28:42 -04:00
Brad King
3357d37761 cmake: Add support for '--build --prefix=<prefix>' form of the argument
The main `cmake --preset` argument for configure presets supports both
forms, so support it for `cmake --build --preset` too.

Issue: #21855
2021-02-23 09:11:44 -05:00
Brad King
2f13fdef0a cmake: Document '--preset <preset>' form of the argument
This form already works.  Document it and add tests.

Issue: #21855
2021-02-23 09:11:32 -05:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00
Robert Maynard
8c22c1964c cmake: --install now uses cmCommandLineArgument
This makes `--install` use the same parsing rules as the rest of the
the cmake executable
2021-01-06 09:11:18 -05:00
Robert Maynard
75ac6dfbce cmake: --build now uses cmCommandLineArgument
This makes `--build` use the same parsing rules as the rest of the
the cmake executable
2021-01-06 09:11:18 -05:00
Robert Maynard
0fb78576b0 cmake: Use shared parsing code for all cmake argv parsing 2021-01-06 09:11:14 -05: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
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
Brad King
b1d9a25f35 Merge topic 'cmake-E-cat-binary' into release-3.19
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:50 -04:00
Johnny Jazeix
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
Reset `std::cout` to write in binary mode with no encoding conversions.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21295
2020-10-14 12:08:07 -04:00
Brad King
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management 2020-10-14 12:08:06 -04:00
Kyle Edwards
8617479061 CMake: Add presets functionality 2020-10-05 09:49:59 -04:00
Brad King
c0e4a0bd82 cmake: Update --help output to discourage use of --find-package mode
Fixes: #21056
2020-08-04 12:02:54 -04:00
Brad King
5899e849d0 Merge topic 'supported-profiling-formats'
9c3beb532f cmake: Show supported formats in --help output for --profiling-format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: dublet <github@dublet.org>
Merge-request: !5001
2020-07-13 07:49:47 -04:00
Craig Scott
9c3beb532f cmake: Show supported formats in --help output for --profiling-format
Fixes: #20943
2020-07-11 23:14:03 +10:00
Brad King
4eb2e50730 Merge topic 'uv-check-return'
0fddcc1e5b cmake: Tolerate nullptr from uv_default_loop

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4962
2020-07-02 08:31:31 -04:00
Brad King
0fddcc1e5b cmake: Tolerate nullptr from uv_default_loop
`uv_default_loop()` can return `nullptr` when running on a Linux kernel
configured without `CONFIG_EVENTFD`.

Fixes: #20899
2020-07-01 16:26:44 -04:00
Brad King
df6b077625 cmake: Remove broken '--warn-unused-vars' option
This option has been broken since commit b9f9915516 (cmMakefile: Remove
VarUsageStack., 2015-05-17, v3.3.0-rc1~52^2).  That commit removed the
check that an initialized variable has actually been used and caused the
option to warn on every variable ever set.  This was not caught by the
test suite because the test for the feature only checked that warnings
appear when needed and not that they do not appear when not needed.

The option was never very practical to use.  Remove it to avoid the
runtime cost of usage tracking and checks for every variable (which we
were doing even when the option was not used).
2020-06-29 17:23:27 -04:00
Asit Dhal
d4812a955b cmake-install: implement default directory permissions
provide an argument for default directory permissions in cmake --install

Fixes: #20700
2020-06-25 14:43:30 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Wouter Klouwen
1b4ab323fd Fix build warnings for unused functions
This commit addresses two sources of build errors when using the warning
flag -Werror=unused-function for GCC in the default compiler flags.

The affected functions are not used when building in bootstrap
mode and therefore should be ifdefed out.

No functional changes.
2020-05-01 12:54:21 +01:00
Vitaly Stakhovsky
a7f2ff16a4 cmState::GetCacheEntryProperty: return cmProp 2020-03-25 14:46:52 -04:00
Vitaly Stakhovsky
bd89133543 cmState::GetCacheEntryValue: return cmProp 2020-03-17 12:09:20 -04:00
Wouter Klouwen
9aa4640792 cmake: add command line options to output script profiling data
For users of CMake who want to optimize their scripts if they take a
while to run, this commit adds the ability to output profiling data.

To enable this output, it adds the two command line parameters
to select the output path and format.

This commit adds the first profiling format of type ``google-trace``,
which is the output is a JSON file containing Duration events as per the
Google Trace Format specification:

https://docs.google.com/document/d/1CvAClvFfyA5R-
PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#
2020-03-07 13:36:27 +00:00