Commit Graph

1350 Commits

Author SHA1 Message Date
Kyle Edwards
c798744f81 FILE_SET: Add VERIFY_HEADER_SETS target property
Fixes: #23338
2022-03-29 13:58:27 -04: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
Brad King
069d836dab Merge topic 'restore-target-export-includes'
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6969
2022-02-10 09:07:35 -05:00
Eugene Shalygin
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION
In commit 55e4753bbb (Refactor cmTargetExport removing
InterfaceIncludeDirecories, 2021-07-20, v3.22.0-rc1~337^2~1) the storage
of `INCLUDES DESTINATION` was moved into each target.  However, a target
may be installed in multiple exports, and their `INCLUDES DESTINATION`
should not be mixed.

Convert the IncludeDirectoriesEntries vector to a map and modify access
function to store the directories lists with respect to cmExportTarget
object. This fixes error when the same target is exported more than once
via different exports and each for consequent export its include
directories list grows. Add a test for this case.

Fixes: #23183
2022-02-09 13:31:26 -05: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
Brad King
193a999cd5 cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage
These properties will be given meaning by later commits.
2022-01-29 06:48:12 -05:00
Kyle Edwards
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
2022-01-20 09:05:35 -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
Brad King
a84a62e0a7 cmTarget: Record backtraces for INTERFACE_LINK_LIBRARIES 2021-12-15 12:29:44 -05:00
Brad King
c749982c13 cmTargetPropertyComputer: Simplify by restoring use of cmMakefile
Logically revert commit 390a7d8647 (cmTargetPropertyComputer: Implement
GetProperty without cmMakefile, 2016-10-13, v3.8.0-rc1~445^2~9).
It relied on using `cmListFileBacktrace` to get a scope in which to
look up policies.

This does remove a backtrace from `LOCATION` property errors at generate
time, but the backtrace we reported before was incorrect.  It pointed at
the addition of a target, not to the reference to the property.
2021-12-08 10:03:48 -05: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
Kyle Edwards
f2a44a8afa cmTarget: Add cmFileSet and associated properties 2021-10-27 15:17:23 -04: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
Sean McBride
37859e3244 Source: Fix clang -Wimplicit-fallthrough warnings 2021-09-28 10:53:54 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Kyle Edwards
ab94c369c9 Refactor: Convert parallel string/backtrace vectors to BT vectors 2021-09-03 09:52:14 -04:00
Marc Chevrier
dc3aa4024e Refactor: Use new SetProperty signatures 2021-08-25 10:09:10 +02:00
Marc Chevrier
6dfa581bab Enhancement: SetProperty accept cmProp or std::string
Methods SetProperty of classes cmPropertyMap, cmStateDirectory
and cmMakefile accept now cmProp or std::string as argument.
2021-08-25 10:09:02 +02:00
Marc Chevrier
e5cd39ca80 cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
2021-08-08 16:19:08 +02:00
Eugene Shalygin
55e4753bbb Refactor cmTargetExport removing InterfaceIncludeDirecories
Because of this property in the cmTargetExport struct, exporting targets
is not uniform: top-level ones have to be dealt with via the
cmTargetExport objects, while all linked ones are cmGeneratorTarget
objects. Let's pass this additional includedirectories via a special
target property making handling exported targets uniform.
2021-07-22 13:08:58 +02:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Brad King
4cb6a53bf5 cmListFileCache: Simplify relative path conversion in backtraces
Printing paths to CMake input files does not need to use the
generator-wide relative path conversion rules because we are not
actually generating a relative path for the build system that needs to
be consistent with anything else.  Instead, simply print a relative path
if it does not need to start in `../`, and otherwise an absolute path.
2021-05-17 10:03:33 -04:00
Brad King
ba7b939831 cmStateDirectory: Rename ConvertToRelPathIf{Not => }Contained
The "Not" in the method name is backward from its logic.
2021-05-12 15:53:37 -04:00
Ben Boeckel
b3b6ede6a1 clang-tidy: fix readability-redundant-access-specifiers warnings 2021-01-27 08:45:45 -05:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Brad King
1cbbfbc78f Merge topic 'export-compile-commands-per-target'
a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5651
2021-01-07 08:22:27 -05: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
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02: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
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
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
adf3ea701d Merge topic 'policy-cmp0111-iface'
54ef732b0c cmVisualStudio10TargetGenerator: Avoid GetFullPath on INTERFACE library
f06f4b517c cmTarget: Do not enforce CMP0111 on imported INTERFACE libraries
43c95df8fb Tests: Match RunCMake.CMP0111 stderr more strictly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5530
2020-11-24 08:43:22 -05:00
Brad King
f06f4b517c cmTarget: Do not enforce CMP0111 on imported INTERFACE libraries
Fix logic added by commit 359c500a24 (cmTarget: Raise error if imported
target location is not set, 2020-08-08, v3.19.0-rc1~273^2) to exclude
INTERFACE libraries from the policy.  They have no location.

Fixes: #21470
2020-11-23 15:56:28 -05:00
Andrew Fuller
1134064e22 clang-tidy: allow OBJC and OBJCXX 2020-11-05 11:39:32 -08:00
Brad King
3e36d5e846 cmGeneratorTarget: Refactor custom command dependency evaluation
Previously we only used cmCustomCommandGenerator to evaluate generator
expressions for dependencies.  Use it for command lines too.  It also
collects target references for us, with backtraces.
2020-10-29 09:37:44 -04:00
Cengizhan Pasaoglu
bd705788f6 Constify some code as suggested by clang-tidy 2020-10-20 00:04:04 +03:00
Brad King
48ed3bae58 Merge topic 'pch-instantiate-templates'
8c8f03422e PCH: Template instantiation support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5168
2020-09-10 16:32:39 -04:00
Brad King
d0ccc7cf2a Merge topic 'ispc_improvements'
a020787a9b ISPC: Support generation for multiple instruction sets
5a1750017e ISPC: Add compiler launcher support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5173
2020-09-08 11:19:28 -04:00
Robert Maynard
a020787a9b ISPC: Support generation for multiple instruction sets 2020-09-04 08:37:07 -04:00
Robert Maynard
5a1750017e ISPC: Add compiler launcher support 2020-09-03 11:46:11 -04:00
Vitaly Stakhovsky
1380b43764 Refactor: Use cmToCStr() 2020-09-03 11:36:54 -04:00
Brad King
ca5babfd7a Merge topic 'getdef'
11425041f0 cmMakefile::GetDefinition: return cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5179
2020-09-03 09:18:05 -04:00
Thomas G
76cc687e98 Fortran: Initialize Fortran_VISIBILITY_PRESET property from variable
The `CMAKE_Fortran_VISIBILITY_PRESET` variable is documented to
initialize the property.  Fix it.
2020-09-02 13:48:42 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Tobias Hieta
8c8f03422e PCH: Template instantiation support
Adds PCH_INSTANTIATE_TEMPLATES target property for enabling template
instantiation in precompiled headers.
Enabled by default. Currently only supported for Clang 11 and newer.

Implements #21133.
2020-09-02 08:30:55 +02:00
Craig Scott
3001e8b5d9 Merge topic 'xcode-link-phase-all'
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
dc0898205c Xcode: Add special case for file type extension map for .xcassets
7b3d8411a2 Xcode: Refactor build setting append code and attribute getter naming

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5036
2020-09-01 09:38:05 -04:00