Commit Graph

2133 Commits

Author SHA1 Message Date
Brad King
02cf404ace Help: Add advice for dealing with semicolons in lists
Issue: #23315
2022-03-15 15:49:13 -04:00
John Parent
2f1ffa003c find_package: Add support for default GLOBAL imported targets
Allow find package to promote scope of imported targets by specifying
an argument to `find_package` or by specifying a CMake variable.
    * Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable
    * Add support for GLOBAL argument to find_package

Additionally add testing for above features.
2022-03-10 12:44:36 -05:00
Brad King
cbd36eac23 Merge topic 'ctest_truncate'
140704d443 ctest: add option for output truncation
359e5b17d8 presets: bump version to v5
4634de335b cmCTestTestHandler: refactor CleanTestOutput method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6993
2022-03-09 12:17:44 -05:00
Brad King
51e81d1f73 Merge topic 'color-diagnostics'
6ab9fbd43b color: Add tests for CMAKE_COLOR_DIAGNOSTICS
78adb1b952 color: Add CMAKE_COLOR_DIAGNOSTICS environment variable
884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Frank Dana <ferdnyc@gmail.com>
Merge-request: !6990
2022-03-09 12:15:53 -05:00
Semyon Kolton
78adb1b952 color: Add CMAKE_COLOR_DIAGNOSTICS environment variable 2022-03-08 16:38:13 -05:00
Semyon Kolton
884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable
Add a variable to control both makefile color messages and compiler
color diagnostics.

Fixes: #15502
2022-03-08 16:37:08 -05:00
Brad King
28f8b5cb0c Merge topic 'cmake-presets-file-dir'
f54507c2f6 CMakePresets.json: Add ${fileDir} macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !7051
2022-03-08 16:03:15 -05:00
Brad King
11c25ae6ae Merge topic 'cmake-presets-file-dir' into release-3.23
f54507c2f6 CMakePresets.json: Add ${fileDir} macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !7051
2022-03-08 16:03:14 -05:00
Brad King
f78cd55453 Merge topic 'doc-lang-std-features'
fbda79f39d Help: Document explicitly that 'cxx_std_##' features may not add a flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: antmak <antmak.pub@gmail.com>
Merge-request: !7043
2022-03-08 08:25:20 -05:00
Frank Winklmeier
140704d443 ctest: add option for output truncation
Add `--test-output-truncation` to `ctest`. This option can be used to
customize which part of the test output is being truncated. Currently
supported values are `tail`, `middle` and `head`.

Also add equivalent `CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable.

Fixes: #23206
2022-03-08 08:18:02 -05:00
Frank Winklmeier
359e5b17d8 presets: bump version to v5
Prepare for new test preset fields.
2022-03-08 08:18:02 -05:00
Kyle Edwards
f54507c2f6 CMakePresets.json: Add ${fileDir} macro
Fixes: #23214
2022-03-07 18:03:16 -05:00
Brad King
49642079e5 Merge topic 'LINK_LIBRARY-libraries'
9fb1dff070 LINK_LIBRARY: Add features for library support on Apple
93a153bc7f Genx-LINK_LIBRARY: simplify framework features definitions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7029
2022-03-07 10:04:13 -05:00
Brad King
7e807479ff Merge topic 'LINK_GROUP-rescan-static-libs'
b0fada9964 Genex-LINK_GROUP: Add feature RESCAN

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7044
2022-03-07 10:03:36 -05:00
Brad King
fbda79f39d Help: Document explicitly that 'cxx_std_##' features may not add a flag
This is commonly reported incorrectly as a bug, so call out this
behavior explicitly in the documentation.
2022-03-07 09:48:26 -05:00
Marc Chevrier
9fb1dff070 LINK_LIBRARY: Add features for library support on Apple 2022-03-05 13:57:45 +01:00
Marc Chevrier
b0fada9964 Genex-LINK_GROUP: Add feature RESCAN
Feature RESCAN can be used to manage circular references between
static libraries.
2022-03-05 12:40:26 +01:00
Brad King
30313aa721 while: diagnose errors during condition evaluation
Add a policy to diagnose condition errors in a compatible way.

Fixes: #23296
2022-03-04 13:55:12 -05:00
Brad King
11abe00616 Merge topic 'doc-presets-v4'
6404751176 Help: Improve wording and structure related to preset includes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7028
2022-03-02 07:49:45 -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
Marc Chevrier
0a81ea1f12 Genex-LINK_GROUP: Add possibility to group libraries at link step
Fixes: #23121
2022-02-28 10:26:26 +01:00
Marc Chevrier
397ee55cd6 genex-LINK_LIBRARY: rename configuration variables
To be more consistent between genex and variables as well as
the forecomming LINK_GROUP genex, rename variable *_LINK_USING_<FEATURE>*
in *_LINK_LIBRARY_USING_<FEATURE>*
2022-02-16 18:34:28 +01:00
Brad King
731bdec8b9 Merge topic 'vs-package-restore-docs'
d92469e572 Help: Clarify how package resolve mode is intended to be used
f320a31087 cmake --build: prioritize --resolve-package-references over preset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6984
2022-02-16 09:41:03 -05:00
Carsten Rudolph
d92469e572 Help: Clarify how package resolve mode is intended to be used
Fixes: #23223
2022-02-15 10:20:14 -05:00
Carsten Rudolph
f320a31087 cmake --build: prioritize --resolve-package-references over preset
Fixes: #23224
2022-02-15 10:20:02 -05:00
Brad King
c3c6408609 Merge topic 'doc-example-package-components'
5317015e68 Help: use package-specific var for supported component list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6975
2022-02-15 09:48:28 -05:00
Brad King
fb925e5443 Merge topic 'doc-example-package-components' into release-3.23
5317015e68 Help: use package-specific var for supported component list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6975
2022-02-15 09:48:27 -05:00
Brad King
5b84e106e7 Merge topic 'doc-no-versioned-soname'
3f7e6b3fd4 Help: Document CMAKE_PLATFORM_NO_VERSIONED_SONAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6978
2022-02-15 09:47:35 -05:00
Brad King
9feafb36c0 Merge topic 'doc-no-versioned-soname' into release-3.23
3f7e6b3fd4 Help: Document CMAKE_PLATFORM_NO_VERSIONED_SONAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6978
2022-02-15 09:47:34 -05:00
Ralf Habacker
3f7e6b3fd4 Help: Document CMAKE_PLATFORM_NO_VERSIONED_SONAME
This variable was added by commit 42f74df6d4 (Add basic Android platform
module, 2014-06-06, v3.1.0-rc1~416^2), but was not previously documented.

Fixes: #23227
2022-02-14 10:40:48 -05:00
Connor Imes
5317015e68 Help: use package-specific var for supported component list
Always using `_supported_components` causes conflicts when transitive
dependencies also set this variable, e.g., because the developers
followed these code samples.

An even more general approach could be to set
`_${CMAKE_FIND_PACKAGE_NAME}_supported_components` instead, but such a
change should then be applied to other variables for consistency.

Fixes: #23112
2022-02-14 10:16:52 -05:00
Brad King
c033892e07 Merge topic 'doc-debug-find-pkg-var'
8efd4b5378 cmake::GetDebugFindPkgOutput: Use consistent argument name
546922a57b Help: Fix typo and improve docs for --debug-find-pkg|var options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6977
2022-02-14 10:00:45 -05:00
Craig Scott
546922a57b Help: Fix typo and improve docs for --debug-find-pkg|var options
Amends d7b18895bc (cmake: Add filtered debug-find options, 2021-12-07)
2022-02-14 21:06:06 +11:00
Braulio Valdivielso Martinez
8e1e97ccca Trace: include line_end field in json-v1 format
After !6954 got merged, it has become easier for tools to get
full stack-traces for runtime traces of a CMake program. The trace
information already included in the JSON objects (line number, source
file path) allows tools that display these stack traces to print the
CMake source code associated to them. However, CMake commands may
spawn multiple lines, and the JSON information associated to a trace
only contains the line in which the command started, but not the one
in which it ended. If tools want to print stack traces along the
relevant source code, and they want to print the whole command
associated to the stack frame, they will have to implement their own
CMake language parser to know where the command ends.

In order to simplify the life of those who want to write tooling for
CMake, this commit adds a `line_end` field to the json-v1 trace
format. If a given command spans multiple lines, the `line_end` field
will contain the line of the last line spanned by the command (that of
the closing parenthesis associated to the command).
2022-02-09 13:30:11 -05:00
Brad King
e40cea3fe9 Merge topic 'genex-LINK_LIBRARY-to-decorate-library'
2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property
42965799b4 Genex: Add $<LINK_LIBRARY:...>
78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse
4b55828a9f cmExpandListWithBacktrace: add handling of empty elements.
28d7432468 cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6769
2022-02-09 09:28:20 -05:00
Brad King
3d5466d5e9 Merge topic 'trace-global-frame'
a41d6e4d7a Trace: add global_frame field to json-v1 format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6954
2022-02-09 09:04:43 -05:00
Brad King
25003baf50 Merge topic 'vs_buildcache_support'
b764c7c273 VS: Add property to turn off Visual Studio compile batching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6957
2022-02-09 08:59:45 -05:00
Marc Chevrier
2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property
To enable the management of incompatible $<LINK_LIBRARY> declarations,
add LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> target
properties.
2022-02-08 11:41:04 +01:00
Kaloyan Donev
b764c7c273 VS: Add property to turn off Visual Studio compile batching
Resolves: #23179
2022-02-08 08:07:00 +02:00
Marc Chevrier
42965799b4 Genex: Add $<LINK_LIBRARY:...>
This generator expression offers the capability, for the link step, to
decorate libraries with prefix/suffix flags and/or adding any specific flag for each
library.

Fixes: #22812, #18751, #20078, #22703
2022-02-08 00:02:32 +01:00
Braulio Valdivielso Martinez
a41d6e4d7a Trace: add global_frame field to json-v1 format
Tools using the json-v1 format might want to trace stack frames across
different `CMakeLists.txt` files, in order to, for example, provide
stacktraces that span from the top-level `CMakeLists.txt` in a
project. One would think that `frame` lets you do that, but it
doesn't, because it tells you the depth of the stack within the
current `CMakeLists.txt`, so it gets reset across calls to
`add_subdirectory`.

The solution involves adding a field with a "global frame". This value
gets incremented on calls to `add_subdirectory`, which makes it easier
for tools to reconstruct "global stacktraces".

I considered changing the current "frame" value, but I didn't because
it would be a breaking change. I cannot think of any use-case where
"frame" is more useful to "global-frame", but maybe I'm missing
something.
2022-02-07 16:03:22 -05:00
Peter Würth
b10930040d cmcmd: add end of options delimiter to cmake -E commands
Implements a -- delimiter, that indicates the end of options (starting
with a dash -) of a command and separates them from the subsequent
operands (positional arguments).

The following commands are affected:
- env: Implemented the -- delimiter.
- cat: The -- delimiter was already kind of considered, but its
  occurence did not stop the options parsing.
- rm: Here the command already implemented the -- delimiter as
  specified, but it was not documented.

Fixes #22970
2022-02-03 21:54:17 +01:00
Peter Würth
892c96dda0 Help: add versionadded markup to cmake -E commands 2022-02-03 09:39:56 -05:00
Brad King
d738939355 Merge topic 'doc-imported-no-system'
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6942
2022-02-03 07:52:46 -05:00
Brad King
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories
Mention that system include directories are searched after normal
include directories.

Document that `IMPORTED_NO_SYSTEM` and `NO_SYSTEM_FROM_IMPORTED`
do not affect `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`.
2022-02-03 06:21:37 -05:00
Kyle Edwards
201d8c4298 find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable
Fixes: #20878
2022-02-02 11:09:00 -05:00
Brad King
5305d5aa1a Merge topic 'link-interface-direct'
f3ad061858 Add usage requirements to update direct link dependencies
193a999cd5 cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage
22d5427aa6 cmGeneratorTarget: Add LookupLinkItem option to consider own target name
f3d2eab36a cmGeneratorTarget: Fix link interface caching of partial results
d75ab9d066 cmGeneratorTarget: Clarify CMP0022 logic in ComputeLinkInterfaceLibraries
f3e9e03fe0 cmGeneratorTarget: Simplify CMP0022 warning check
216aa14997 cmGeneratorTarget: Return early from ExpandLinkItems with no items
1bc98371d1 Tests: Remove unnecessary policy setting from ObjectLibrary test
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6886
2022-01-31 10:36:55 -05:00
Brad King
f3ad061858 Add usage requirements to update direct link dependencies
Link line construction starts with `LINK_LIBRARIES` and appends
dependencies from the transitive closure of `INTERFACE_LINK_LIBRARIES`.
Only the entries of `LINK_LIBRARIES` are considered direct link
dependencies.  In some advanced use cases, particularly involving static
libraries and static plugins, usage requirements need to update the list
of direct link dependencies.  This may mean adding new items, removing
existing items, or both.

Add target properties to encode these usage requirements:

* INTERFACE_LINK_LIBRARIES_DIRECT
* INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE

Fixes: #22496
2022-01-29 06:48:13 -05:00
Brad King
63154cbf45 Merge topic 'vs-package-restore'
9aa7831f05 Presets: add resolve packages setting to build presets.
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages.
193b8fca52 cmBuildOptions: Split build arguments into separate object.
6a10103493 Help: Update preset schema description for version 3 entries.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6761
2022-01-24 11:46:29 -05:00
Carsten Rudolph
9aa7831f05 Presets: add resolve packages setting to build presets. 2022-01-22 06:35:41 -05:00
Carsten Rudolph
b2f8f0bb87 cmGlobalVisualStudio10Generator: Auto restore NuGet packages. 2022-01-22 06:35:41 -05:00
Carsten Rudolph
6a10103493 Help: Update preset schema description for version 3 entries. 2022-01-21 17:41:44 +01:00
Brad King
a47b4387b4 Merge topic 'cmake-presets-include-outside-project-dir'
0c2d234bc9 CMakePresets: Allow files included from CMakePresets.json to be anywhere

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !6867
2022-01-20 11:55:35 -05:00
Kyle Edwards
0c2d234bc9 CMakePresets: Allow files included from CMakePresets.json to be anywhere
There are some valid use cases for allowing these files to be outside
the project directory. Relax the restriction, and include a strong
warning in the documentation.
2022-01-19 11:21:35 -05:00
Craig Scott
d2efc90598 Help: Move linker preference variables to the internal section
These probably should not have been documented as public variables
to begin with. But since they have been documented for a long time,
we can't just remove them from the docs. Move them to the internal
section instead to make it clearer that they are not intended to be used
directly by projects.
2022-01-15 11:09:19 +11:00
Brad King
6baf3b27c9 Merge topic 'ide_guide'
6a5936c596 Help: Add IDE Integration Guide section on IDEs supporting CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6851
2022-01-13 15:23:04 -05:00
Semyon Kolton
6a5936c596 Help: Add IDE Integration Guide section on IDEs supporting CMake 2022-01-12 15:48:39 -05:00
Kyle Edwards
26a5512c0f CMakePresets: Add include field
Fixes: #21331
2022-01-06 19:46:41 -05:00
Brad King
138aabfa9d Merge topic 'vs-csharp-dotnet-sdk'
0eea32a376 VS: Add DOTNET_SDK property to generate SDK-style C# projects
a450cc9533 VS: Set ResolveNugetPackages to false for ALL_BUILD and ZERO_CHECK
fa76e5d194 cmVisualStudio10TargetGenerator: Factor out helper for classic MSBuild project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6634
2021-12-22 08:56:22 -05:00
Sumit Bhardwaj
0eea32a376 VS: Add DOTNET_SDK property to generate SDK-style C# projects
Changes in cmVisualStudio10TargetGenerator::Generate to write .Net
SDK-style project for VS generators VS 19 and above. Also adds
documentation and tests.

Issue: #20227
2021-12-21 09:35:49 -08:00
Brad King
37af6c3311 target_link_libraries: Optionally require only target names
Optionally verify that items in `LINK_LIBRARIES` and
`INTERFACE_LINK_LIBRARIES` that can be target names are actually target
names.  Add a `LINK_LIBRARIES_ONLY_TARGETS` target property and
corresponding `CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable to enable
this new check.

Fixes: #22858
2021-12-20 12:14:07 -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
Fred Baksik
e006b87cc6 GHS: GHSMULTI - Update documentation to match implementation
* The variable being set was named `GHSMULTI` not `GHS-MULTI`.
2021-11-15 13:15:11 -05:00
Brad King
39624cc911 Merge topic 'doc-tests-labels-dynamic'
250acbb099 Help: Improve cross-referencing of test LABELS and related features
a77bdefa3e Help: Add missing version details for Additional Test Measurements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6726
2021-11-15 09:24:42 -05:00
Craig Scott
250acbb099 Help: Improve cross-referencing of test LABELS and related features 2021-11-13 20:45:05 +11:00
Brad King
7a149034f7 Merge topic 'xcode-generation-enablegpuframecapturemode'
0798edfb85 Tests: Xcode scheme ENABLE_GPU_FRAME_CAPTURE_MODE
e09a3eddb6 Xcode: Support "GPU Frame Capture" scheme property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6639
2021-11-12 09:05:01 -05:00
Brad King
44967d400b Merge topic 'doc-preset-inheritance'
6dc6412477 Help: Use stronger wording in rule about preset inheritance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6710
2021-11-09 07:51:36 -05:00
Yonggang Luo
6dc6412477 Help: Use stronger wording in rule about preset inheritance 2021-11-08 17:00:08 -05:00
Brad King
c0e23058f6 Merge topic 'vs-framework-version'
d51246c662 VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
f97f8537f3 VS: Model a default target framework
e40cedddc0 cmVisualStudio10TargetGenerator: Refactor target framework selection
78782cc7dc cmGlobalVisualStudio8Generator: Refactor SetGeneratorPlatform

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6699
2021-11-08 12:38:48 -05:00
Brad King
2b9b64269f Merge topic 'vs-framework-version' into release-3.22
d51246c662 VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
f97f8537f3 VS: Model a default target framework
e40cedddc0 cmVisualStudio10TargetGenerator: Refactor target framework selection
78782cc7dc cmGlobalVisualStudio8Generator: Refactor SetGeneratorPlatform

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6699
2021-11-08 12:38:47 -05:00
Brad King
f97f8537f3 VS: Model a default target framework
Add fields to the VS generator to select a target framework.
Migrate the existing default for VS 12 .NET CF for Windows CE.

Report the values in `CMAKE_VS_*` variables and use them for
the CSharp compiler id project too.

Issue: #22849
2021-11-06 06:08:54 -04:00
Brad King
fc3f20a40f Merge topic 'doc-TARGET_RUNTIME_DLLS'
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !6700
2021-11-04 09:07:48 -04:00
Brad King
85771bbf00 Merge topic 'doc-TARGET_RUNTIME_DLLS' into release-3.22
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !6700
2021-11-04 09:07:47 -04:00
Brad King
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets
This generator expression does not report the locations of `.dll`
files on imported targets with the `UNKNWON` type, since their
`IMPORTED_LOCATION` refers to the import library and not the DLL.

Fixes: #22845
2021-11-03 16:17:17 -04:00
Brad King
36afda49e6 Merge topic 'help_cmake_lang_extensions_default'
e9976c8827 Help: Better explain CMAKE_<LANG>_EXTENSIONS_DEFAULT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6686
2021-11-03 10:39:05 -04:00
Raul Tambre
e9976c8827 Help: Better explain CMAKE_<LANG>_EXTENSIONS_DEFAULT
Explain that this represents the compiler's default and mustn't be modified
by the user. Clarify when it's used as the default.

Additionally:
* Add a reference to it in cmake-compile-features in text explaining the
  feature.
* Add explanations for the default initialization by
  `CMAKE_<LANG>_EXTENSIONS_DEFAULT` to all `<LANG>_EXTENSIONS` pages and
  references to CMP0128.
* Slightly reduce the wordiness of the default initialization explanations by
  removing an unnecessary "it is".

Fixes #22828.
2021-11-02 17:58:21 +02:00
Kyle Edwards
4b0ee4e338 Help: Add documentation for target_sources(FILE_SET) and associated properties 2021-10-27 15:17:23 -04:00
Kyle Edwards
3c3698b0e4 FileAPI: Add information on file set installers 2021-10-27 15:17:23 -04:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
Jake Turner
e09a3eddb6 Xcode: Support "GPU Frame Capture" scheme property
Added XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE variable which
sets the scheme property value for "GPU Frame Capture" in the Options section by setting the Xcode project variable "enableGPUFrameCaptureMode".

Example values are "Metal" (1) and "Disabled" (3).

XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE is initialized by the property CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.

Implements: #22700
2021-10-19 15:24:10 +01:00
Brad King
d252b6a1a0 Merge topic 'doc-genex-CONFIG-commas'
ec94706791 Help: gen expr: note that CONFIG is comma-separated

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6636
2021-10-19 09:07:04 -04:00
Michael Hirsch
ec94706791 Help: gen expr: note that CONFIG is comma-separated 2021-10-19 09:05:48 -04:00
Brad King
2d620e8380 Merge topic 'imported-no-system'
14d98bcfe6 export: Propagate IMPORTED_NO_SYSTEM target property to consumers
7df0541055 Add property to mark IMPORTED targets as not SYSTEM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Allison Vacanti <alliepiper16@gmail.com>
Merge-request: !6627
2021-10-18 09:38:28 -04:00
Brad King
7df0541055 Add property to mark IMPORTED targets as not SYSTEM
Add an `IMPORTED_NO_SYSTEM` target property to specify this.  When
enabled, do not treat the `INTERFACE_INCLUDE_DIRECTORIES` of an imported
target as `SYSTEM` include directories.

This is similar to the existing `NO_SYSTEM_FROM_IMPORTED` property, but
works from the consumed target rather than the consumer.

Fixes: #17364
2021-10-14 13:15:48 -04:00
Nikhil Reddy Ramolla
5d178fcc53 CTest: Add CTEST_SUBMIT_INACTIVITY_TIMEOUT variable
Fixes: #22617
2021-10-14 11:41:44 -04:00
Deniz Bahadir
f2262fab51 Help: Add documentation for CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
2021-10-13 10:37:09 -04:00
Craig Scott
9a88f5df3e Merge topic 'fetchcontent-CMAKE-vars-passthrough'
1851aa49be FetchContent: Pass through networking-related CMAKE_... variables
96937438b7 Help: Clean up how TLS and NETRC variables are discussed
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6589
2021-10-06 07:07:32 -04:00
Craig Scott
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO 2021-10-04 21:48:00 +11:00
Raul Tambre
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128.

When the standard level is unset:
* Flags are added if extension mode doesn't match the compiler's default.
  Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224.
* The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was
  used. This was only supported for IAR.

Otherwise:
* Avoid adding flags if not necessary per the detected compiler defaults.
* Fixed check for when the requested standard is older. It now matches the
  nearby comments.

I reworded the fallback comment as its logic was a bit difficult to wrap my
head around.
2021-09-29 22:28:40 +03:00
Raul Tambre
fc3a1cbdd8 CompilerID: Compiler extensions default detection 2021-09-28 21:24:53 +03:00
Raul Tambre
00055d7779 Help: Document CMAKE_<LANG>_STANDARD_DEFAULT
Seems to be stable and will referred to by policy for standards flags rework.
2021-09-28 21:24:53 +03:00
Raul Tambre
a65bee4cfc Help: Document HIP standard/extensions properties and variables 2021-09-28 21:24:53 +03:00
Raul Tambre
3feff8379b Help: Generic language standard and extension variables documentation
Add generic documentation to improve the discoverability of language-specific
ones and to make it possible to refer to them generically from other language
generic documentation.
2021-09-28 21:24:53 +03:00
Craig Scott
b1745dcbca Merge topic 'doc-build-config'
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6516
2021-09-22 08:20:08 -04:00
Craig Scott
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity
Fixes: #22591
2021-09-21 22:23:24 +10:00
Daniel Schürmann
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax
Fixes: #22303
2021-09-10 09:46:55 -04:00
Johel Ernesto Guerrero Peña
d186797cf6 Help: Fix regex in example of cmake-packages(7)
This change makes it work as intended as opposed to make the condition always true.
This can be confirmed by running the following script:
```
[johel@sundown tmp]$ cat x.cmake 
function(f)
  set(valid_inputs abc 123)
  foreach(input ${ARGV})
    if(";${valid_inputs};" MATCHES input)
      message("old valid: ${input}")
    endif()
    if(";${valid_inputs};" MATCHES ";${input};")
      message("new valid: ${input}")
    endif()
  endforeach()
endfunction()

f("0;z;123;12;abc;ab;13;ac")

set(_supported_components Plot Table)
set(ClimbingStats_FIND_COMPONENTS Plot Table P T)

foreach(_comp ${ClimbingStats_FIND_COMPONENTS})
  if(NOT ";${_supported_components};" MATCHES _comp)
    message("old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE \"Unsupported component: ${_comp}\")")
  endif()
  if(NOT ";${_supported_components};" MATCHES ";${_comp};")
    message("new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE \"Unsupported component: ${_comp}\")")
  endif()
endforeach()
[johel@sundown tmp]$ cmake -P x.cmake 
new valid: 123
new valid: abc
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: Plot")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: Table")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: P")
new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: P")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: T")
new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: T")
```
2021-08-28 10:49:28 -04:00
Brad King
8706f7a617 Merge topic 'symlinks-rebase-master'
58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6396
2021-08-10 09:25:15 -04:00
Felix Lelchuk
58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)
An new environment variable 'CMAKE_INSTALL_MODE' is introduced,
which can be used to ask CMake to create symbolic links
instead of copying files during a file(INSTALL ...).

The operation is at the file level only, directory trees are
still created using actual directories, not links.

Signed-off-by: Felix Lelchuk <felix.lelchuk@gmx.de>
2021-08-02 19:42:26 +02:00
Craig Scott
bc44c32773 Merge topic 'doc-presets-toolchain-file'
ca371d3a14 Help: Fix unlinked mention of CMAKE_TOOLCHAIN_FILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6417
2021-08-02 04:54:49 -04:00
Craig Scott
ca371d3a14 Help: Fix unlinked mention of CMAKE_TOOLCHAIN_FILE 2021-07-31 17:08:42 +10:00
Craig Scott
18259fa689 Merge topic 'doc-ctest-output'
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00
Craig Scott
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output 2021-07-25 21:37:29 +10:00
Brad King
f7d82cb6f7 Merge topic 'iar-exe-suffix'
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6357
2021-07-20 11:56:01 -04:00
Lorenzo Cappelletti
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
Documentation for `CMAKE_EXECUTABLE_SUFFIX_<LANG>`, useful when
cross-compiling, is buried in section `CMAKE_EXECUTABLE_SUFFIX`.
2021-07-20 11:51:19 -04:00
Brad King
bf8bf11fe5 Merge topic 'doc-cmake-build-signature'
161f1f42d6 Help: Clarify 'cmake --build' signature alternatives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6343
2021-07-14 09:22:27 -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
3265fa51cd Merge topic 'ctest-environment-modifications'
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
4c757fa3c8 Help/prop_test/ENVIRONMENT: clarify the scope of the changes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6299
2021-07-13 08:24:36 -04:00
Brad King
c94ff1f75f Merge topic 'doc-preset-example-v3'
2114d717a0 Help: Fix preset example cmakeMinimumRequired

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6333
2021-07-13 08:17:30 -04:00
Sérgio Martins
2114d717a0 Help: Fix preset example cmakeMinimumRequired
Since commit 8bc5c8961e (CMakePresets.json: Add the ability to
conditionally disable presets, 2021-03-10, v3.21.0-rc1~464^2)
the example requires presets version 3 support, which is not
available until CMake 3.21.  CMake 3.20.0 can't open v3 presets.
Make cmakeMinimumRequired compatible with the example's version.
2021-07-12 08:54:04 -04:00
Brad King
c9cd039e5f Merge topic 'LWYU-externalization'
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
9c5132a586 PGI: Fix "LINKER:" prefix generated separator
8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6306
2021-07-12 08:43:32 -04:00
Marc Chevrier
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.

Fixes: #20174
2021-07-09 14:50:50 +02:00
Ben Boeckel
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
This property allows projects to modify environment variables at test
time rather than trying to guess what the state should be based on what
is present at configure time. Of particular interest is the ability to
use a `PATH` present at test time while adding entries known to be
necessary for the test itself.

There are multiple operations provided to modify variables, including:

  - setting and unsetting
  - appending and prepending as:
    - strings
    - path lists
    - CMake lists

Additionally, a `reset` action is provided to cancel any prior
modifications to that particular variable in the case of incremental
additions to the test property.
2021-07-09 08:45:18 -04:00
Eugene Shalygin
a2e9fe38e4 find_package: Add variable to make package REQUIRED
Add a `CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable is complement
to `CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` with just the opposite
behaviour: it turns non-required find_package call into the required one.

While optional package dependencies usually result in simple and clean
build logic, sometimes people want to be sure those optional
dependencies will be found and used. Examples are reproducible builds
and build instructions for 3rd parties. People choose to make
find_package calls REQUIRED and put them behind an option(). Such
workarounds blend build logic with build environment management and do
not look elegant.
2021-07-08 08:03:38 -04:00
Brad King
ef56eefc9b cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable
When no `CMAKE_CONFIGURATION_TYPES` is explicitly specified while
creating a new build tree, check for an environment variable of the same
name.

Issue: #20983
2021-06-30 10:55:40 -04:00
Brad King
e216b9bbd3 cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable
When no `CMAKE_BUILD_TYPE` is explicitly specified while creating a new
build tree, check for an environment variable of the same name.

Issue: #20983
2021-06-30 10:55:40 -04:00
Brad King
34f879d99e Merge topic 'genex-versionadded'
7993aa3075 Help: Add versionadded tags to cmake-generator-expressions(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6270
2021-06-28 14:01:36 -04:00
FeRD (Frank Dana)
7993aa3075 Help: Add versionadded tags to cmake-generator-expressions(7) 2021-06-28 10:40:11 -04:00
Brad King
be78a9bf68 Merge topic 'vs2022'
93c718791e VS: Use 64-bit MSBuild in VS 2022
c46b265839 VS: Add Visual Studio 17 2022 generator
b610b7a35c VS: Update v142 CL flag table for VS 17.0 Preview 1
43375c6418 Help: Remove unnecessary Sphinx versionadded markup in VS toolset selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6268
2021-06-28 09:22:38 -04:00
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Isuru Fernando
fe3f846e1b Makefiles: Add support for building Fortran intrinsics
Fixes: #21463
2021-06-24 08:39:47 -04:00
Brad King
e13704ce72 Add directory property to list imported targets
Model the change after commit cbca65826c (Add directory property to list
buildsystem targets, 2016-09-19, v3.7.0-rc1~79^2~1).

Fixes: #22291
2021-06-10 15:52:12 -04:00
Brad King
cf8710da74 Help: Document ctest(1) --interactive-debug-mode limitation
Fixes: #22287
Issue: #20115
2021-06-09 14:35:15 -04:00
Brad King
fee0619e7c Merge topic 'help-presets'
b00512e692 Help: presets: add note for ExternalProject users with env vars

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6201
2021-06-09 08:05:21 -04:00
Brad King
7aad9e8685 Merge topic 'add_hip_language'
8514ee9b31 HIP: analyze output of `hipcc` to determine default GPU architecture
20d086f1a2 HIP: All HIP tests now run on CMake's current AMD hardware
2e86e50c2f HIP: Add HIP to all the Check* modules
947dbed0aa HIP: Automatically inject the `hip::device` runtime target
b50bfc8913 HIP: Add language to CMake
ff0d2858e1 HIP: Extract clang compiler details from hipcc
bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake
590553f322 Compilers: protect use of  __has_include
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6121
2021-06-09 07:53:32 -04:00
Michael Hirsch
b00512e692 Help: presets: add note for ExternalProject users with env vars
Although this behavior is implied in the existing help text, I think
this use case is common and could be puzzling to those who do not
thoroughly read the existing help text. I think that warrants
a "Note:" on this page.
2021-06-08 12:13:49 -04:00
Brad King
acb25d50d9 Merge topic 'install-with-runtime-dependencies'
8d898cb3e1 FileAPI: Add integration for runtime dependency installers
72f2448e82 Help: Add documentation for runtime dependency installation
0c3c6acaff Tests: Add tests for new options
4910132d8c install: Add RUNTIME_DEPENDENCY_SET mode
bc8a4a06a4 install(IMPORTED_RUNTIME_ARTIFACTS): Add RUNTIME_DEPENDENCY_SET option
3e7d3c252a install(TARGETS): Add RUNTIME_DEPENDENCY_SET argument
ed3633d88c install(TARGETS): Add RUNTIME_DEPENDENCIES option
f2617cf8e6 Source: Add cmInstallRuntimeDependencySet
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6186
2021-06-08 08:09:04 -04:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Kyle Edwards
8d898cb3e1 FileAPI: Add integration for runtime dependency installers 2021-06-04 15:25:18 -04:00
Kyle Edwards
72f2448e82 Help: Add documentation for runtime dependency installation 2021-06-04 15:25:18 -04: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
Brad King
e6bcd5e45a Merge topic 'doc_regex'
0d210b92fa Help: links to CMake regex syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6179
2021-06-03 08:09:34 -04:00
Michael Hirsch
0d210b92fa Help: links to CMake regex syntax 2021-06-02 10:30:21 -04:00
Brad King
02957bb589 Merge topic 'install-imported-runtime-artifacts'
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode
60e752ced8 Refactor: Move common methods into cmInstallGenerator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6162
2021-06-01 08:42:16 -04:00
Kyle Edwards
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS 2021-05-31 09:02:45 -04:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Craig Scott
445c73d3fa Merge topic 'cpack-install-opts'
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6141
2021-05-26 18:53:40 -04:00
Brad King
bf2717e436 Merge topic 'set-cache-keep-normal-variable'
d96eb55282 set(CACHE): do not remove normal variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6146
2021-05-25 10:03:03 -04:00
Nils Gladitz
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES
The new variable allows projects to define custom key=value pairs of
variables to be set in CPack cmake_install.cmake script invocations.
This allows install(SCRIPT|CODE) to be parameterized at runtime.
2021-05-24 08:21:49 +10:00
Marc Chevrier
d96eb55282 set(CACHE): do not remove normal variable
Fixes: #22038
2021-05-20 17:50:13 +02:00
Nils Gladitz
99ff75455e install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTS
In a per-component installation the generated installation scripts
are invoked once for each component.

Per default custom installation script code added by install(CODE|SCRIPT)
only runs for one specific component in this context.

The new ALL_COMPONENTS option allows custom script code to be run once
for each component being installed.
2021-05-19 19:17:58 +02:00
Marc Chevrier
08db1341a6 find_*: ensure consistent behavior for cache variables
Fixes: #22121
2021-05-12 11:11:56 +02:00
Brad King
6c5a2b2171 Merge topic 'helpctestscript'
140fe8c3c6 Help: Document CTEST_SCRIPT_DIRECTORY variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6111
2021-05-11 09:25:53 -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
Michael Hirsch
140fe8c3c6 Help: Document CTEST_SCRIPT_DIRECTORY variable 2021-05-10 10:55:59 -04:00
scheffle
66be34853c cmake: add supported platforms to cmake -E capabilties report 2021-05-10 10:28:28 -04:00
Josef Angstenberger
7072d83772
Help: Fix typos and spelling in documentation 2021-05-07 17:00:17 +02:00
Brad King
7973f97828 Merge topic 'doc-tls'
7398993f5b Help: Document CMAKE_TLS_VERIFY variable explicitly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6064
2021-05-05 10:08:45 -04:00
Michael Hirsch
7398993f5b Help: Document CMAKE_TLS_VERIFY variable explicitly
Previously it was mentioned only in the `file` and `ExternalProject`
documentation.
2021-05-04 12:29:13 -04:00
Brad King
09f2f5df89 Merge topic 'extend_toolchain_flag_to_cmake_preset'
a9b968bb98 cmake-presets: Introduce `toolchainFile` preset option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6045
2021-05-04 11:54:49 -04:00
Brad King
4df3f5300a Merge topic 'foreach-loop-variable'
46896d98bb foreach(): loop variables are only available in the loop scope

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6044
2021-05-03 09:59:35 -04:00
Brad King
9edff7f43e Merge topic 'remove_bad_install_dir_schema_docs'
306db0fdb8 cmake-presets: Remove incorrect documentation for `installDir`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6051
2021-04-29 09:23:24 -04:00
Brad King
d94f8516ab Merge topic 'find-msys'
990b370401 FindMsys: Add a module to find MSYS and some bundled packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6057
2021-04-29 09:22:27 -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
Marc Chevrier
46896d98bb foreach(): loop variables are only available in the loop scope
Fixes: #20553
2021-04-28 19:44:25 +02:00
Orgad Shaneh
990b370401 FindMsys: Add a module to find MSYS and some bundled packages 2021-04-28 10:41:17 -04:00
Brad King
49c6d0f261 Merge topic 'ctest_test_measurements_docs'
b60789a758 Help: Document CTest custom test measurements
63b5ddcce2 Tests: Add cases for CTest extra measurements from tests
52eac4573d Help: Fix link to cdash.org from CTest manual

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Merge-request: !6029
2021-04-28 09:53:04 -04:00
Brad King
11530e5504 Merge topic 'ARMClang-cpu-arch-flags'
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
0078db3888 ARMClang: Separate cpu/arch flags from preceding flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jaeden Amero <kitware@patater.com>
Merge-request: !6035
2021-04-28 09:49:41 -04:00
Zack Galbreath
b60789a758 Help: Document CTest custom test measurements 2021-04-27 15:00:26 -04:00
Zack Galbreath
52eac4573d Help: Fix link to cdash.org from CTest manual 2021-04-27 14:06:07 -04:00
Lingkai Dong
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:

    -mcpu=<name>[+[no]<feature>+...]

For example:

    -mcpu=cortex-a57+nocrypto+nofp+nosimd+crc

(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)

The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.

Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
2021-04-27 14:03:15 -04:00
Brad King
970f175d88 Merge topic 'ctest_junit'
25bf514447 ctest: Add support for writing test results in JUnit XML format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Acked-by: MvdHurk <maikelvandenhurk@hotmail.com>
Acked-by: Alexander Richardson <arichardson.kde@gmail.com>
Merge-request: !6020
2021-04-27 13:53:55 -04:00
Robert Maynard
306db0fdb8 cmake-presets: Remove incorrect documentation for installDir 2021-04-27 11:43:30 -04:00
Brad King
395e1d458e Merge topic 'xcode_app_extensions'
eb5e33ba47 Xcode: Add support for embedding app extensions
f62a2bf44f Tests: Factor out XcodeProject-Embed check function findAttribute()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5934
2021-04-26 11:34:38 -04:00
Brad King
8bc64a0c40 Merge topic 'doc-compile-features-wcdh'
1f4ec3f4a7 Help: Do not recommend WCDH in cmake-compile-features(7)
1cc63f2cd5 Help: Fix typos in cmake-compile-features(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6037
2021-04-26 11:27:17 -04:00
Zack Galbreath
25bf514447 ctest: Add support for writing test results in JUnit XML format
Addresses #18654
2021-04-26 08:55:22 -04:00
Brad King
1f4ec3f4a7 Help: Do not recommend WCDH in cmake-compile-features(7)
Since commit da7ad7997e (WriteCompilerDetectionHeader: Add policy to
remove module, 2020-12-04, v3.20.0-rc1~350^2), the WCDH module is
deprecated.  Update the `cmake-compile-features(7)` manual section that
previously recommended WCDH to make such detection the project's
responsibility instead.  Move the old content of the section over to the
WCDH module to preserve it.
2021-04-23 10:44:53 -04:00
Brad King
1cc63f2cd5 Help: Fix typos in cmake-compile-features(7) 2021-04-23 10:44:01 -04:00
Alexander Akhundzhanov
eb5e33ba47 Xcode: Add support for embedding app extensions
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-04-22 15:17:02 +10:00
friendlyanon
71cbddf83a cmake(1): Change wording for fields in presets
The placement of the word "optionally" implied that the fields mentioned
before are not optional, which is not the case starting from version 3
of the presets.
2021-04-21 03:22:01 +02: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
Brad King
2f30ee24d3 Merge topic 'doc-error-unknown-arg'
06d26c7baf Help: Add 3.20 release note for error on unknown arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6003
2021-04-15 11:07:33 -04:00
Robert Maynard
d5c3e4ac32 cmake: add support for --toolchain command argument 2021-04-15 10:13:49 -04:00
Brad King
06d26c7baf Help: Add 3.20 release note for error on unknown arguments
This was left out of commit 1b6c5333a0 (cmake: Error out on unknown
arguments starting with `-`., 2020-11-30, v3.20.0-rc1~370^2).

Fixes: #22060
2021-04-14 11:46:05 -04:00
Brad King
21f0478ade Merge topic 'presets-optional-generator-and-builddir'
06e6981336 cmake-presets: Make generator and binaryDir fields optional

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5946
2021-04-08 07:49:56 -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
Duncan Barber
7f0151dc91 Help: Document the AUTOUIC_SOURCE_GROUP property
This property came into existence with the changes in b4a103bdec because generated files are now being added for UIC.
2021-04-04 12:29:56 +01:00
Brad King
0fee2adf8c Merge topic 'fujitsu-compiler-4.0-support'
8ef55dec29 Help: Add release notes for Fujitsu compiler support
4c74c86f40 FindBLAS/LAPACK: Add support for the Fujitsu SSL2 library
376c300b25 FindOpenMP: Add support for Fujitsu compilers
9e0a1cf03e FindMPI: Add support for the Fujitsu compiler wrappers
a237450948 Tests: Update for the FujitsuClang compiler
27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode
a55feff69c Tests: Update for the Fujitsu compiler
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Acked-by: Gilles Gouaillardet <gilles@rist.or.jp>
Merge-request: !5954
2021-04-01 10:26:54 -04:00
Kyle Edwards
5ac8b923f5 CMakePresets.json: Add matches condition 2021-03-31 10:24:24 -04:00
Chuck Atkins
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode
Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
2021-03-30 10:32:53 -04:00
Brad King
e6a5799fa0 Merge topic 'multiple-L-labels'
44ad3f0b7f ctest: Support multiple -L and -LE options to mean "AND"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Lars Bilke <larsbilke83@googlemail.com>
Merge-request: !5329
2021-03-30 09:55:42 -04:00
Adriaan de Groot
44ad3f0b7f ctest: Support multiple -L and -LE options to mean "AND"
Fixes: #21087
2021-03-28 12:04:05 +11:00
Marc Chevrier
1d8e3a1e77 UseSWIG: Use standard library name conventions for csharp language
Fixes: #21542
2021-03-26 16:27:18 +01:00
friendlyanon
96a7040107 project: Define variables indicating whether project is top level
Define `PROJECT_IS_TOP_LEVEL` and `<PROJECT-NAME>_IS_TOP_LEVEL`.  The
latter is a STATIC cache entry just like other `<PROJECT-NAME>_*`
variables so that it is globally scoped.

Issue: #20310
Fixes: #21961
2021-03-26 09:35:34 -04:00
Brad King
ea4c344453 Merge topic 'doc-custom-output-genex'
2f59b683d3 Help: Custom OUTPUT and BYPRODUCTS genexes cannot refer to targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5939
2021-03-25 10:24:38 -04:00
Craig Scott
2f59b683d3 Help: Custom OUTPUT and BYPRODUCTS genexes cannot refer to targets
Relates: #21364
2021-03-25 18:04:17 +11: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
Adriaan de Groot
fae7910268 Help: Fix typos in presets schema field descriptions 2021-03-18 10:09:44 -04:00
Brad King
fa1b729b9d Merge branch 'backport-preset-schema-typos' into preset-schema-typos 2021-03-18 10:09:19 -04:00
Adriaan de Groot
bda6446e6f Help: Fix typos in presets schema field descriptions 2021-03-18 10:07:09 -04:00
Brad King
049bf98f63 fileapi: Add installers to codemodel-v2 "directory" object
Co-Authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2021-03-16 16:47:57 -04:00
Brad King
eae2256a52 fileapi: Add backtraceGraph to codemodel-v2 "directory" object
Co-Authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2021-03-16 16:47:55 -04:00
Brad King
a12d7f70b1 fileapi: Add a "directory" object to codemodel-v2
This object will contain more detailed directory-level information.

Co-Authored-by: Kyle Edwards <kyle.edwards@kitware.com>
2021-03-16 16:47:43 -04:00
Brad King
fd30bd93e6 fileapi: Re-organize backtrace infrastructure
Make it available to more parts of the codemodel object.
2021-03-16 11:24:41 -04:00
Kyle Edwards
0d497e159b CMakePresets.json: Add ${hostSystemName} macro 2021-03-15 14:41:42 -04:00
Kyle Edwards
79d03ab505 Help: Fix version numbers in CMakePresets.json documentation 2021-03-15 14:41:42 -04:00
Brad King
9a80ce6d24 Merge topic 'add_prefix_cmake_option'
400536c317 cmCommandLineArgument: trim leading empty spaces
b227a9565e cmake: configure preset add support for --install-prefix mapping
38140713ad cmake: add support for --install-prefix command argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5843
2021-03-11 08:16:03 -05: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
957a117c70 Merge topic 'android-r22'
005e2cdfb0 Android: Do not use gold for ndk >= r22
ed7a87f270 Tests: Update RunCMake.Android for NDK r22
4950d35733 Help: Document CMAKE_ANDROID_NDK_VERSION variable
746906242d Android: Detect NDK version number

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5862
2021-03-03 11:11:58 -05:00
Brad King
4950d35733 Help: Document CMAKE_ANDROID_NDK_VERSION variable 2021-03-03 10:27:50 -05:00
Brad King
a5678e46f8 Merge topic 'runtime-dll-deps'
f31e8d33ef Genex: Fix grammatical error in TARGET_OBJECTS error message
d34d28e688 Genex: Add TARGET_RUNTIME_DLLS genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5837
2021-02-25 09:58:40 -05:00
Brad King
6288974ba5 Merge topic 'nvhpc-minor-fixes'
72efd95add PGI: Explicitly specify CMAKE_CXX98_STANDARD_COMPILE_OPTION
6bfb2c6175 HELP: Update compile-features documentation with missing compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5857
2021-02-25 09:02:02 -05:00
Kyle Edwards
d34d28e688 Genex: Add TARGET_RUNTIME_DLLS genex
Co-Authored-by: Brad King <brad.king@kitware.com>
2021-02-24 14:55:17 -05:00
Robert Maynard
6bfb2c6175 HELP: Update compile-features documentation with missing compilers 2021-02-24 13:09:59 -05:00
Brad King
e95f7aa0ed Merge topic 'preset-flag-consistency' into release-3.20
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
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
bf0fd71ad1 Merge topic 'preset-no-comments'
06e16ea008 Merge branch 'backport-3.19-preset-no-comments' into preset-no-comments
afaa69f5b3 Tests: Remove comments from CMakePresetsTest/Good.json.in
4a92277f45 Revert "Help: Document JSON comment support in cmake-presets(7)"
431dd59b5e CMakePresets.json: Remove undocumented support for comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5853
2021-02-24 09:42:00 -05:00
Kyle Edwards
4a92277f45 Revert "Help: Document JSON comment support in cmake-presets(7)"
Revert commit 8f1e607ed9 (Help: Document JSON comment support in
cmake-presets(7), 2021-02-18).  The support for comments was a mistake
when the feature was implemented in 3.19, and is being removed.
2021-02-24 09:33:50 -05:00
Brad King
6fa3647023 ctest: Add support for '--prefix=<prefix>' form of the argument
The main `cmake --preset` argument for configure presets supports both
forms, so support it for `ctest --preset` too.

Fixes: #21855
2021-02-23 09:22:00 -05: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
Brad King
b3e39a133f Merge topic 'list-index-arg-parsing'
79eaa908dc cmListCommand: add a policy for failing on invalid indicies
1f1fdff7fa cmListCommand: prefer strtol to atoi
9934a97642 cmListCommand: refactor out index argument parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5817
2021-02-19 09:40:28 -05:00
Brad King
3412d95bf7 Merge topic 'docpreset'
87b170d9f9 Help: Add build and test preset to examples in cmake-presets(7)
3f8cf006cb Help: Clarify preset name conflict rules in cmake-presets(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5823
2021-02-19 09:34:35 -05:00
Michael Hirsch
87b170d9f9 Help: Add build and test preset to examples in cmake-presets(7)
Co-Author: Brad King <brad.king@kitware.com>
2021-02-18 14:53:28 -05:00
Michael Hirsch
3f8cf006cb Help: Clarify preset name conflict rules in cmake-presets(7) 2021-02-18 14:53:28 -05:00
Brad King
98ae005137 Merge topic 'preset-json-comments' into release-3.20
8f1e607ed9 Help: Document JSON comment support in cmake-presets(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5830
2021-02-18 14:52:26 -05:00
Brad King
b8e4e524d3 Merge topic 'preset-json-comments'
8f1e607ed9 Help: Document JSON comment support in cmake-presets(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5830
2021-02-18 14:52:26 -05:00
Brad King
91b4c27d8a Merge topic 'doc-presets'
47ab2d4d2e Help: Clarify role of binaryDir inheritance in cmake-presets(7)
0e3c361f77 Help: Link to tool-specific preset arguments from cmake-presets(7)
dd6165fbd4 Help: Mention version 2 in cmake-presets(7)
cdbd1ae64b Utilities/Sphinx: Avoid converting -- to an en-dash

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5829
2021-02-18 14:35:36 -05:00
Michael Hirsch
8f1e607ed9 Help: Document JSON comment support in cmake-presets(7) 2021-02-18 11:47:40 -05:00
Brad King
47ab2d4d2e Help: Clarify role of binaryDir inheritance in cmake-presets(7)
Suggested-by: Michael Hirsch
2021-02-18 11:01:29 -05:00
Brad King
0e3c361f77 Help: Link to tool-specific preset arguments from cmake-presets(7)
Fixes: #21835
2021-02-18 10:55:10 -05:00
Brad King
dd6165fbd4 Help: Mention version 2 in cmake-presets(7)
Version 2 is required for build and test presets.

Fixes: #21829
2021-02-18 10:55:10 -05:00
Ben Boeckel
79eaa908dc cmListCommand: add a policy for failing on invalid indicies 2021-02-18 08:30:55 -05:00
Brad King
4388c3f717 Merge topic 'DOC-SelectLibraryConfiguration'
b6445ddeda Help: Add SelectLibraryConfigurations example to cmake-developer(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !5815
2021-02-18 08:21:50 -05:00
Johan Andruejol
b6445ddeda Help: Add SelectLibraryConfigurations example to cmake-developer(7) 2021-02-17 14:27:52 -05:00
Sam Freed
7fd6bb6895 presets: Remove unintended rerunFailed option from test presets
This was accidentally included after discussion in #21391 had decided to
leave it out.  It was never included in a release.

Issue: #21391
2021-02-15 10:52:32 -05:00
Brad King
9cddaad940 AddFileDependencies: Deprecate this unnecessary module
Document that one can call `set_property` directly instead.
2021-02-08 12:44:37 -05:00
Sam Freed
4f4f2028b8 Help: Add documentation for buildPresets and testPresets 2021-02-01 07:53:36 -08:00
Sam Freed
166dc3c46b Help: Add buildPresets and testPresets to JSON schema 2021-01-27 10:20:12 -08:00
Brad King
c2dc7e0f53 Help: Convert genex documentation to sphinx domain objects
This makes them linkable, indexed, and enables cross-references.
2021-01-18 12:35:41 -05:00
Brad King
778321beb4 Help: Remove extra blank line from cmake-generator-expressions(7) 2021-01-18 12:35:41 -05:00
Brad King
3115cc3895 Help: Fix layout of architecture/toolset fields in cmake-presets(7) manual
These two fields share common documentation and so should be a single
entry in the definition list.

Fixes: #21642
2021-01-14 13:44:50 -05:00
Brad King
69dbaba6fb Help: Add section heading for configure presets in cmake-presets(7)
Cross-reference it from the main `configurePresets` field.
This removes an extra layer of indentation and makes the
section linkable.
2021-01-14 13:40:16 -05:00
Brad King
501bcb6327 Help: Add section heading for macro expansion in cmake-presets(7)
Also cross-reference it from the prose.
2021-01-14 13:40:04 -05:00
Brad King
1c4c742f40 Help: Remove unnecessary indentation in cmake-presets(7)
The entire "Format" section had an extra 2 spaces of indentation.
2021-01-14 13:40:02 -05:00
Brad King
cc47f4ebf9 Merge topic 'fileapi-toolchains'
6418dabb87 Tests: Add test for toolchains-v1 File API object
1c5bd1bed5 Tests: Add toolchains kind to capabilities test
f72bb2ee0d Help: Add documentation for "toolchains" object kind
bb069c0857 cmFileAPI: Add "toolchains" object kind.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5678
2021-01-14 13:02:54 -05:00
Ben McMorran
6418dabb87 Tests: Add test for toolchains-v1 File API object 2021-01-12 15:43:38 -08:00
Ben McMorran
f72bb2ee0d Help: Add documentation for "toolchains" object kind 2021-01-12 11:21:28 -08:00
Anakin Skywalker
cc32eeae17 Help: Clarify standard module variable naming
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-01-12 23:00:34 +11:00
Shannon Booth
a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target
The new target property `EXPORT_COMPILE_COMMANDS` associated with the
existing global variable can be used to optionally configure targets for
their compile commands to be exported.

Fixes: #19462
2021-01-06 11:51:39 +13:00
Brad King
05a59f37ab Merge topic 'ctest-test-dir'
dbcf86d24d Ctest: Support build tree on command line

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5623
2020-12-21 10:04:58 -05:00
Brad King
6d7621baea Merge topic 'qt-autogen-per-config'
20e4db4a66 cmGeneratorTarget: Make GetConfigCommonSourceFiles Xcode-specific
92d7b456e5 Autogen: Add support for per-config sources
3ffebbaefb Tests/QtAutogen: Forward build configuration in multi-config generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5624
2020-12-17 13:22:40 -05:00
Asit Dhal
dbcf86d24d Ctest: Support build tree on command line
Fixes: #21268
2020-12-17 05:01:03 +01:00
Brad King
92d7b456e5 Autogen: Add support for per-config sources
Fixes: #20682
2020-12-16 14:04:30 -05:00
Craig Scott
d2456b29f4 Merge topic 'unity-anon-ns'
0fe9c40494 Unity Build: Add option for generating per-file unique id

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4784
2020-12-16 07:40:41 -05:00
Brad King
34469a4f71 Merge topic 'custom-command-output-genex-nmc'
1526ae3aba Tests: Add cases for Ninja Multi-Config cross-config custom commands
dcf9f4d2f7 Ninja Multi-Config: Add support for cross-config custom commands
15467f12f7 cmLocalGenerator: Adopt custom target 'force' output name generation
7b64b0cd5a cmLocalGenerator: Refactor custom command generator construction
d29da8ed3e cmMakefile: Simplify custom target 'force' output name generation
2b1cc175ee Help: Clarify version adding add_custom_{command,target} OUTPUT genex support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5612
2020-12-16 06:20:39 -05:00
Brad King
67f12dd1d6 Merge topic 'ispc_control_header_suffixes'
c9a50f3556 ISPC: Generated Headers suffix configurable with a better default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5597
2020-12-15 07:40:34 -05:00
Kyle Edwards
dcf9f4d2f7 Ninja Multi-Config: Add support for cross-config custom commands
Co-Author: Brad King <brad.king@kitware.com>
2020-12-15 07:01:21 -05:00
Stephen Kelly
0fe9c40494 Unity Build: Add option for generating per-file unique id
Fixes: #21477
2020-12-15 22:26:09 +11:00
Robert Maynard
c9a50f3556 ISPC: Generated Headers suffix configurable with a better default
The target property `ISPC_HEADER_SUFFIX` and associated global
variable now can control the suffix used when generating the
C/C++ interoperability ISPC headers.

In addition the default suffix is now "_ispc.h" which matches the
common convention that the ISPC compiler team uses and recommends.
2020-12-14 13:13:09 -05:00
Brad King
23df57a3a7 Merge topic 'apple-silicon-host-arch' into release-3.19
b7f0327dcd Tests: Cover macOS host architecture selection on Apple Silicon hosts
5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5589
2020-12-11 13:05:34 -05:00
Brad King
794aa36b1f Merge topic 'apple-silicon-host-arch'
b7f0327dcd Tests: Cover macOS host architecture selection on Apple Silicon hosts
5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5589
2020-12-11 13:05:34 -05:00
Brad King
3765a415df Merge branch 'master' into doc-3_19_release-fixes 2020-12-11 10:39:14 -05:00
Craig Scott
b4c02a0a1d Help: Re-sort indexes in the manuals 2020-12-11 11:19:04 +11:00
Brad King
5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts
Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple
Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we use `sysctl` to detect
that we are running on Apple Silicon in a way that pierces Rosetta.
This always sets `CMAKE_HOST_SYSTEM_PROCESSOR` to be `arm64` on such
hosts.  However, macOS offers strong support for running processes under
an emulated `x86_64` architecture.

Teach CMake to select either `arm64` or `x86_64` as the host
architecture on Apple Silicon based on the architecture of its own
process.  When CMake is built as a universal binary, macOS will select
whichever slice (architecture) is appropriate under the user's shell,
and `CMAKE_HOST_SYSTEM_PROCESSOR` will match.

Also offer a `CMAKE_APPLE_SILICON_PROCESSOR` variable and environment
variable to provide users with explicit control over the host
architecture selection regardless of CMake's own architecture.

Finally, if `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to
the toolchain to use selected host architecture instead of letting the
toolchain pick.

Fixes: #21554
2020-12-10 12:08:13 -05:00
Brad King
a2f98803f0 Merge topic 'android-docs'
1a4b1cca1c Android: update documentation for NDK integration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5586
2020-12-09 09:15:13 -05:00
Haibo Huang
1a4b1cca1c Android: update documentation for NDK integration 2020-12-08 10:46:55 -05:00
Brad King
c4feb00aa5 Merge topic 'update_cmp112'
cf0c71dae3 Document CMP0112 covers $<TARGET_FILE_NAME,tgt>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5582
2020-12-08 10:20:12 -05:00
Brad King
8a3ecb484f Merge topic 'update_cmp112' into release-3.19
cf0c71dae3 Document CMP0112 covers $<TARGET_FILE_NAME,tgt>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5582
2020-12-08 10:20:11 -05:00
Robert Maynard
cf0c71dae3 Document CMP0112 covers $<TARGET_FILE_NAME,tgt>
Fixes #21559
2020-12-07 09:50:39 -05:00
Brad King
da7ad7997e WriteCompilerDetectionHeader: Add policy to remove module
See justification in the policy documentation.

Closes: #17842
2020-12-05 21:57:08 +11:00
Brad King
541f1410e0 Help: Move Documentation module to list of deprecated modules
The module has been deprecated since commit 306a1ba960
(Modules/Documentation: remove, 2020-04-16, v3.18.0-rc1~290^2).
2020-12-04 10:52:03 -05:00
Brad King
76685b985d Merge topic 'explicit-LANGUAGE-flag'
48aac247e9 Compile with explicit language flag when source LANGUAGE property is set
2e67a75acd Embarcadero: Simplify addition of -P flag for C++

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5522
2020-12-04 08:27:55 -05:00
Brad King
48aac247e9 Compile with explicit language flag when source LANGUAGE property is set
This change was originally made by commit 74b1c9fc8e (Explicitly specify
language flag when source LANGUAGE property is set, 2020-06-01,
v3.19.0-rc1~722^2), but it was reverted by commit 30aa715fac (Revert
"specify language flag when source LANGUAGE property is set",
2020-11-19) to restore compatibility with pre-3.19 behavior.

Implement the change again, but add policy CMP0119 to make this change
while preserving compatibility with existing projects.

Note that the `Compiler/{Clang,Intel,MSVC}-CXX` modules do not need to
specify `-TP` for their MSVC-like variants because we already use the
flag in `CMAKE_CXX_COMPILE_OBJECT`.  Similarly for `Compiler/XL-CXX`
and `Platform/Windows-Embarcadero`.

Note also that this does not seem possible to implement for XL C.
Even with `-qsourcetype=c`, `xlc` complains about an unknown suffix:
`1501-218 (W) file /.../AltExtC.zzz contains an incorrect file suffix`.
It returns non-zero even with `-qsuppress=1501-218`.

Co-Author: Robert Maynard <robert.maynard@kitware.com>
Fixes: #14516, #20716
2020-12-02 11:39:11 -05:00
Brad King
628d7ef672 Merge topic 'cuda_env_archs'
c57541d874 CUDA: Fix tests with CUDAARCHS set
c4ae9384ff CUDA: Initialize CMAKE_CUDA_ARCHITECTURES using $ENV{CUDAARCHS}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5533
2020-12-01 09:37:07 -05:00
Brad King
a24a4e18af Merge topic 'makefiles-compiler-deps-optims'
2c71d051fa Makefiles Generators: use compiler for dependencies generation
afd0f6785d Refactoring: Abstract Makefile line continuation format
b6068ce407 Refactoring: enhance include file filtering
3401403f69 Refactoring: Introduce place-holder for dependency target.
a97c41bf8b Refactoring: Makefiles Generators: Add support for various depends scanners

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !5528
2020-11-30 13:26:53 -05:00
Brad King
0173cdcc01 Merge topic 'make-GENERATED-visible-from-any-scope'
573d51201a GENERATED prop: Set CMP0118 to NEW for some (unrelated) tests
6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW
b14fe704f8 GENERATED prop: Simplify determining the language of a source file
ca4ce458a3 GENERATED prop: Check CMP0118 policy and warn in certain situations
0eb30f175e GENERATED prop: Introducing policy CMP0118 and its documentation
78c8d95605 GENERATED prop: Add some tests before introducing changes with CMP0118
e01527619f Simplify code by calling a function directly instead of duplicating it
75cb8615e9 Fix typo in function name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5308
2020-11-30 12:38:17 -05:00
Raul Tambre
c4ae9384ff CUDA: Initialize CMAKE_CUDA_ARCHITECTURES using $ENV{CUDAARCHS}
NVCC's default architecture may be newer than the one supported by the
machine's GPU.
In such cases it's useful to have an environment variable for initializing
CMAKE_CUDA_ARCHITECTURES to avoid specifying it for every invocation.
2020-11-30 17:57:11 +02:00
Craig Scott
ea212834c0 Merge topic 'xcode-embed-frameworks'
5651901c54 Xcode: add support for embedding frameworks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cameron Lowell Palmer <cameron.palmer@icloud.com>
Merge-request: !5418
2020-11-29 16:54:15 -05:00
Craig Scott
5a868f1488 Merge topic 'presets-docs-bug'
ca289abea5 Help: Fix presets typo (longDescription to displayName)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5541
2020-11-29 16:02:00 -05:00
Marc Chevrier
2c71d051fa Makefiles Generators: use compiler for dependencies generation
Each source compilation generates a dependencies file. These dependencies
files are consolidated in one file per target. This consolidation is done
as part of command 'cmake -E cmake_depends` launched before evaluation of
makefile dependency graph.

The consolidation uses the same approach as `CMake` dependencies management.

Fixes: #21321
2020-11-29 15:25:42 +01:00
Sam Freed
ca289abea5 Help: Fix presets typo (longDescription to displayName) 2020-11-28 16:32:31 +11:00
Gusts Kaksis
5651901c54 Xcode: add support for embedding frameworks
This commit also prepares for embedding things other than
frameworks. In the future, we may want to embed resources and
other types supported by Xcode, so the target properties have
been documented in a way that clearly signals the future intent.
2020-11-28 15:36:24 +11:00
Deniz Bahadir
0eb30f175e GENERATED prop: Introducing policy CMP0118 and its documentation
Note: This is currently only defining the CMP0118 policy and providing
its documentation, however, the implementation is still not using it.
2020-11-24 17:41:02 +01:00
Brad King
51ee82ddc6 Help: Restore documentation placeholder for removed modules
In commit cb28d9af1f (UseJava: Move helper scripts to subdirectory,
2020-11-12) we removed modules that were not meant to be documented
publicly.  In order to keep links from older versions on `cmake.org` to
the "latest" documentation working for those modules, add placeholder
documents describing the change.
2020-11-20 12:30:14 -05:00
Brad King
c8b2331e8b Merge topic 'rename_cuda_memcheck'
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5514
2020-11-18 07:29:54 -05:00
Tobias Ribizel
fea49b2df0
CTest: Rename CudaMemcheck to CudaSanitizer 2020-11-17 21:06:30 +01:00
Brad King
c00a6d3967 MSVC: Do not add /GR to CMAKE_CXX_FLAGS by default
The `/GR` flag has been on by default since MSVC cl 14.0 from VS 2005.
Remove it from the default flags to make it easier for projects to pass
`/GR-` themselves to turn it off.

Projects may be using string processing to replace `/GR` with another
flag, so we cannot simply drop it.  Add a policy to drop it in a
compatible way.

Fixes: #21428
2020-11-13 11:46:23 -05:00
Nikita Nemkin
cb28d9af1f UseJava: Move helper scripts to subdirectory
Also, exclude them from the help module index.
2020-11-12 20:14:05 +05:00
Craig Scott
9201b3fa40 Merge topic 'help_ctest_cuda_memcheck'
e620bb7293 Help: Add cuda-memcheck to CTest documentation
fb98883e2b CTest: Add cuda-memcheck to Dart and CTest module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5469
2020-11-06 05:50:53 -05:00
Tobias Ribizel
e620bb7293 Help: Add cuda-memcheck to CTest documentation
Issue: #21388
2020-11-05 10:05:01 -05:00
Brad King
a9e2b18bf3 Merge topic 'android-stl'
4dca078829 Android: Link c++abi and android_support when necessary
738caa4d48 Android: Add options to control exceptions/rtti

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5444
2020-11-05 07:55:46 -05:00
Haibo Huang
738caa4d48 Android: Add options to control exceptions/rtti
With the NDK's `android.toolchain.cmake`, the user can control whether
exceptions/rtti is enabled using `ANDROID_CPP_FEATURES`:

  43b2de34ef/build/cmake/android.toolchain.cmake (548)

Add `CMAKE_ANDROID_RTTI` and `CMAKE_ANDROID_EXCEPTIONS` to support that.
2020-11-04 14:18:03 -05:00
Brad King
f511a1c009 CMakeDetermineCompilerABI: Detect byte order as part of check
We already detect `sizeof(void*)`.  Detect the byte order as part of the
same check.

Issue: #21392
2020-11-04 10:08:13 -05:00
Marc Chevrier
1c912056a1 cmake_path: remove new command from 3.19
Defer adding this command until post-3.19 development so that it
has more time to mature before being included in a release.

Issue: #21385
2020-11-03 09:55:35 -05:00
Brad King
4e59b42264 Merge topic 'cmake-gui-manual-argument'
ef03124237 CMake GUI: Add --browse-manual argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5417
2020-10-28 07:37:08 -04:00
Kyle Edwards
ef03124237 CMake GUI: Add --browse-manual argument 2020-10-27 12:05:41 -04: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
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
Craig Scott
5e1858c0c2 Merge topic 'cmake-presets-toolset-arch-config' into release-3.19
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5387
2020-10-23 06:37:56 -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
Craig Scott
5d20e6d803 Merge topic 'cmake-presets-source-dir-name'
25742c589c CMakePresets.json: Add ${sourceDirName} macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !5386
2020-10-23 06:36:03 -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
25742c589c CMakePresets.json: Add ${sourceDirName} macro
Fixes: #21312
2020-10-22 11:09:28 -04:00
Kyle Edwards
6abe14d226 Merge topic 'cmake-presets-boolean-cache'
920d180047 CMakePresets.json: Allow boolean for cache variable value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5398
2020-10-22 11:04:19 -04:00
Kyle Edwards
920d180047 CMakePresets.json: Allow boolean for cache variable value
Fixes: #21327
2020-10-21 10:37:08 -04:00
Kyle Edwards
cf6ac2d365 Merge branch 'master' into cmakepresets-schema 2020-10-20 14:51:42 -04:00
Ben McMorran
0307f7c980 Help: Add JSON schema for CMakePresets.json 2020-10-20 12:07:09 -04:00