1059 Commits

Author SHA1 Message Date
Brad King
171bf5fa92 Merge topic 'third-parties-layout'
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
75e87e3db4 bootstrap: update list of problematic files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4705
2020-05-08 08:18:17 -04:00
Craig Scott
b743ffbfa2 Merge topic 'script-mode-and-arbitrary-args'
e4f1b301fe cmake: Allow arbitrary args passed to CMake script

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4707
2020-05-07 09:09:52 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Alex Turbov
e4f1b301fe cmake: Allow arbitrary args passed to CMake script 2020-05-06 21:40:36 +10:00
Brad King
aa45f3f25f Merge topic 'gcc8-unused-function'
1b4ab323fd Fix build warnings for unused functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4697
2020-05-04 11:02:01 -04:00
Brad King
0b08c1279c Merge topic 'cmprop-state'
e267c3fddf cmState::GetInitializedCacheValue: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4696
2020-05-01 08:31:32 -04: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
e267c3fddf cmState::GetInitializedCacheValue: return cmProp
cmProp alias is used; no actual change in type
2020-04-30 10:45:45 -04:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Ben Boeckel
f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -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
Brad King
7e3d81b1df Merge topic 'cmprop-state'
a7f2ff16a4 cmState::GetCacheEntryProperty: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4522
2020-03-27 07:49:30 -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
Rolf Eike Beer
ec7928ef26 use _s to construct static string_views at several places
This should avoid the runtime strlen() call.
2020-03-24 19:40:44 +01:00
Rolf Eike Beer
ada6a3226f use cm::string_view for language extension lookups
Once the list of extensions is build the set is just a copy of the vector and
not modified anymore. Use a string_view for the members of the set, which saves
a small amount of memory. It also makes possible to use string_views as lookup
keys, so the callers do not need to create copies for the extensions anymore.
2020-03-23 22:41:43 +01:00
Rolf Eike Beer
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Brad King
60db3af147 Merge topic 'cmprop-state'
bd89133543 cmState::GetCacheEntryValue: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4493
2020-03-19 07:18:27 -04:00
Brad King
0586123ede Merge topic 'trace-format-json-doc'
1994f950ff cmake: List valid values for --trace-format on the command line
e39766d84a Help: Fix documentation of --trace-format parameter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4500
2020-03-19 06:57:52 -04:00
Kyle Edwards
1994f950ff cmake: List valid values for --trace-format on the command line 2020-03-18 16:16:46 -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
Kyle Edwards
2ac835b9f9 Refactor: Allow generators to decide default configuration for build
And allow them to read any cache values they need.
2020-02-04 14:13:07 -05:00
Vitaly Stakhovsky
bbc07e4561 Source: use std::string in place of const char* 2020-01-29 14:31:01 -05:00
Brad King
a4d7a79beb Merge topic 'ninja-1.10'
ccaa0bccc4 Ninja: Do not clean metadata when re-generating inside a running build
657820a00b Ninja: Track when running to re-generate during a build
b12b013028 Ninja: Factor metadata cleanup into dedicated method
5d92e60d81 Ninja: Skip cleandead and recompact if build.ninja is missing
dd0a4718fd Ninja: Fix CMAKE_NINJA_OUTPUT_PATH_PREFIX with Ninja 1.10
0944caaebb Tests: Fix RunCMake.CMP0037 test with Ninja 1.10
9d4883cce5 Tests: Fix RunCMake.Ninja test for Ninja 1.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4290
2020-01-28 11:35:24 -05:00
Brad King
657820a00b Ninja: Track when running to re-generate during a build
Tell CMake explicitly when it is re-running inside a `ninja` invocation
to re-generate the build system.
2020-01-27 15:39:04 -05:00
Vitaly Stakhovsky
1398517f31 AppendProperty: convert value param to std::string 2020-01-25 10:37:00 -05:00
Marc Chevrier
a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +01:00
Marc Chevrier
5444a8095d cmGlobalGenerator: modernize memrory managemenbt 2019-12-30 16:55:39 +01:00
Kyle Edwards
bb811568cc Merge topic 'traceJSON'
e113ab1168 trace: Add test for the JSON-v1 trace
482497e0de trace: Add JSON output format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4102
2019-12-27 10:53:13 -05:00
Daniel Mensinger
482497e0de
trace: Add JSON output format
Add a new `--trace-format=` flag, to enable the new JSON trace
output format. This new format is easier to parse by machines
than the existing format. This new format also removes the
ambiguity of the whitespace in the "old" format (e.g. is that
whitespace part of a file path, or does it seperate arguments)
2019-12-23 14:05:36 +01:00
Kyle Edwards
61960fa466 Merge topic 'add_find_call_debugging'
f3c9396260 Help: Document CMAKE_FIND_DEBUG_MODE
204b8d9f4e find_*: Use debug logging infrastructure
a7ea20649d find_*: Add debug logging infrastructure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3935
2019-12-20 12:59:50 -05:00
Robert Maynard
a7ea20649d find_*: Add debug logging infrastructure
Enable debug messages a new `--find-debug` command-line option or via
the `CMAKE_FIND_DEBUG_MODE` variable.

This work was started by Chris Wilson, continued by Ray Donnelly, and
then refactored by Robert Maynard to collect information into a single
message per find query.

Co-Author: Ray Donnelly <mingw.android@gmail.com>
Co-Author: Chris Wilson <chris+github@qwirx.com>
2019-12-19 08:09:49 -05:00
Brad King
0607a50bb3 Merge topic 'add-header-cmext-algorithm'
f7d12609f0 Refactoring: use append functions from cmext/algorithm
a38d04c076 Refactoring: introduce header cmext/algorithm with append functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4131
2019-12-18 09:32:03 -05:00
Brad King
64e2891cbd Merge topic 'stdstring-target'
c34b4497f8 cmTarget: add std::string overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4137
2019-12-17 11:09:20 -05:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Vitaly Stakhovsky
c34b4497f8 cmTarget: add std::string overloads 2019-12-14 09:30:28 -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
Marc Chevrier
36c8cae2e8 cmLocalGenerator: modernize memory management 2019-12-10 00:24:06 +01:00
Sylvain Joubert
88cfef0821 ccmake: redirect stdout/stderr to the displayed logs
Use cmSystemTools to report some messages.
These should now be caught and displayed properly,
both in ccmake and cmake-gui

Avoid log display flickering during processing
- Don't clear the screen each time the long message form is rendered.
  It always renders the whole screen again so clearing it only causes
  flickering.
- Add scroll down capabilities to the long message form so that it can
  draw itself directly in the correct state. This removes the need to
  programatically scroll down just after that also caused flickering.

Fixes #19882
Fixes #13288
2019-11-16 08:27:32 +01:00
Brad King
b34b4c5eac Merge topic 'vs-vctargetspath'
e7d57bc3c3 VS: Propagate CMAKE_VS_GLOBALS into custom targets
45b4b4b930 VS: Propagate CMAKE_VS_GLOBALS into compiler id projects
548e9051a4 VS: Add support to override VCTargetsPath through toolset
99e83d4235 cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSET

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3817
2019-10-18 09:01:48 -04:00
Brad King
5417737fac Merge topic 'graphviz'
553658393c Graphviz: added test suite, fixes, enhancements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: slodki <slodki_dom@poczta.onet.pl>
Merge-request: !3766
2019-10-17 13:54:26 -04:00
Alexander Boczar
99e83d4235 cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSET
Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to
indicate when it is called from `cmake::build`.
2019-10-15 13:28:41 -04:00
Brad King
dc164bccc1 Merge topic 'cmake-initial-cache-relative'
c9d73b26b0 cmake: Fix relative path regression in -C

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3912
2019-10-15 11:14:09 -04:00
Peter Waller
c9d73b26b0 cmake: Fix relative path regression in -C
Since commit 4ca0526f8a (cmake: Pass -S and -B into PreLoad.cmake and -C
scripts, 2019-08-20, v3.16.0-rc1~195^2) the value of `CMAKE_SOURCE_DIR`
is the source directory rather than the current working directory.
This was correct on its own, but the place storing that value is also
used as the base for relative paths specified on the command line.
The latter should of course be relative to the current working
directory.

The fix is to switch to use a full path internally, unless a full path
is already specified.  Add tests for the behaviour of `-C` under these
four circumstances:

    {with -S, without -S} x {full path, relative path}

Fixes: #19827
2019-10-14 16:17:00 -04:00
Alex Turbov
7cf79f4419 message: Support logging a context with each message 2019-10-12 18:21:36 +11:00
Alex Turbov
5bf85e2517 message: Add new CMAKE_MESSAGE_LOG_LEVEL variable 2019-10-12 17:01:15 +11:00
Craig Scott
7bbddeb78d CLI: Rename --loglevel to --log-level for naming consistency
Other multi-word command line options use hyphens to separate
the words, so the --loglevel option introduced in CMake 3.15 was
inconsistent in this regard. Rename it to --log-level but still support
the original --loglevel name to preserve backward compatibility.
2019-10-10 09:20:50 -04:00
Corentin Plouet
553658393c Graphviz: added test suite, fixes, enhancements
* Added a fairly comprehensive test suite
* Separated the graph traversal logic from the Graphviz generation
  code by introducing a new class, cmLinkItemsGraphVisitor{.h,cxx}
* Made the graph traversal logic less ad-hoc by using existing
  methods in the GlobalGenerator; this fixed a few bugs
* Added support for new target types: custom targets, object
  and unknown libraries
* Improved support for ALIAS libraries by showing the alias(es)
  in the graph
* Introduced new flags to control those new libraries (consistent
  with existing flags)
* Updated the documentation
* Removed useless setting to set graph type in dot file
* Improved the node/edge shapes (nicer, more consistent)
* Added a legend to the graph
* Some refactoring and cleanup of the Graphviz generation code
* Added test and fix for issue 19746
2019-10-08 13:45:56 +11:00