1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-23 12:50:54 +08:00

61 Commits

Author SHA1 Message Date
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
Brad King
5b3a71a83f cmSystemTools: Adopt RelativeIfUnder helper
This returns a relative path if it does not start in `../`.
2021-05-17 10:02:16 -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
Brad King
415ead8153 cmFileAPICodemodel: Build map from each target to its index 2021-03-16 11:24:28 -04:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05: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
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Brad King
bafa9fe887 fileapi: Add INTERFACE libraries with SOURCES to codemodel-v2
INTERFACE libraries with SOURCES now appear in the generated
buildsystem, so include them in the codemodel output too.

We do not need to bump the `codemodel-v2` object kind minor
version because that was already done in post-3.18 development
by commit 7d6861f367 (fileapi: Extend codemodel targets with
language standard, 2020-06-18).

Fixes: #18608
2020-08-07 08:46:34 -04:00
Justin Goshi
2f383d852d fileapi: Support multiple backtraces for language standard 2020-07-06 11:40:39 -07:00
Robert Maynard
7a969fe21d cmMakefile: Refactor API to better handle empty config values 2020-07-03 07:43:18 -04:00
Justin Goshi
7d6861f367 fileapi: Extend codemodel targets with language standard 2020-06-26 08:52:29 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Brad King
15b9b41d72 Merge topic 'fileApiAddPrecompileHeadersBacktrace'
9f6d40ee23 fileapi: Extend codemodel targets with PRECOMPILE_HEADERS
b698764a31 Tests: Add a PCH example to RunCMake.FileAPI codemodel-v2
b3812c0e54 Tests: Fix indentation in RunCMake.FileAPI cxx_exe.json
9c48804b69 PCH: Fix source group of per-architecture PCH headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4684
2020-05-25 10:40:56 -04:00
Justin Goshi
9f6d40ee23 fileapi: Extend codemodel targets with PRECOMPILE_HEADERS 2020-05-22 11:26:55 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Vitaly Stakhovsky
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp 2020-04-14 10:57:17 -04:00
Cristian Adam
f593b354da PCH: Add support for multi architecture iOS projects
Fixes: #20497
2020-04-02 11:51:19 -04:00
Marc Chevrier
f466cea3c9 cmMakefile: modernize memory management 2020-01-14 11:03:07 +01:00
Marc Chevrier
5444a8095d cmGlobalGenerator: modernize memrory managemenbt 2019-12-30 16:55:39 +01:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Marc Chevrier
36c8cae2e8 cmLocalGenerator: modernize memory management 2019-12-10 00:24:06 +01:00
Brad King
5b46bc3194 Merge topic 'unity-HEADER_FILE_ONLY'
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
2019-11-12 09:51:16 -05:00
Cristian Adam
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set
Fixes: #19946
Fixes: #19947
Co-authored-by: Craig Scott <craig.scott@crascit.com>
2019-11-11 14:10:18 +01:00
Daniel Eiband
ec2f130aa9 cmFileAPI: Resolve full path in PCH source comparison
Issue: 19927
2019-11-11 13:03:29 +01:00
Cristian Adam
36ded610af PCH: Generate sources during Compute step 2019-10-09 13:50:25 +02:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Justin Goshi
8b84c046fa fileapi: add some source property backtraces
Support backtraces for COMPILE_DEFINITIONS, COMPILE_OPTIONS, and
INCLUDE_DIRECTORIES source properties.
2019-09-26 10:56:52 -04:00
Brad King
4ade1b00c5 Merge topic 'fileapiLinkPathAndLinkDirBacktraces'
4d6334824d fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES
5bd65dff7a cmLocalGenerator: Add OutputLinkLibraries overload with backtraces
5d39e792ae cmGeneratorTarget: Store backtrace for target LINK_DIRECTORIES property
7da17ef797 cmLinkLineComputer: Add ComputeLinkLibraries overload with backtraces
d4d0dd0f6a cmLinkLineComputer: Add ComputeLinkLibs overload with backtraces
0ac9dcb807 cmLinkLineComputer: Add ComputeLinkPath overload with backtraces
0c6468178a cmComputeLinkInformation: Add GetDirectoriesWithBacktraces
a209b31d0d cmComputeLinkInformation: Add AppendValues with backtraces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3805
2019-09-20 10:22:01 -04:00
Justin Goshi
4d6334824d fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES 2019-09-18 14:00:39 -04:00
Brad King
1a1508c8b8 Merge topic 'modernize-use-auto'
d25a5a7ec9 clang-tidy: modernize-use-auto

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3783
2019-09-12 09:15:38 -04:00
Regina Pfeifer
d25a5a7ec9 clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators.  Leave new expressions and cast
expressions for later.
2019-09-10 22:21:41 +02:00
Justin Goshi
30006e199b fileapi: add backtraces for compile/link options 2019-09-10 10:45:41 -04:00
Brad King
1f7bd00322 Merge topic 'add-non-empty-configurations-getter'
10507c6dc0 cmMakefile: Add configurations getter with empty configuration default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3759
2019-09-03 09:42:15 -04:00
Brad King
c4f2f01108 Merge topic 'rename-mutating-getfullpath-overload'
2d888e3390 cmSourceFile: Rename mutating GetFullPath() overload

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3757
2019-09-03 09:40:44 -04:00
Brad King
917cfecf12 Merge topic 'fileapi-CMP0037-OLD'
9da1c33cf1 fileapi: Fix codemodel v2 target file name for CMP0037 OLD behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3760
2019-09-03 09:21:47 -04:00
Brad King
9da1c33cf1 fileapi: Fix codemodel v2 target file name for CMP0037 OLD behavior
With CMP0037 OLD behavior, executable and library target names may
contain a slash.  Avoid constructing file names with slashes.

Fixes: #19653
2019-08-30 10:20:12 -04:00
Daniel Eiband
10507c6dc0 cmMakefile: Add configurations getter with empty configuration default 2019-08-30 13:52:13 +02:00
Daniel Eiband
2d888e3390 cmSourceFile: Rename mutating GetFullPath() overload
Rename mutating GetFullPath() overload to ResolveFullPath().
2019-08-29 22:51:58 +02:00
Tushar Maheshwari
8cb3cffa42 cmSourceFile: Rename non-const GetLanguage
GetOrDetermineLanguage:
- Read the property if available
- Determine the Language using the file extension

Fix all usage of the non-const member in the repository.
2019-08-27 21:35:42 +05:30
Brad King
ddb1759b3e Merge topic 'cmStringAlgorithms_move_functions'
959b97a27f Tests: testStringAlgorithms: Add cmTrimWhitespace, cmEscapeQuotes, cmTokenize
7fbcc16dcd cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenize

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3647
2019-08-07 11:47:54 -04:00
Brad King
7eb2fd6ca6 Merge topic 'fileapi-install-generators'
d70a0f8681 fileapi: Fix codemodel target install destination for cross-dir rules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3639
2019-08-05 10:20:27 -04:00
Sebastian Holtermann
7fbcc16dcd cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenize
This adds the following functions to `cmStringAlgorithms`:

- `cmIsSpace`
- `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`)
- `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`)
- `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to
  accept `cm::string_view`)
2019-08-05 11:25:30 +02:00
Brad King
d70a0f8681 fileapi: Fix codemodel target install destination for cross-dir rules
Since commit e89ad0f94e (install: Allow installing targets created in
another directory, 2018-06-18, v3.13.0-rc1~407^2) we support calling
`install(TARGETS)` for targets created in another directory.  However,
install generators are associated with the directory in which the call
to `install()` appears.  This may not be the same directory in which the
target is defined.  Record in each target the list of install generators
it has.

Fixes: #19546
2019-07-31 19:32:55 -04:00
Brad King
b61fcdc8bc fileapi: Compute codemodel compile groups without target-wide settings
Previously we computed the entire description of each source file
including all target-wide settings, and then computed compile groups
using those complete descriptions.  This is inefficient when target-wide
settings are large because they are included in comparisons even though
they are the same for every source.  Instead compute source groups using
only the source-specific settings, and then merge the target-wide
settings into place only once per unique compile group.

This is a slight behavior change in the case that a source-specific
compile definition duplicates a target-wide definition.  Previously that
source would still be grouped with other sources which do not have the
definition because they would all get it from the target.  Now that
source will be in its own compile group even though it ultimately
compiles with the same settings as another group.  This is acceptable
because the source is specified by the project with source-specific
settings already.

Fixes: #19520
2019-07-30 10:03:35 -04:00
Brad King
e337e60a50 fileapi: Compute codemodel compile groups before converting to Json
Previously we converted the description of each source file into its
compile group Json object and then used the Json object itself as a
unique identifier for the group.  When source files have large
descriptions their Json objects make inefficient map keys requiring deep
comparison operations.  Instead use our internal `CompileData` structure
as a map key.  This enables use of a hash map.

Issue: #19520
2019-07-30 10:01:49 -04:00
Brad King
d89c0ecf79 fileapi: Generate codemodel Json backtraces earlier
Convert from `cmListFileBacktrace` to Json `backtraceGraph` entries
before storing in `CompileData`.  This will allow backtraces to be
uniquely identified, hashed, and compared as a single integer.
2019-07-30 10:01:36 -04:00