1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-16 08:53:56 +08:00

183 Commits

Author SHA1 Message Date
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
Kyle Edwards
4910132d8c install: Add RUNTIME_DEPENDENCY_SET mode 2021-06-04 08:52:02 -04:00
Kyle Edwards
bc8a4a06a4 install(IMPORTED_RUNTIME_ARTIFACTS): Add RUNTIME_DEPENDENCY_SET option 2021-06-04 08:52:02 -04:00
Kyle Edwards
3e7d3c252a install(TARGETS): Add RUNTIME_DEPENDENCY_SET argument 2021-06-04 08:52:02 -04:00
Kyle Edwards
ed3633d88c install(TARGETS): Add RUNTIME_DEPENDENCIES option 2021-06-04 08:52:02 -04:00
Kyle Edwards
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode 2021-05-31 09:02:45 -04: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
Brad King
553cd4db44 Merge topic 'fixAppleResourceWarning'
169da7cd81 Do not show RESOURCE DESTINATION warning for MACOSX_BUNDLE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6104
2021-05-11 09:27:45 -04:00
Mike Achtelik
169da7cd81 Do not show RESOURCE DESTINATION warning for MACOSX_BUNDLE
RESOURCE arguments are ignored on Apple platforms because the
associated files are installed into the appropriate locations
inside the framework folder. So we do not need to show a warning,
that no RESOURCE DESTINATION is defined.

Fixes #15676
2021-05-07 21:16:08 +02:00
Jens Carl
d71a7cc19d install(FILES): Allow installation of symlinks to directory
Allow symbolic links to a directory to be installed via install(FILES ...).

Fixes: #22159
2021-05-06 15:29:51 -07:00
Brad King
e32818dd76 cmInstallGenerator: Add backtrace to all install generators 2021-01-28 12:47:58 -05:00
Ben Boeckel
808b17b120 clang-tidy: fix readability-make-member-function-const warnings 2021-01-27 08:45:45 -05:00
Deniz Bahadir
38bcb5c0a3 export: Do not fail generation for separate namelink only case
Update the change from commit 64690f6df0 (export: Do not fail generation
for namelink-only case, 2020-10-09, v3.19.0-rc1~7^2) to also handle
separate namelink-only and namelink-skip calls.

Fixes: #21529
2020-12-01 07:35:17 -05:00
Craig Scott
0a9af79995 export: Remove leftover inaccurate code comment
No functional changes.

Relates: !5352
2020-10-13 21:38:29 +11:00
Deniz Bahadir
64690f6df0 export: Do not fail generation for namelink-only case 2020-10-09 22:29:22 +02:00
Lemures Lemniscati
8edbc59e46 install: Use case-sensitive pattern matching on Cygwin
Based on downstream patch from Cygwin package for CMake by Marco Atzeri:

* 64864eb8f0/cmake/3.17.3-case-sensitivity.patch
2020-08-06 12:36:38 -04:00
Vitaly Stakhovsky
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string 2020-07-14 15:18:59 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Ben Boeckel
f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Vitaly Stakhovsky
3eec21a01c cmTarget::GetProperty: return cmProp 2020-03-30 15:00:14 -04:00
Brad King
dd8d5004a9 Merge branch 'backport-3.16-install-default-fix' 2020-02-11 14:59:21 -05:00
Kyle Edwards
9442ae5083 install: Fix regression when using default destinations
In commit 9fc20a4f3e (install: Add sane set of defaults for DESTINATION
and file type parameters, 2018-11-02, v3.14.0-rc1~410^2~1), a regression
was introduced, in which an `install(TARGETS)` with a
RUNTIME/LIBRARY/ARCHIVE DESTINATION but no PUBLIC_HEADER/PRIVATE_HEADER
DESTINATION would then install the headers.  The old behavior did not do
this.  Restore the old behavior.

Fixes: #20326
2020-02-11 08:34:16 -05:00
Vitaly Stakhovsky
5e54b0cf2f cmInstallGenerator: std::string params
Several construction parameters converted to std::string
Also made a few class members const
2020-01-21 11:09:35 -05:00
Vitaly Stakhovsky
9db532f44d cmInstall*Generator: std::string params
Several construction parameters converted to std::string
Also made a few class members const
2020-01-21 09:19:13 -05:00
Marc Chevrier
f466cea3c9 cmMakefile: modernize memory management 2020-01-14 11:03:07 +01: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
Regina Pfeifer
920f0dd83a cmInstallCommand: Port away from cmCommand 2019-09-21 05:20:59 +02:00
Brad King
01d2944458 Merge topic 'smart_ptr/cmExportSet'
71f088f53a cmExportSet: subsume cmExportSetMap source files
6511fa6f33 cmExportSet: default destructor
9b8a1f7c28 cmExportSetMap: improve ownership of cmExportSet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3816
2019-09-20 10:26:41 -04:00
Tushar Maheshwari
71f088f53a cmExportSet: subsume cmExportSetMap source files 2019-09-19 19:20:30 +05:30
Tushar Maheshwari
6511fa6f33 cmExportSet: default destructor 2019-09-19 19:20:29 +05:30
Tushar Maheshwari
9b8a1f7c28 cmExportSetMap: improve ownership of cmExportSet
- use `std::piecewise_construct` to fix gcc-4.8 build.
- can use `emplace(name, name)` gcc-6 onwards.
2019-09-19 19:20:29 +05:30
Asit Dhal
9dba84cfa5 Refactor: Use cmStrCat to construct error strings
Replace string construction using std::stringstream with cmStrCat and
cmWrap.
2019-09-18 14:18:46 -04:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Brad King
37c671570c Merge topic 'source_sweep_ostringstream_single'
3b2b02825d Source sweep: Replace std::ostringstream when used with a single append

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3726
2019-08-26 10:49:10 -04:00
Sebastian Holtermann
3b2b02825d Source sweep: Replace std::ostringstream when used with a single append
This replaces `std::ostringstream`, when it is written to only once.
If the single written argument was numeric, `std::to_string` is used instead.
Otherwise, the single written argument is used directly instead of the
`std::ostringstream::str()` invocation.
2019-08-23 18:52:33 +02:00
Sebastian Holtermann
aaf59120bf Source sweep: Replace cmExpandList with the shorter cmExpandedList
This replaces the code pattern
```
std::vector<std::string> args;
cmExpandList(valueStr, args, ...)
```
with
```
std::vector<std::string> args = cmExpandedList(valueStr, ...)
```
2019-08-23 17:07:49 +02:00
Sebastian Holtermann
9b334397f5 Source sweep: Use cmStrCat for string concatenation
This patch is generated by a python script that uses regular expressions to
search for string concatenation patterns of the kind

```
std::string str = <ARG0>;
str += <ARG1>;
str += <ARG2>;
...
```

and replaces them with a single `cmStrCat` call

```
std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
```

If any `<ARGX>` is itself a concatenated string of the kind

```
a + b + c + ...;
```

then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.

If there's a sequence of literals in the `<ARGX>`, then all literals in the
sequence are concatenated and merged into a single literal argument for
the `cmStrCat` call.

Single character strings are converted to single char arguments for
the `cmStrCat` call.

`std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
because it supports numeric types as well as string types.

`arg.substr(x)` arguments to `cmStrCat` are replaced with
`cm::string_view(arg).substr(x)`
2019-08-22 16:38:10 +02:00
Sebastian Holtermann
f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument 2019-08-14 16:33:20 +02:00
Kitware Robot
54e9d38c28 Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP 2019-08-09 10:41:44 -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
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
Sebastian Holtermann
f71f7ce3f0 cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Brad King
2fa920c0cd AIX: Create import library for executables with exports
On AIX, plugins meant to be loaded into executables via `dlopen` must be
linked with access to a list of symbols exported from the executable in
order to use them (when not using runtime linking).  The AIX linker
supports specifying this list as an "import file" passed on the command
line either via the `-bI:...` option or (with a leading `#! .` line) as
a normal input file like any other library file.

The linker import file plays the same role on AIX as import libraries do
on Windows.  Teach CMake to enable its import library abstraction on AIX
for executables with the `ENABLE_EXPORTS` target property set.  Teach
our internal `ExportImportList` script to optionally generate a leading
`#! .` line at the top of the generated export/import list.  Update our
rule for linking an executable with exports to generate a public-facing
"import library" implemented as an AIX linker import file.

With this approach, our existing infrastructure for handling import
libraries on Windows will now work for AIX linker import files too:

* Plugins that link to their executable's symbols will be automatically
  linked using the import file on the command line.

* The executable's import file will be (optionally) installed and
  exported for use in linking externally-built plugins.

This will allow executables and their plugins to build even if we later
turn off runtime linking.

Issue: #19163
2019-07-16 14:15:13 -04:00
Brad King
79f5ef19fe De-duplicate checks for whether a platform uses Windows DLLs 2019-07-12 17:35:49 -04:00
Brad King
4adc0b7c75 Merge topic 'iface-headers'
a40f9083dd INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3181
2019-04-12 10:20:20 -04:00
Avraham Shukron
a40f9083dd INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties
Also support installing headers on an INTERFACE library.

Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com>
Fixes: #15234
2019-04-11 11:09:42 -04:00
Regina Pfeifer
e6b6bb0618 cmInstallCommand: Port to cmArgumentParser 2019-04-04 13:24:39 -04:00
Brad King
47389c5641 install: Do not crash on imported global target
Since commit e89ad0f94e (install: Allow installing targets created in
another directory, 2018-06-18, v3.13.0-rc1~407^2) the `install(TARGETS)`
command may find a global-scoped target outside the calling directory.
Ignore an `IMPORTED GLOBAL` target if it is found in this way.  Imported
targets cannot be installed, and trying to do so violates internal
invariants.

Fixes: #19022
2019-03-07 09:00:56 -05:00
Vitaly Stakhovsky
186d9b083d cmSystemTools::Message: Add overload accepting std::string 2019-01-28 09:35:51 -05:00