810 Commits

Author SHA1 Message Date
Brad King
c7428e1729 Merge topic 'read-list-file'
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2821
2019-01-21 07:57:33 -05:00
Regina Pfeifer
ef61997b1b clang-tidy: Use emplace 2019-01-17 13:12:02 -05:00
Vitaly Stakhovsky
25caf7bafe cmMakefile::ReadListFile() accepts std::string argument
Same for cmMakefile::ReadDependentFile(); some cleanup
2019-01-17 12:36:07 -05:00
Kyle Edwards
4568d046c4 Properties: Add CMAKE_ROLE global property
This property allows scripts to determine whether they're in project
mode, script mode, find-package mode, CTest, or CPack.
2019-01-17 09:44:29 -05:00
Sean McBride
b056bc3425 Fix most clang -Wextra-semi-stmt warnings in C++ files
Suppress one in code generated by flex.
2019-01-15 14:09:46 -05:00
Regina Pfeifer
414aa6c81e clang-tidy: Simplify boolean expressions 2019-01-15 11:40:25 -05:00
Brad King
cd0881be61 IWYU: Update CMake code for IWYU built with Clang 6
IWYU now correctly requires `<utility>` for `std::move`.  It also
requires a container header when used via a range-based for loop.
2019-01-15 10:00:50 -05:00
Vitaly Stakhovsky
94632087b2 Add missing override 2018-12-30 12:32:55 -05:00
Brad King
d99e1cca20 Merge topic 'cpack-status-callback'
4a3ae1710e CPack/External: Fix status messages of staging scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2696
2018-12-10 08:17:06 -05:00
Nils Gladitz
4a3ae1710e CPack/External: Fix status messages of staging scripts
Set progress callback on cmake instance used by CPack.  The progress
callback is used to output STATUS messages which are otherwise missing
when issued from e.g. CPack External staging scripts.

Fixes: #18567
2018-12-07 07:33:30 -05:00
Regina Pfeifer
a816fe298d cmCPackFreeBSDGenerator: fix clang-tidy issues
Install FreeBSD's libpkg on Linux and configure CMake with
CPACK_ENABLE_FREEBSD_PKG and CMake_RUN_IWYU set to ON.
Then, fix all warnings.
2018-12-06 19:45:24 +01:00
Brad King
81bea69bd1 Merge topic 'productbuild-encode-pkg-url-ref'
7954ba9bc1 productbuild: escape pkg-ref urls
652210e901 cmSystemTools: Add EncodeURL helper

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2681
2018-12-06 09:06:13 -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
Guillem Jover
38e75bb3c6 CPack/Deb: Remove paxr as a supported tar format for a .deb
The only format supported from the ones available within cpack is
gnutar, which supports large numbers encoded in base-256, and long
filenames and linknames. PAX is not and has never been a supported
format by dpkg.

Fixes: #18620
2018-11-28 09:31:28 -05:00
Brad King
772edffbf0 Merge topic 'readability-static-accessed-through-instance'
3e60580784 clang-tidy: Fix readability-static-accessed-through-instance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2647
2018-11-28 09:07:45 -05:00
Brad King
cb6229b8b8 clang-tidy: fix warnings in macOS-only code 2018-11-27 13:20:34 -05:00
Regina Pfeifer
3e60580784 clang-tidy: Fix readability-static-accessed-through-instance
Enable the check in .clang-tidy and fix all warnings.
2018-11-22 00:11:37 +01:00
Robert Maynard
f29e2292c9 cpack: When given an unknown generator print out all valid generators
This makes cpack behavior match cmake when passed an invalid generator
2018-11-08 19:07:24 -05:00
Robert Maynard
eba7273c20 cpack: Better error message when generator doesn't exist.
Currently the CPack error message when passed an invalid generator
name  reads like the generator failed to work, rather than the
name was invalid.
2018-11-08 09:32:18 -05:00
Craig Scott
20d5e77a27 CPack: Rename Ext generator to External
Ext and External were used inconsistently in the code and the
docs. This change converts all uses of Ext to External, including
within variable names used by the generator.
2018-11-05 07:56:03 -05:00
Andrew Fuller
d8a3939aef CPack/Deb: Add ability to split out debug symbols into .ddeb package 2018-09-21 20:19:31 +00:00
Craig Scott
2c154fec6b Warnings: Remove unused variables 2018-09-11 10:20:35 +08:00
Nils Gladitz
4a0f664aaf CPackExt: Add CPACK_EXT_ENABLE_STAGING and CPACK_EXT_PACKAGE_SCRIPT
CPACK_EXT_ENABLE_STAGING enables optional staging
and CPACK_EXT_PACKAGE_SCRIPT allows to specify an optional
script file that can package staged files via an
external packaging tool.

Issue: #18236
2018-08-14 08:37:03 +02:00
Brad King
75844dd609 Merge topic 'cleanup-find-cstr'
69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2271
2018-08-09 08:00:03 -04:00
Vitaly Stakhovsky
69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls 2018-08-07 15:28:24 -04:00
Sebastian Holtermann
b6802cd506 cmGeneratedFileStream: clang-tidy applied to remove redundant `c_str` calls
After changing the ``cmGeneratedFileStream`` methods to accept
``std::string const&`` instead of ``const char*`` we don't
need to call ``std::string::c_str`` anymore when passing
a ``std::string`` to a ``cmGeneratedFileStream`` method.

This patch removes all redundant ``std::string::c_str``
calls when passing a string to a ``cmGeneratedFileStream`` method.

It was generated by building CMake with clang-tidy enabled using
the following options:

-DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
2018-08-07 17:02:39 +02:00
Muhammad Ismail Soboute
496d22b8cc productbuild: Capture stderr too in CPackProductBuild logs
Stdout and stderr will be merged.

Fixes: #18234
2018-08-06 21:27:51 +10:00
Sylvain Joubert
22fbf39d9b CPack: Fix log typos (spaces in the wrong places) 2018-07-18 17:15:52 +02:00
Lars Schmertmann
f2134169f6 WiX: Add the build directory to IncludeSearchPaths for candle.exe
CPack creates cpack_variables.wxi in the build directory. In the WiX
template it can be used by <?include "cpack_variables.wxi"?> because
the template is configured into main.wxs in the build directory.
Because the extra source files are in the source directory it was necessary to use
<?include "$(sys.CURRENTDIR)_CPack_Packages\win32\WIX\cpack_variables.wxi"?>.
This requires knowledge about the build directory structure and
is avoided by this change by adding the build directory to the IncludeSearchPaths.
2018-07-12 08:48:33 +02:00
Brad King
c4b1c0751d Merge topic 'cpack-external'
4c71548766 Help: Add release notes for CPack External generator
47c87cdd1f Help: Add documentation for CPack External generator
2ef966bc77 Testing: Add test for CPack External generator
80914d88da CPack: Add "CPack External" generator
3ced881db6 cmCPackGenerator: Store CPACK_INSTALL_CMAKE_PROJECTS in an internal field
4938abb600 cmCPackGenerator: Refactor InstallProjectViaInstallCMakeProjects()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2142
2018-07-03 10:55:06 -04:00
Brad King
83db42fa99 Merge topic 'cpack-fix-deb-packaging'
2774259100 CPack/Deb: Restore setting of root as the owner of files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2178
2018-07-03 10:48:03 -04:00
Andrew Fuller
2774259100 CPack/Deb: Restore setting of root as the owner of files
Refactoring in commit v3.10.0-rc1~220^2 (cmCPackDebGenerator: Use
libarchive to create .deb file) accidentally broke this for the
top-level archive.
2018-07-02 13:17:43 -04:00
Kyle Edwards
80914d88da CPack: Add "CPack External" generator
This generator doesn't actually package the files. Instead, it
provides a metadata JSON file that can be used by external packaging
software to do its own packaging. This JSON file provides information
about the components, component groups, installation types, and CMake
projects.
2018-07-02 09:51:02 -04:00
Kyle Edwards
3ced881db6 cmCPackGenerator: Store CPACK_INSTALL_CMAKE_PROJECTS in an internal field
By storing this information in an internal field in the class, it
can be used later on by generators that need it.
2018-07-02 09:51:02 -04:00
Kyle Edwards
4938abb600 cmCPackGenerator: Refactor InstallProjectViaInstallCMakeProjects()
This refactoring will allow cmCPackExtGenerator to skip the install
step while still gathering up information about the CPack components
and groups. Besides, this function was too long, and needed to be
broken up anyway.
2018-07-02 09:51:02 -04:00
Kyle Edwards
48bc8b2b82 CPack: Move internal implementation modules into Internal/CPack directory
These modules are not meant to be included by user code, they are
only an internal implementation detail for CPack. Having them live
in the main Modules directory with documentation was misleading, so
they have been moved into Modules/Internal/CPack, and their
documentation has been stripped following its move into the new
"CPack Generators" section. No-op modules which contained only
documentation have been removed entirely.

The only module that hasn't been moved is CPackIFW, because it
contains user-facing macros which would be lost if it were moved.
So, the CPackIFW module has been updated with a note explaining what
needs to (eventually) happen.
2018-06-21 11:00:28 -04:00
luz.paz
be28106880 Fix misc. typos
Found via `codespell` and `grep`
2018-06-04 10:32:49 -04: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
Alex Turbov
f739752ad6 CPack: Add NuGet support
Create a CPack generator that uses `nuget.exe` to create packages:

    https://docs.microsoft.com/en-us/nuget/what-is-nuget

NuGet packages could be easily produced from a `*.nuspec` file (running
`nuget pack` in the directory w/ the spec file).  The spec filename does
not affect the result `*.nupkg` name -- only `id` and `version` elements
of the spec are used (by NuGet).

Some implementation details:

* Minimize C++ code -- use CMake script do to the job. It just let the
  base class (`cmCPackGenerator`) to preinstall everything to a temp
  directory, render the spec file and run `nuget pack` in it, harvesting
  `*.nupkg` files...;

* Ignore package name (and use default paths) prepared by the base class
  (only `CPACK_TEMPORARY_DIRECTORY` is important) -- final package
  filename is a responsibility of NuGet, so after generation just scan the
  temp directory for the result `*.nupkg` file(s) and update
  `packageFileNames` data-member of the generator;

* The generator supports _all-in-one_ (default), _one-group-per-package_
  and _one-component-per-package_ modes.
2018-05-11 09:28:44 -04:00
Craig Scott
9a8687121f Help: Improve accuracy, readability and cross-referencing of cpack docs
This is primarily a cleanup of the cpack(1) page. The cpack.cxx file
and CPack module were also updated to make the docs relating to
the generator specification and option names consistent in all
three places.
2018-04-28 09:31:42 +10:00
Brad King
ded33659b1 Merge topic 'cpack-trace-nullptr'
6f2701abf6 CPack: Fix crash on invalid generator name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1950
2018-04-11 10:33:48 -04:00
Brad King
6f2701abf6 CPack: Fix crash on invalid generator name
In commit v3.11.0-rc1~68^2 (CPack: accept --trace and --trace-expand,
2017-12-09) a nullptr dereference was added that occurs when
`cpack -G NotAGenerator` is invoked.  Add the needed condition.

Fixes: #17900
2018-04-10 15:00:37 -04:00
Brad King
45408b5ea1 cmake_minimum_required: Optionally set policies with version range
Teach `cmake_minimum_required` and `cmake_policy(VERSION)` to support a
version range of the form `<min>[...<max>]`.  Define this to mean that
version `<min>` is required, but known policies up to those introduced
by `<max>` will be set to `NEW`.  This will allow projects to easily
specify a range of versions for which they have been updated.
2018-03-21 08:00:28 -04:00
Craig Scott
e60e4dfc88 cmWorkingDirectory: Check success of current dir changes 2018-03-08 20:07:14 +11:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03:00
Brad King
92cd3d0677 Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1698
2018-01-29 08:05:27 -05:00
Brad King
f343106b19 Merge topic 'ctest-chrono'
e6a80ccf Make use of std::chrono throughout every component
ff62b005 CTest: add safe conversion from cmDuration to integer types
695951bc CTest: introduce cmDuration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1592
2018-01-26 08:27:37 -05:00
Pavel Solodovnikov
c85bb007df Reduce allocation of temporary values on heap.
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
2018-01-26 13:24:45 +03:00
Brad King
1a9da3c055 Merge topic 'cpack_trace'
93bc5848 CPack: accept --trace and --trace-expand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1583
2018-01-24 08:52:03 -05:00
Wouter Klouwen
e6a80ccfc4 Make use of std::chrono throughout every component
This commit continues the changes made in CTest to support std::chrono
by
applying it throughout every component where a duration was used.

No functional change intended.
2018-01-23 18:56:42 +00:00