1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-18 17:31:57 +08:00
Commit Graph

34 Commits

Author SHA1 Message Date
Ben Boeckel
09b7ac7f67 strings: use single characters where possible 2023-07-30 18:33:07 -04:00
Ben Boeckel
6aa9023700 string_view: use string_view literals in comparisons 2023-07-30 18:33:07 -04:00
Ben Boeckel
f5d04b5bf0 cmStrCat: use where possible in Apple-specific sources 2023-07-30 18:33:07 -04:00
Ben Boeckel
ce549909fb cmCPackPKGGenerator: remove unnecessary .c_str() calls 2023-07-30 18:33:07 -04:00
Vitaly Stakhovsky
b3edfcf46e cmValue: Use operator* explicitly to convert to std::string; avoid extra call 2023-01-15 23:39:02 -05:00
Craig Scott
d099136add productbuild: Restore CPACK_PACKAGEMAKER_CHOICES variable
In 2a8df7e7db (productbuild: Don't write rootVolumeOnly attribute if
writing domains, 2022-03-21), the variable holding the main contents
of the distribution.dist XML file was renamed from
CPACK_PACKAGEMAKER_CHOICES to CPACK_APPLE_PKG_INSTALLER_CONTENT.
This reflected the fact that the PackageMaker generator is deprecated.
The new variable also includes more details than the old one held.
Some projects were relying on the old variable name, so we need to still
set that to the same contents as it would have previously provided.

Neither of these variables were previously documented, but the older
variable was mentioned in enough semi-official places that it essentially
became semi-supported. Document both variables and highlight that the
older one is deprecated.

Fixes: #23467
2022-04-30 00:28:05 +10:00
Craig Scott
2a8df7e7db productbuild: Don't write rootVolumeOnly attribute if writing domains
The rootVolumeOnly attribute is deprecated. Apple docs say to use
domains instead.

Fixes: #23343
2022-03-21 15:43:46 +11:00
Craig Scott
28fdc3a536 productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage
There's no benefit to storing the CPACK_PRODUCTBUILD_DOMAINS
prefix in a variable and appending to it in the C++ code. It has the
disadvantage of making it harder to find usages of the variables with
a suffix appended to that string. Expand out the strings at the places
they are used so that they are easier to spot.
2022-03-21 13:36:48 +11:00
David Wosk
da737d34e0 CPack/productbuild: add options to control domains element
The domains element determines the required authorization level needed
for the install. The auth attribute of the pkg-ref element has been
deprecated in favor of domains, so if the domains options are
specified, the auth attribute is omitted.

Fixes: #23030
2022-01-06 11:33:25 -05:00
Greg Fiumara
7213ceb869 CPack/productbuild: Add option to customize product identifier
This adds a new option, CPACK_PRODUCTBUILD_IDENTIFIER, which allows
for customization of the productbuild product identifier within the
CPack productbuild generator.

Fixes: #20830
2021-11-18 13:01:35 -05:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
7fce78982b Use new SetOption signatures 2021-09-15 18:30:49 +02:00
Marc Chevrier
202a65759b cmCPackGenerator::GetOption returns cmProp 2021-09-13 09:54:27 -04:00
Brad King
0e46dea343 Merge topic 'cpack-custom-templates'
7d6ab5dc5b CPack: Restore support for custom package configuration templates

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4054
2019-11-18 09:50:57 -05:00
Brad King
7d6ab5dc5b CPack: Restore support for custom package configuration templates
Refactoring in commit 98617f1be0 (Refactor: Move CPack internal files to
`Internal/CPack/` directory, 2019-07-09, v3.16.0-rc1~449^2) accidentally
changed the public-facing names of the templates.  The name passed to
`FindTemplate` is searched in `CMAKE_MODULE_PATH` and should not change.
Remove the `Internal/CPack/` prefix on the names added by that commit.
Teach `FindTemplate` to use our builtin default directly when the
public-facing name is not found in `CMAKE_MODULE_PATH`.

Fixes: #19979
2019-11-15 10:38:08 -05:00
Sergey Larin
e6069613a1 CPack: Set background image in macOS installer
Now you can set a background image and it's parameters in
productbuild and PackageMaker based installers.
2019-11-08 14:09:25 -05: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
Alex Turbov
98617f1be0 Refactor: Move CPack internal files to Internal/CPack/ directory
Some commits ago all CPack internal `*.cmake` files have been moved
to `Internal/CPack/`. This commit also move some templates
internally used by generators to the same location to make
`Modules/` directory less noisy w/ files the end users don't
need to use/see.
2019-07-09 15:45:03 +03:00
Vitaly Stakhovsky
0281f9a4ca cmMakefile::ConfigureFile: Accept std::string parameters 2019-02-18 20:48:19 -05:00
Artur Ryt
01b2d6ab74 Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some
reverse-iterator loops with range loops.

Fixes: #18858
2019-02-07 22:39:05 +01:00
Regina Pfeifer
55671b41d2 clang-tidy: Use = default
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
2019-01-25 06:44:32 -05:00
Brad King
7954ba9bc1 productbuild: escape pkg-ref urls
Inspired-by: James Goruk <james.goruk@gmail.com>
Fixes: #18645
2018-11-28 14:27:32 -05:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00
Alexander Wittig
f25d87db9e CPack: Fix macOS PKG component dependency information
Refactoring in commit v3.7.0-rc1~523^2 (CPack/PackageMaker: port to
cmXMLWriter, 2016-06-08) accidentally broke `distribution.dist`
generation when there are dependencies between components and the pkg
(or the derived productbuild) generator are used.  The resulting
package cannot be installed and instead the Apple Installer app
shows a "Javascript error" message.

The problem is that a `std::ostringstream` is constructed with some
content, but the stream pointer still points to the beginning of the
stream, so subsequent writes overwrite the initial content instead of
appending.
2017-12-01 10:52:55 -05:00
Matthias Maennich
870dd06da1 Fix left-over occurrences of else-after-return
Fix issues diagnosed by clang-tidy [readability-else-after-return]

These were mostly only showing up on OSX.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:42 -04:00
Matthias Maennich
a5279ae553 Use C++11 nullptr (cont.)
Fix remaining occurrences of the issue addressed in commit 5962db4389
(Use C++11 nullptr, 2017-08-22) that are only showing up on macOS.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-19 11:44:21 -04:00
Daniel Pfeifer
aeff60e44c iwyu: Fix OSX specific issues 2016-11-23 00:41:44 +01:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Gregor Jasny
60dcaaea13 tidy: Fix readability-redundant-string-cstr issues 2016-09-04 16:55:05 +02:00
Daniel Pfeifer
e9da5192e5 CPack/PackageMaker: port to cmXMLWriter 2016-06-09 09:16:34 -04:00
Brad King
ff08a80af1 Source/CPack: Run clang-format to fix style 2016-06-07 08:41:16 -04:00
Daniel Pfeifer
fa277b29e4 Remove c_str() calls from stream arguments.
Mostly automated:

git grep -l '.c_str() <<' | xargs sed -i 's|\.c_str() <<| <<|g'
2016-06-06 23:53:32 +02:00
Clinton Stimpson
2e3c67d1b6 productbuild: Add new productbuild cpack generator.
This cpack generator basically replaces the obsolete PackageMaker generator.
2016-06-03 14:41:57 -06:00
Clinton Stimpson
50a3d34005 PackageMaker: factor out common code for creating pkg files. 2016-06-01 21:56:50 -06:00