980 Commits

Author SHA1 Message Date
Artur Ryt
dfd5ae7da7 Help: Mark default CMake generator with asterisk
Required extracting default generator evaluation
to explicit function, as Visual Studio generators
get validated during their construction.

Fixes: #18544
2019-01-18 12:57:34 -05:00
Artur Ryt
7408cd3929 cmake: Return generator docs directly
The GetGeneratorDocumentation() function was not accurately
named and required the vector to populate to be passed as a
function argument. This commit makes the slightly renamed
function return by value, making it a true getter as implied
by its name. Some minor refactoring of the implementation
also makes the steps of populating the vector clearer.
2019-01-18 12:57:32 -05:00
Brad King
8bba458ea5 Add global generator factory method to get default platform name 2019-01-18 12:30:19 -05:00
Brad King
818df52c48 Add global generator factory method to get list of known platforms
Add a `cmGlobalGeneratorFactory::GetKnownPlatforms` method to return
a list of known possible values for `CMAKE_GENERATOR_PLATFORM`.
Implement the method for each generator by referencing the list of
possible values documented in `Help/generator/*.rst` for it.

Co-Author: Julien Jomier <julien.jomier@kitware.com>
2019-01-18 12:29:53 -05:00
Brad King
8144b00e32 Split global generator factory list with and without platforms
Replace `cmGlobalGeneratorFactory::GetGenerators` with a pair of methods
to split the list of generator names into those that have platforms in
the name and those that do not.
2019-01-18 12:29:53 -05:00
Regina Pfeifer
ef61997b1b clang-tidy: Use emplace 2019-01-17 13:12:02 -05:00
Vitaly Stakhovsky
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument
Same for cmMakefile::ReadDependentFile(); some cleanup
2019-01-17 12:36:07 -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
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Brad King
41b0c0dc73 Merge topic 'vs2019'
57e48f16f2 VS: Add Visual Studio 16 2019 generator
bdef729646 VS: Parameterize VS 2017 generator to support future versions
68d316e0cf VS: Rename VS 2017 generator sources to be version-independent
d8ed309d05 VS: Parameterize cmVSSetupAPIHelper instances with VS version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2789
2019-01-15 13:23:38 -05:00
Brad King
1f411b0cfa Merge topic 'cmake-option-parsing'
27eb7c5bdb cmake: Ensure source and binary dirs are set
a1adbc7243 cmake: Stop processing if -P option lacks file name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2799
2019-01-14 07:25:46 -05:00
Craig Scott
27eb7c5bdb cmake: Ensure source and binary dirs are set
If only the source dir is provided, the binary dir is assumed
to be the working directory. If only the binary dir is provided
and it doesn't yet have a CMakeCache.txt to provide the
source dir, then the source dir is assumed to be the working
directory. This logic was not previously being handled
correctly when -S and/or -B options were involved.
Furthermore, when both were missing, no suitable error
message was provided and an empty string was used for
the build directory.

Fixes: #18707
2019-01-14 07:13:28 +11:00
Brad King
57e48f16f2 VS: Add Visual Studio 16 2019 generator
Add this generator *without* support for specifying the target
architecture in the generator name.  cmake-gui will be taught
to provide a field for this, and command-line builds can use -A.

Also, teach this generator to select a default target architecture
based on the host architecture.

Fixes: #18689
Inspired-by: Egor Pugin <egor.pugin@gmail.com>
2019-01-11 11:04:51 -05:00
Brad King
68d316e0cf VS: Rename VS 2017 generator sources to be version-independent
Rename `cmGlobalVisualStudio{15 => Versioned}Generator`.  Rename
`Factory` to `Factory15` since that part still needs to be
version-specific.
2019-01-11 10:37:39 -05:00
Brad King
d8ed309d05 VS: Parameterize cmVSSetupAPIHelper instances with VS version 2019-01-11 10:37:38 -05:00
Paul Seyfert
6d53a60f00 cmake: distinguish '-Cpath' from '-C path' in source dir parsing
This results in the correct source directory being picked up in calls
with

    cmake sourcedir -C settings

and in a more appropriate error message when calling

    mkdir build ; cd build ; cmake -C settings

Also fix `-D` and `-U` in the same way.
2019-01-10 21:19:24 +11:00
Brad King
5395c526fc cmake: Drop unused table entry for selecting default generator
In `cmake::CreateDefaultGlobalGenerator` the table of registry entries
does not need an entry for VS 2017 because that is found via the VS
setup helper.
2019-01-09 11:31:55 -05:00
Craig Scott
124a8632cb Merge topic 'messenger-no-cmstate-v2'
8a803d784b cmMessenger: Decouple from cmState

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2653
2019-01-02 15:31:39 -05:00
Bruno Manganelli
8a803d784b cmMessenger: Decouple from cmState 2019-01-01 11:55:08 +11:00
Brad King
eb2ec41a04 fileapi: Add protocol v1 infrastructure with support for shared query files
Add a file-based API that clients may use to get semantic information
about the buildsystem that CMake generates.  Clients will write query
files under a designated location in the build tree, and CMake will
write reply files for clients to read.

Start with support for shared stateless query files.  These allow
clients to share requests for major object versions and get all those
recognized by CMake.  Once any client has written a shared request to a
build tree it will persist.  Other clients will not need to overwrite
the request (since it is stateless) and should not remove it either.

For now we add only an undocumented object kind to use for testing the
query and reply infrastructure.  Object kinds providing real semantic
information will be added later.

Issue: #18398
2018-12-12 06:39:30 -05:00
Regina Pfeifer
5731ec30f0 clang-tidy: fix warnings from version 7
Fix some warnings that are new since clang-tidy version 4, and update
`.clang-tidy` to suppress the rest.
2018-11-20 10:36:08 -05:00
Cengizhan Pasaoglu
c67ab22cdc Using front() and back() instead of calculations 2018-11-06 21:43:33 +03:00
Brad King
bcd61da350 Merge topic 'graphviz-fix-alias'
50c4dec072 graphviz: dereference ALIAS targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2521
2018-10-29 09:56:25 -04:00
Nick Schultz
50c4dec072 graphviz: dereference ALIAS targets
Previous behavior treats ALIAS targets as external targets.
This fix de-aliases these targets to their pointed target.

Fixes: #15636
2018-10-26 11:17:49 -04:00
Paul Seyfert
5873815fef cmake: distinguish '-Cpath' from '-C path' in source dir parsing
This results in the correct source directory being picked up in calls
with

    cmake sourcedir -C settings

and in a more appropriate error message when calling

    mkdir build ; cd build ; cmake -C settings

Also fix `-D` and `-U` in the same way.
2018-10-26 09:50:00 -04:00
Brad King
d8294fefe8 cmake: Fix generator platform under --build mode 2018-09-25 13:27:08 -04:00
Brad King
fc43492e44 cmake: Factor json version object construction into helper 2018-09-21 11:36:11 -04:00
Brad King
ec9ef691fe Merge topic 'provide_explicit_source_and_build_command_line_options'
638f00117a Add release note for the -S and -B options.
de962cc00d CMake: Internally uses -S instead of -H to specify source directory
a10d63d578 cmake: -S and -B can be used to specify source and build directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2358
2018-09-19 10:38:19 -04:00
Robert Maynard
a10d63d578 cmake: -S and -B can be used to specify source and build directories
Document the previously internal option of '-B' and provide a
matching source directory option with '-S'. Both '-B', and '-S'
can be used independently of each other.
2018-09-15 11:25:47 -04:00
Vitaly Stakhovsky
13d10ee616 cmState::GetInitializedCacheValue: Return as const std::string* 2018-09-10 09:31:48 -04:00
Brad King
fb73edf70c cmake: Drop unnecessary working mode checks
In `cmake::Run` we return before `Configure` or `Generate` when
not working in normal mode so they do not need mode checks.

While at it, remove a long-outdated comment about when to save the
cache.
2018-08-29 09:38:32 -04:00
Vitaly Stakhovsky
69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls 2018-08-07 15:28:24 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00
Florian Maushart
1ab3881ec9 cmake: Add options for parallel builds to --build mode
While we already support `cmake --build . -- -j`, the options after `--`
are specific to the native build tool.  Add new options `--parallel
[<N>]` and `-j [<N>]` to abstract this and map to the proper option
for the native build tool.
2018-05-25 09:42:20 -04:00
Brad King
d308e9442e Merge topic 'glob_configure_depends'
6c4f8b4596 Adjust help documentation for file(GLOB), add topic notes
20612978c8 Add tests for `file(GLOB)` CONFIGURE_DEPENDS flag
3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators
ca0befc2e1 Add `CONFIGURE_DEPENDS` flag support to cmFileCommand::HandleGlobCommand
599c93e22d Add cmGlobVerificationManager class, integrate with cmake and cmState

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1767
2018-04-06 10:25:08 -04:00
Brad King
eb80af9093 Drop Visual Studio 8 2005 generator
This generator has been deprecated since CMake 3.9.  Remove it.
2018-04-02 10:08:10 -04:00
Shane Parris
3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators 2018-04-01 23:16:12 -04:00
Shane Parris
599c93e22d Add cmGlobVerificationManager class, integrate with cmake and cmState 2018-03-29 10:58:03 -04:00
Craig Scott
e60e4dfc88 cmWorkingDirectory: Check success of current dir changes 2018-03-08 20:07:14 +11:00
Brad King
83f8e76467 cmake: Fix global generator path style in --build mode
Fix the `--build` code path so that `cmSystemTools::SetForceUnixPaths`
is called with the global generator's path style.  This makes forwarding
of `--target subdir/src.c.obj` match the slash style the generator
placed in the build system.

Fixes: #17742
2018-02-21 10:13:47 -05:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03:00
Brad King
92cd3d0677 Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1698
2018-01-29 08:05:27 -05:00
Brad King
f343106b19 Merge topic 'ctest-chrono'
e6a80ccf Make use of std::chrono throughout every component
ff62b005 CTest: add safe conversion from cmDuration to integer types
695951bc CTest: introduce cmDuration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1592
2018-01-26 08:27:37 -05:00
Pavel Solodovnikov
c85bb007df Reduce allocation of temporary values on heap.
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
2018-01-26 13:24:45 +03:00
Alex Neundorf
551bd0b3e8 Generators: adjust error message for the removed KDevelop3 generator
If the user request a KDevelop3 project, tell the user that
KDevelop3 is not supported anymore, so he sees it's not just
a typo.

Alex
2018-01-24 08:30:02 -05:00
Alex Neundorf
9198e6a27b Generators: remove KDevelop3 generator
The last KDevelop3 release was many years ago, in 2008 I think.
I haven't seen or read about anybody using KDevelop 3 since a
long time, so I think it can safely be removed from CMake.
KDevelop 4 (first released in 2010) has its own proper CMake
support now, independent from this generator.

Alex
2018-01-24 08:30:02 -05:00
Wouter Klouwen
e6a80ccfc4 Make use of std::chrono throughout every component
This commit continues the changes made in CTest to support std::chrono
by
applying it throughout every component where a duration was used.

No functional change intended.
2018-01-23 18:56:42 +00:00
Brad King
e68a269cd2 Merge topic 'cache-truncate-newlines'
c42b377c cmCacheManager: Test and document newline truncation behavior
a9c48307 cmCacheManager: Truncate values containing newlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1652
2018-01-19 10:08:06 -05:00
Kyle Edwards
a9c483071e cmCacheManager: Truncate values containing newlines
Fixes #16098.
2018-01-15 09:27:44 -05:00
Robert Maynard
81868e6bad CUDA: Add cu as default source file extension 2018-01-08 16:16:52 -05:00