Commit Graph

30 Commits

Author SHA1 Message Date
Kyle Edwards 33b1338a92 Tests: Add test for --list-presets=all 2022-09-23 10:20:03 -04:00
Kyle Edwards e7087308ce cmake --list-presets: List package as a valid option 2022-09-15 14:50:55 -04:00
Kyle Edwards 215b9148eb CMakePresets.json: Fix formatting of --list-presets=all
Only print an extra newline after a section if that section was
actually printed.
2022-08-31 10:13:32 -04:00
Erin Melucci ba969ce5fe cmake-presets: add ${pathListSep} macro
Fixes: #23282
2022-05-12 10:37:49 -04:00
Robert Maynard 45299a8f9b cmake: --list=presets=[type] doesn't generate incorrect warnings
Fixes #23407
2022-04-11 10:46:03 -04:00
Kyle Edwards f54507c2f6 CMakePresets.json: Add ${fileDir} macro
Fixes: #23214
2022-03-07 18:03:16 -05:00
Craig Scott 6404751176 Help: Improve wording and structure related to preset includes
Encourage placing preset includes near the beginning of a preset
file and ensure the example shows that usage. Move the prose
discussing includes to its own section to improve discoverability
and break up paragraphs to make each main point harder to miss.

Also clarify ${sourceDir} to remove any ambiguity with regard to
its meaning in included files.

Issue: #23214
2022-03-02 11:37:57 +11:00
Kyle Edwards 26a5512c0f CMakePresets: Add include field
Fixes: #21331
2022-01-06 19:46:41 -05:00
Kyle Edwards 3e42bf3e05 CMakePresets: Check presets with their own file version
06e6981 added support for optional binaryDir and generator, but
use the dependent preset's file version instead of the current
preset's file version. Check presets with their own file version
instead of their dependent's file version.

Fixes: #22428
2021-07-27 11:45:57 -04:00
Kyle Edwards aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir
When resolving binaryDir into a full path from a relative path, we
forgot to check if binaryDir is altogether empty, causing empty
binaryDir's to resolve to the source directory. Fix this.

Fixes: #22434
2021-07-16 10:25:40 -04:00
Brad King fa16b462f1 Tests: Fix RunCMake.CMakePresets example PATH format
Since commit 94c955e508 (Tests: Test the CMakePresets.json example in
the documentation, 2020-10-09, v3.19.0-rc1~8^2) we transform the
documented preset example for testing by replacing the generator.
Extend the transformation with a step to fix `PATH` env var syntax.
2021-05-05 10:13:35 -04: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
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
Kyle Edwards 5ac8b923f5 CMakePresets.json: Add matches condition 2021-03-31 10:24:24 -04:00
Kyle Edwards 8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets 2021-03-22 15:04:54 -04:00
Kyle Edwards 0d497e159b CMakePresets.json: Add ${hostSystemName} macro 2021-03-15 14:41:42 -04:00
Robert Maynard b227a9565e cmake: configure preset add support for --install-prefix mapping 2021-03-09 13:53:16 -05:00
Brad King 414cfc6ecb Merge topic 'preset-flag-consistency'
6fa3647023 ctest: Add support for '--prefix=<prefix>' form of the argument
3357d37761 cmake: Add support for '--build --prefix=<prefix>' form of the argument
2f13fdef0a cmake: Document '--preset <preset>' form of the argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5849
2021-02-24 09:46:52 -05:00
Brad King 06e16ea008 Merge branch 'backport-3.19-preset-no-comments' into preset-no-comments 2021-02-24 09:33:59 -05:00
Kyle Edwards 431dd59b5e CMakePresets.json: Remove undocumented support for comments
Fixes: #21858
2021-02-24 09:28:36 -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 56751c83aa Tests: Factor out RunCMake.CMakePresets schema validation
Make it available to similar tests.  Also fix whitespace
in generated error message.
2021-02-04 11:00:42 -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
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
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 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
Kyle Edwards e3bce8edf4 Tests: Add JSON schema validation to CMakePresets.json tests 2020-10-20 12:07:09 -04:00
Kyle Edwards 94c955e508 Tests: Test the CMakePresets.json example in the documentation 2020-10-09 15:35:54 -04:00
Kyle Edwards a395cb516b CMakePresets.json: Prohibit empty variable names 2020-10-06 12:09:38 -04:00
Kyle Edwards 8617479061 CMake: Add presets functionality 2020-10-05 09:49:59 -04:00