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

783 Commits

Author SHA1 Message Date
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
Isaiah Norton
93bc5848e7 CPack: accept --trace and --trace-expand 2018-01-23 13:15:53 -05:00
Brad King
98628de812 Extend libuv file translate mode workaround to all executables
Since libuv commit v1.14.1~7 (win: add uv__once_init() calls,
2017-08-30) the libuv initialization of the file translate mode may take
place even if we do not use a uv loop.  This change was included in our
libuv update commit f4a26c748b (libuv 2018-01-19).  Therefore use of
libuv even through `cmSystemTools::GetRealPath` in any executable may
trigger its file translate mode setting.

Factor out the logic added to `cmake.exe` by commit v3.9.0-rc4~10^2
(cmake: Fix default file translate mode when using libuv, 2017-06-13)
and re-use to initialize all executables.

Issue: #16962
2018-01-23 09:29:07 -05:00
Brad King
3b588ac582 cpack: Enable MSVC debug hook earlier
All other executables do this just after console and command-line
encoding conversion.  Do the same in CPack.
2018-01-23 09:27:30 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
Jean-Philippe Lebel
739ae1d090 CPack/IFW: Add option to control deletion of the install directory
Added support for QT IFW "RemoveTargetDir" boolean option.  QTIFW
supports an option to prevent, or not, deletion of the installation
directory. This is a direct pass-through to that variable.
2017-12-15 13:24:58 -05:00
Domen Vrankar
93d5f464cc CPack: enable all CMake policies for generator scripts 2017-12-09 12:50:28 +01:00
Brad King
d8290531a9 Merge topic 'cpack-pkg-fix'
f25d87db CPack: Fix macOS PKG component dependency information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1547
2017-12-04 10:50:33 -05: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
Domen Vrankar
7e896029cd CPack: enable setting default dir creation permissions
Introduces CPACK_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS
variable which adds support for functionality introduced
by CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS variable.

Fixes #17333

# Conflicts:
#	Help/release/dev/cmake-default-dir-install-permissions.rst
2017-11-08 20:27:11 +01: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
9de7ae6e5e Merge topic 'cpack-wix-cygwin'
e1409101 cpack wix: support WiX generator on Cygwin
e258fe03 cpack wix: fix path error on cygwin

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1367
2017-10-16 09:48:02 -04:00
Stephen Sorley
e1409101c9 cpack wix: support WiX generator on Cygwin
Cygwin-built CMake now converts paths from Cygwin to Windows form
(using cygpath -w) before they're passed to WiX.

The Wix generator on Cygwin requires the libuuid-dev package when
building CMake. However, the DLL it links to is installed by default
as part of Cygwin's core libs, so it does not need to be distributed.

If libuuid-dev isn't available, CMake is simply built without Wix
support on Cygwin.
2017-10-13 13:07:37 -04:00
Clinton Stimpson
1943dc6bd5 cmCPackDragNDropGenerator: Improve error reporting
When running hdiutil and other commands, capture errors and log them.
2017-10-11 20:40:59 -06:00
Brad King
4f2a983c21 CPack: Fix PackageMaker .dmg HFS+ creation on macOS APFS hosts
When running `hdiutil create`, specify the HFS+ filesystem explicitly.
Otherwise `hdiutil` may choose a filesystem based on the host.  We do
not want to create APFS images for `.dmg` packages because they may not
mount on macOS versions prior to 10.12.

This was missed in commit 39b50975d9 (CPack: Fix .dmg HFS+ creation on
macOS APFS hosts, 2017-10-02).

Reported-by: Alan Garny
2017-10-05 10:33:13 -04:00
Brad King
39b50975d9 CPack: Fix .dmg HFS+ creation on macOS APFS hosts
When running `hdiutil create`, specify the HFS+ filesystem explicitly.
Otherwise `hdiutil` may choose a filesystem based on the host.  We do
not want to create APFS images for `.dmg` packages because they may not
mount on macOS versions prior to 10.12.
2017-10-02 10:09:37 -04:00
Rolf Eike Beer
ec30129b41 CPack: put local variable on the stack 2017-09-29 21:11:53 +02:00
Brad King
e24e0ff6fa Merge topic 'clang-tidy'
77f674be Fix some occurrences of readability-braces-around-statements
f0bab294 Convert some leftover loops to C++11 range-based loop
b5d7f5b0 Fix occurrences of readability-non-const-parameter
9a2da339 Fix some occurrences of readability-avoid-const-params-in-decls
870dd06d Fix left-over occurrences of else-after-return
2033abff Fix minor clang-tidy findings
79b8c380 Improve several occurrences of vector::push_back in loops
a45928cd Fix some occurrences of missing override keywords
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1292
2017-09-29 08:48:16 -04:00
Matthias Maennich
77f674be35 Fix some occurrences of readability-braces-around-statements
Fix issues diagnosed by clang-tidy [readability-braces-around-statements]

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:43 -04:00
Matthias Maennich
f0bab294dc Convert some leftover loops to C++11 range-based loop
Fix issues diagnosed by clang-tidy [modern-loop-convert]

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:43 -04: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
2033abff0d Fix minor clang-tidy findings
Fix issues diagnosed by clang-tidy
 - modernize-use-bool-literals
 - misc-string-integer-assignment
 - performance-faster-string-find
 - readability-redundant-string-cstr
 - readability-delete-null-pointer

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:42 -04:00
Matthias Maennich
b128f8c5bc Clean up some C-Style casts
Fix issues diagnosed by clang-tidy [google-readability-casting]

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:41 -04:00
Matthias Maennich
bb0ad1bea8 Fix some occurrences using string by value rather than by const&
Fix issues diagnosed by clang-tidy
 - performance-unnecessary-value-param
 - performance-unnecessary-copy-initialization

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:40 -04:00
Brad King
94e67fa118 cpack: Fix compilation on Cygwin after auto_ptr removal
Fix a compilation error on Cygwin introduced by commit f0489856e3
(Retire std::auto_ptr and its macro CM_AUTO_PTR, 2017-09-21).
2017-09-27 09:04:28 -04:00
Matthias Maennich
f0489856e3 Retire std::auto_ptr and its macro CM_AUTO_PTR
Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-26 00:07:19 +02:00
Brad King
62bdc587eb Merge topic 'cpackifw-options'
9a24ab6b CPackIFW: Add some options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1298
2017-09-25 08:58:25 -04:00
Brad King
00389afa34 Merge topic 'string-empty'
37d9387b Replace empty-string comparisons with checking against `empty()`.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1275
2017-09-22 10:11:23 -04:00