Commit Graph

1130 Commits

Author SHA1 Message Date
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Brad King
072f8b7d0e Merge topic 'presets-build-fixes'
de2b14a711 Merge branch 'backport-3.20-presets-build-fixes' into presets-build-fixes
534c40e6d8 presets: Fix buildPreset "targets" not allowing a single string
5d67632813 presets: Fix buildPreset "jobs"
93e396b402 presets: Fix buildPreset "jobs" field test case
efe7ac9022 presets: Fix buildPreset "targets" not allowing a single string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6190
2021-06-09 07:57:34 -04:00
Sam Freed
de2b14a711 Merge branch 'backport-3.20-presets-build-fixes' into presets-build-fixes 2021-06-08 07:49:50 -04:00
Sam Freed
5d67632813 presets: Fix buildPreset "jobs"
Fixes: #22273
2021-06-08 07:47:24 -04:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Brad King
6c34ed9b87 cmake: Allow CMAKE_TOOLCHAIN_FILE to be set by environment variable
When no `CMAKE_TOOLCHAIN_FILE` is explicitly specified while creating
a new build tree, check for an environment variable of the same name.
2021-06-03 08:32:44 -04:00
Jake Cobb
c3bd5a6a2c cmake-gui: Unset empty CC,CXX on global generator change
On subsequent runs of configure from cmake-gui the global generator is
swapped.  So on runs other than the first it was setting CC and CXX to
empty when they were otherwise undefined.

Instead, restore them if non-empty and unset them if empty when changing
the global generator and a previous generator exists.

Fixes: #21449
2021-05-24 11:34:07 -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
Marc Chevrier
f5fa6d53b0 class cmake: Store working directory at cmake launch 2021-05-11 18:16:08 +02:00
Brad King
a94332ed37 Merge topic 'cmprop-nullptr'
ce97b7909b Source: Remove unnecessary comparisons to nullptr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6112
2021-05-11 09:26:39 -04:00
Brad King
d0b6eb8ec7 Merge topic 'capabilties-generator-platforms'
66be34853c cmake: add supported platforms to cmake -E capabilties report

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6102
2021-05-11 09:22:47 -04:00
Vitaly Stakhovsky
ce97b7909b Source: Remove unnecessary comparisons to nullptr 2021-05-10 11:44:53 -04:00
scheffle
66be34853c cmake: add supported platforms to cmake -E capabilties report 2021-05-10 10:28:28 -04:00
Josef Angstenberger
5950e54325
Source: Fix typos and spelling in comments 2021-05-07 17:00:18 +02:00
Robert Maynard
a9b968bb98 cmake-presets: Introduce toolchainFile preset option
In v3 of the presets, the `--toolchain` command line argument now
has a preset mapping.
2021-04-28 17:22:25 -04:00
Brad King
835896e985 cmake: Improve error message when failing to update generation timestamp
Include the underlying system error description.

Issue: #21571, #22086
2021-04-21 10:45:16 -04:00
Brad King
5ac713da70 Merge topic 'mrjoel/add-missing-not'
370bebd921 Add missing 'not' in error messages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6012
2021-04-19 09:44:03 -04:00
Brad King
bb290fc7a4 Merge topic 'add_toolchain_cmake_option'
d5c3e4ac32 cmake: add support for --toolchain command argument
13838bbb36 CMAKE_TOOLCHAIN_FILE: Document relative path behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5991
2021-04-16 11:39:28 -04:00
Joel Johnson
370bebd921 Add missing 'not' in error messages 2021-04-16 07:47:59 -06:00
Robert Maynard
d5c3e4ac32 cmake: add support for --toolchain command argument 2021-04-15 10:13:49 -04:00
friendlyanon
06e6981336 cmake-presets: Make generator and binaryDir fields optional
In v3 of the presets, generator and buildDir can be omitted to fall
back to regular cmake behavior when these values are not explicitly
provided by the user.

Fixes: #21987
2021-04-07 01:24:44 +02:00
Brad King
928f4bda30 Merge topic 'cmake-presets-condition'
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets
ce6ea7c927 Refactor: Move some common code into separate file
ebbd475e54 Refactor: Move cmCMakePresetsFile::ReadJSON into a separate file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5919
2021-03-23 10:33:59 -04:00
Kyle Edwards
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets 2021-03-22 15:04:54 -04:00
Andrew Gilewsky
7c4c4f1406 Treat '.ixx' and '.cppm' files as C++ sources
These extensions are used by convention for C++ modules and interface
units with MSVC.
2021-03-22 11:58:44 -04:00
Robert Maynard
b227a9565e cmake: configure preset add support for --install-prefix mapping 2021-03-09 13:53:16 -05:00
Robert Maynard
38140713ad cmake: add support for --install-prefix command argument
Fixes: #21781
2021-03-04 10:50:24 -05:00
Brad King
a133a583d4 cmLocalGenerator: Clarify GetIncludeFlags signature
Make the `config` argument non-optional so all callers must be explicit.
Convert the path style argument to an enumeration to make its role clear
at call sites.

The path style argument is implemented by `ConvertToIncludeReference`,
which was introduced with the Ninja generator by commit 5b114c9bee
(Introduce a cmLocalGenerator::ConvertToIncludeReference function,
2011-09-07, v2.8.7~187^2~4).  Its only purpose is to allow the Ninja
generator to use relative paths in `-I` flags.  Add a comment explaining
this role.
2021-02-25 13:24:45 -05:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00
Brad King
05f4248e3d Merge topic 'cpp-modules'
39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files
791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep
4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object
b0fc2993e1 Treat the '.mpp' file extension as C++ code
988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
dacd93a2db ninja: De-duplicate version numbers required for ninja features
533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Shannon Booth <shannon.ml.booth@gmail.com>
Merge-request: !5562
2021-01-07 08:26:28 -05:00
Robert Maynard
0fb78576b0 cmake: Use shared parsing code for all cmake argv parsing 2021-01-06 09:11:14 -05:00
Ben Boeckel
b0fc2993e1 Treat the '.mpp' file extension as C++ code
This is the extension required in build2 for C++ module support.
2021-01-05 09:29:18 -05:00
Brad King
f70814c3fd Merge topic 'install-properties'
63db7ae9c4 cmake: Clear INSTALL file properties between runs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5603
2020-12-14 07:08:49 -05:00
Brad King
63db7ae9c4 cmake: Clear INSTALL file properties between runs
Do not keep state across separate project configurations.
This is particularly important in `cmake-gui` where those
configurations can be for separate projects.

Fixes: #21580
2020-12-11 12:30:27 -05:00
Robert Maynard
1b6c5333a0 cmake: Error out on unknown arguments starting with -.
Fixes: #21521
2020-12-01 09:04:08 -05:00
Brad King
7302a23a1f cmake: Simplify -W recognition of no- and error= prefixes 2020-11-19 08:53:58 -05:00
Robert Maynard
98290782b6 cmake: redesign command-line argument parsing
Make handling more consistent:

   "-S" -> invalid
   "-S/path/to/source" -> valid
   "-S /path/to/source" -> valid
   "-S=/path/to/source" -> now valid

   "-D" -> invalid
   "-DStr" -> valid
   "-D Str" -> valid
   "-D=Str" -> now valid

   "--log-level=" -> invalid
   "--log-level" -> invalid
   "--log-level=2" -> valid
   "--log-level 2" -> now valid
2020-11-19 08:53:58 -05:00
Brad King
d800c26ce9 cmake: Fix processing of -Wno-error= flags
Fix two bugs that happened to cancel each other out for cases covered
by our test suite.  Add a test case that distinguishes them.
2020-11-17 13:22:52 -05:00
Vitaly Stakhovsky
f6e7d5f3a0 Reduce the scope of temporary cmProp variables and other improvements 2020-11-05 11:07:39 -05:00
Brad King
db02ccf406 Merge topic 'cmake-presets-no-path-arg-warning'
cb2d01c182 CMakePresets.json: Don't warn if no path argument is given

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5455
2020-11-03 07:24:25 -05:00
Kyle Edwards
cb2d01c182 CMakePresets.json: Don't warn if no path argument is given
If --preset is specified with no path argument, use the current
directory as the source directory, the preset's binaryDir as the
binary directory, and don't issue the standard warning for no path
specified.

Fixes: #21386
2020-11-02 09:46:08 -05: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
Craig Scott
698851cdb7 Merge topic 'cmake-presets-path-arg' into release-3.19
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5416
2020-10-27 07:33:45 -04:00
Brad King
388dc4d2ac Merge topic 'correct_profiling-output_exception'
afac7482d2 cmake: command arguments which use '=' behave consistently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5414
2020-10-26 10:29:23 -04:00
Brad King
9fa7afe7d3 Merge topic 'correct_profiling-output_exception' into release-3.19
afac7482d2 cmake: command arguments which use '=' behave consistently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5414
2020-10-26 10:29:22 -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
Robert Maynard
afac7482d2 cmake: command arguments which use '=' behave consistently
Fixes: #21351

The `profiling-format`, `profiling-output`, and `preset` all would
crash when invoked without a trailing `=`.
2020-10-23 09:12:43 -04:00
Craig Scott
dbd1d737f9 Merge topic 'cmake-presets-toolset-arch-config'
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5387
2020-10-23 06:37:56 -04:00
Kyle Edwards
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field
Make this field separate for both architecture and toolset. Allow
architecture and toolset to be either strings or objects with value
and strategy fields.

Fixes: #21317
2020-10-22 11:24:39 -04:00
Kyle Edwards
5ef9978087 Merge topic 'cmake-presets-invalid-macro'
638557cbfe CMakePresets.json: Properly report macro expansion errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5397
2020-10-22 11:05:09 -04:00
Kyle Edwards
638557cbfe CMakePresets.json: Properly report macro expansion errors
Make a distinction between strings which simply use the
$vendor{<...>} macro, which is valid but makes it unusable by CMake,
and strings which actually contain invalid macro expansions.

Fixes: #21308
2020-10-21 09:20:52 -04:00