1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-09 23:08:18 +08:00

202 Commits

Author SHA1 Message Date
Kyle Edwards
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation 2021-02-23 09:14:31 -05:00
Brad King
422d9a0ab2 Factor out generator checks for filtering out interface libraries
Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell
generators whether a target should participate in the generated build
system.
2020-07-23 13:31:44 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Justin Goshi
bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding
Adds a flag to indicate that pipe output from a custom command should be
interpreted as UTF-8 encoded. This change does not introduce a public
way to set the flag, but generators that create internally-generated
commands know if they are calling cmake, which uses UTF-8 pipes.

MSBuild added support for interpreting output of PreBuildEvent,
PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change
will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need
to add the StdOutEncoding tag. MSBuild treats these as property bags so
if we emit the tag for earlier versions of Visual Studio it would be
safely ignored. This change emits the StdOutEncoding tag and sets it to
UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes
globalization issues when the output from cmake contained characters
that required MSBuild to interpret as UTF-8 before displaying them.
2020-04-13 12:54:47 -07:00
Alexander Boczar
7c944da757 VS: Add target property to explicitly control solution deployment
Add a `VS_SOLUTION_DEPLOY` property to control solution deploy mark.

Fixes: #20346
2020-02-25 10:24:23 -05:00
Kyle Edwards
7abc3d61ac Ninja Multi-Config: Fix issue with framework dependencies and Autogen
Fixes: #20345
2020-02-17 08:24:57 -05:00
Vitaly Stakhovsky
bbc07e4561 Source: use std::string in place of const char* 2020-01-29 14:31:01 -05: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
Daniel Eiband
777ceaea94 cmMakefile: Delay custom command creation
Move custom command creation to cmLocalGenerator and dispatch custom
commands in cmMakefile to generate time.  Generators add custom commands
using the new methods provided by cmLocalGenerator.

Issue: #12877
2019-11-24 20:32:43 +01:00
Marc Chevrier
f93385283f cmLocalGenerator: modernize memory management 2019-11-11 16:41:13 +01:00
Daniel Eiband
5a06efda05 cmMakefile: Remove AddUtilityCommand overload without byproducts 2019-09-26 10:04:03 -04:00
Daniel Eiband
f151a57705 cmMakefile: Move enumerations into new header
The enumerations will also be used in cmLocalGenerator.
2019-09-26 10:02:06 -04:00
Daniel Eiband
7dcf9cb83c cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility
cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is
needed or an instance of cmCompiledGeneratorExpression cannot be cached.

Fixes: #19686
2019-09-23 21:19:15 +02:00
Daniel Eiband
7f3ecbe7d7 cmCustomCommandLine: Provide command line make functions
Reduce boilerplate necessary to create custom command lines by introducing and
applying cmMakeCommandLine and cmMakeSingleCommandLine functions.
2019-09-16 20:45:41 +02:00
Daniel Eiband
4fb29850ad add_custom_command: Refactor setting implicit depends
Implicit dependencies are now passed as argument to AddCustomCommandToOutput.
This is necessary to be able to delay custom command creation.
2019-09-12 23:00:36 +02:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Daniel Eiband
2d888e3390 cmSourceFile: Rename mutating GetFullPath() overload
Rename mutating GetFullPath() overload to ResolveFullPath().
2019-08-29 22:51:58 +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
20e580be01 Source sweep: Use cmIsOn instead of cmSystemTools::IsOn
This replaces invocations of

- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
2019-08-17 12:14:14 +02:00
Sebastian Holtermann
f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument 2019-08-14 16:33:20 +02:00
Sebastian Holtermann
e91bfe440c cmMakefile: Let AddDefinition accept a value as cm::string_view
This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
argument instead of a `const char *`.

Benefits are:
- `std::string` can be passed to `cmMakefile::AddDefinition` directly without
  the `c_str()` plus string length recomputation fallback.
- Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
  compile time.

In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
`std::string::c_str` calls and the `std::string` is passed directly.
Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
2019-07-24 11:11:25 +02:00
Sebastian Holtermann
006229278b Use cmAppend to append ranges to std::vector instances 2019-05-23 16:19:49 +02:00
Vitaly Stakhovsky
23e8364aed Source: std::string related cleanup 2019-05-15 10:20:05 -04:00
Brad King
2621efac19 Merge topic 'vs-wince-no-deploy'
917c035ada VS: support suppressing deployment of selected targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2991
2019-02-26 11:10:08 -05:00
Wil Stark
917c035ada VS: support suppressing deployment of selected targets
Add a `VS_NO_SOLUTION_DEPLOY` target property to explicitly specify for
each target whether to suppress VS solution deployment of the generated
target project.

Fixes: #18953
2019-02-25 09:14:15 -05:00
Vitaly Stakhovsky
9dd255548d cmSystemTools::Error: consolidate parameters into single std::string 2019-02-20 11:18:11 -05:00
Bruno Manganelli
3e867ed400 cmake: inlined files dir constant and removed it from cmake.h 2019-01-21 15:34:16 +00:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Brad King
b91f6f39f7 VS: Track explicitly when platform is specified in generator name 2019-01-10 09:38:35 -05:00
Brad King
40a732800d VS: Clarify global generator constructor interface
Make the constructors protected since they should be produced through
factories.  Also rename `platform{ => InGenerator}Name` to clarify
the meaning of the argument.
2019-01-10 09:38:35 -05:00
Vitaly Stakhovsky
94632087b2 Add missing override 2018-12-30 12:32:55 -05:00
Stephan Szabo
8279302110 Convert cmIDEFlagTable to use owned strings
Convert from char* to std::string in flag tables.
Change termination condition from nullptr to empty string in command flag.
Update tables to store empty strings.
2018-11-28 07:43:25 -08:00
Brad King
a6e02f881d add_dependencies: Track backtraces internally
Record backtraces for "utility" dependencies created by
`add_dependencies` calls.
2018-10-18 08:10:55 -04:00
Robert Maynard
de962cc00d CMake: Internally uses -S instead of -H to specify source directory 2018-09-15 11:25:47 -04:00
Brad King
d308e9442e Merge topic 'glob_configure_depends'
6c4f8b4596 Adjust help documentation for file(GLOB), add topic notes
20612978c8 Add tests for `file(GLOB)` CONFIGURE_DEPENDS flag
3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators
ca0befc2e1 Add `CONFIGURE_DEPENDS` flag support to cmFileCommand::HandleGlobCommand
599c93e22d Add cmGlobVerificationManager class, integrate with cmake and cmState

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1767
2018-04-06 10:25:08 -04:00
Brad King
eb80af9093 Drop Visual Studio 8 2005 generator
This generator has been deprecated since CMake 3.9.  Remove it.
2018-04-02 10:08:10 -04:00
Shane Parris
3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators 2018-04-01 23:16:12 -04:00
Shane Parris
b6ef4bc329 Document and extend the CMAKE_SUPPRESS_REGENERATION variable
Fixes: https://gitlab.kitware.com/cmake/cmake/issues/16815
2018-02-23 11:20:15 -05:00
Vitaly Stakhovsky
92c7b52607 VS: Use range-based 'for' loops in generator code
Use `auto` for complex types.
2017-12-21 14:52:49 -05:00
Justin Goshi
afd9a339a1 server: return whether or not a target is generator provided
Some generators auto-generate targets. For example VS generators create
the ALL_BUILD target. Add the ability to mark targets as generator
provided and return that info through cmake-server codemodel.
2017-11-20 14:29:50 -05:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Brad King
7c28081c14 Merge topic 'string-clear'
5db3aac1 Meta: replace empty-string assignments with `clear()`.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1276
2017-09-19 08:27:00 -04:00
Pavel Solodovnikov
5db3aac111 Meta: replace empty-string assignments with clear(). 2017-09-16 02:26:49 +03:00
Brad King
0b33aee48b Use C++11 override instead of CM_OVERRIDE
We now require C++11 support including `override`.  Drop use of
the old compatibility macro.  Convert references as follows:

    git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' |
      xargs sed -i 's/CM_OVERRIDE/override/g'
2017-09-15 10:06:41 -04:00
Brad King
64e973e991 Merge branch 'backport-vs-fix-config-map' into vs-fix-config-map 2017-09-13 09:43:24 -04:00
Brad King
c5b5bb270f VS: Do not consider MAP_IMPORTED_CONFIG_<CONFIG> on non-imported targets
Since commit v3.9.0-rc1~309^2 (include_external_msproject: Honor
MAP_IMPORTED_CONFIG_<CONFIG>, 2017-04-04) we accidentally honor
`MAP_IMPORTED_CONFIG_<CONFIG>` while generating the `.sln` file entries
for normal targets.  This causes `devenv.com`-driven builds to use the
mapping incorrectly for normal targets.  Check that a target really
comes from `include_external_msproject` before considering the map.

Furthermore, when we do use the map, we should only take the first entry
if more than one configuration is specified.  Otherwise we end up giving
VS a configuration name with a `;` in it.

Fixes: #17276
2017-09-13 09:37:30 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Aaron Orenstein
7bc6577017 Performance: Fix a few more unnecessary vector copies missed in af3fd6f 2017-08-18 07:59:52 -07:00
Brad King
81f9c9e892 Deprecate Visual Studio 8 2005 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2017-04-21 13:45:45 -04:00