summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cpack.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'cmake-E-cat-binary' into release-3.19Brad King2020-10-151-19/+14
|\ | | | | | | | | | | | | | | | | f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows 90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5364
| * cmConsoleBuf: Factor out cout/cerr console buffer managementBrad King2020-10-141-10/+5
| |
| * clang-format: Fix include block order in ctest.cxx and cpack.cxxBrad King2020-10-141-9/+9
| |
* | cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-15/+16
|/
* Restore handling of build directory inside a symlinked pathBrad King2020-07-021-1/+1
| | | | | | | | | | | | | | | In commit dd8365b3f1 (Merge branch 'upstream-KWSys' into update-kwsys, 2020-04-06, v3.18.0-rc1~397^2) we imported KWSys commit `019afb6ea` (SystemTools: Drop GetCurrentWorkingDirectory 'collapse' argument, 2020-04-03). That caused `GetCurrentWorkingDirectory` to no longer send paths through the KWSys translation map and broke CMake's detection of the absolute path to a build directory containing a symbolic link. Add our own `cmSystemTools::GetCurrentWorkingDirectory` wrapper around the KWSys method in order to restore that mapping. Test-case-by: Ben Boeckel <ben.boeckel@kitware.com> Issue: #16228 Fixes: #20900
* replace std::string::substr() with operations that do not allocate memoryRolf Eike Beer2020-03-231-1/+1
| | | | | Modify the original string instead of creating a new copy with substr() when it is not used for anything else afterwards.
* Windows: Restore suppression of error report popups in CI buildsBrad King2019-11-151-1/+0
| | | | | | | | | | | | | On Windows, libuv uses `_CrtSetReportHook` to install a handler it uses to suppress assertions on invalid file descriptors in `_get_osfhandle`. This removes the handler we install in CI environments to suppress interactive popups. Move installation of our handler to after libuv is initialized so that our handler is actually used. Unfortunately this also removes libuv's handler and so may cause Debug builds under CI to abort on invalid file descriptors instead of simply converting them to `INVALID_HANDLE_VALUE`. If this becomes a problem we may need to modify libuv to make its hook more configurable.
* CPack: Ensure CPACK_PACKAGE_DIRECTORY is an absolute pathJohnny Jazeix2019-11-011-1/+7
| | | | Fixes: #18133, #19412
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-3/+3
| | | | | 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.
* cmCPackGeneratorFactory: rule of zeroTushar Maheshwari2019-09-171-2/+3
|
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-1/+1
| | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-1/+1
|
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+1
| | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* cpack.cxx: Re-order include blocks to follow our conventionsBrad King2019-08-201-14/+15
|
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-1/+2
|
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-2/+2
|
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-12/+9
| | | | | | | | | | | | | | | | 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.
* Merge topic 'cleanup-statics-stream-flush'Craig Scott2019-07-131-4/+6
|\ | | | | | | | | | | | | | | | | | | af75ab7645 Refactor: Use anonymous namespace instead of `static`s in `cpack.cxx` 0db458a0ce Refactor: Use anonymous namespace instead of `static`s 0328b64efd Refactor: Remove one-time used macros b821f9ad62 Refactor: Optimize some stream output operations Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3535
| * Refactor: Use anonymous namespace instead of `static`s in `cpack.cxx`Alex Turbov2019-07-091-4/+6
| | | | | | | | Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
* | IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+0
|/ | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Ensure stdin, stdout, and stderr pipes are always openBrad King2019-05-021-0/+1
| | | | | | | | | | | | | On non-Windows platforms libuv assumes that file descriptors 0-2 are always used for standard pipes and never for anything else. Otherwise, libuv may re-use one of these descriptors and then fail an assertion when closing it. Similarly, On Windows platforms our ConsoleBuf implementation assumes that the standard handles are always open. If CMake is run with any standard pipes closed, open them with `/dev/null` or `NUL` to satisfy these assumptions. Fixes: #19219
* Modernize: Prefer .substr in place of .c_str() + intArtur Ryt2019-03-301-1/+1
| | | | | | A lot of temporary/local strings were created out of C-strings substr can utilize current string size, so in theory be a little more efficient.
* cmake: Progress functions use `std::string` paramVitaly Stakhovsky2019-02-111-1/+1
|
* Use `std::function` for callbacksRegina Pfeifer2019-01-291-6/+2
|
* cmMakefile::ReadListFile() accepts std::string argumentVitaly Stakhovsky2019-01-171-3/+3
| | | | Same for cmMakefile::ReadDependentFile(); some cleanup
* Properties: Add CMAKE_ROLE global propertyKyle Edwards2019-01-171-1/+2
| | | | | This property allows scripts to determine whether they're in project mode, script mode, find-package mode, CTest, or CPack.
* Merge topic 'cpack-status-callback'Brad King2018-12-101-0/+10
|\ | | | | | | | | | | | | 4a3ae1710e CPack/External: Fix status messages of staging scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2696
| * CPack/External: Fix status messages of staging scriptsNils Gladitz2018-12-071-0/+10
| | | | | | | | | | | | | | | | 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
* | cpack: When given an unknown generator print out all valid generatorsRobert Maynard2018-11-091-1/+14
| | | | | | | | This makes cpack behavior match cmake when passed an invalid generator
* | cpack: Better error message when generator doesn't exist.Robert Maynard2018-11-081-2/+3
|/ | | | | | Currently the CPack error message when passed an invalid generator name reads like the generator failed to work, rather than the name was invalid.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-7/+9
| | | | | | | | | | | | 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.
* Help: Improve accuracy, readability and cross-referencing of cpack docsCraig Scott2018-04-271-9/+11
| | | | | | 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.
* CPack: Fix crash on invalid generator nameBrad King2018-04-101-4/+4
| | | | | | | | 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
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * 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.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Merge topic 'cpack_trace'Brad King2018-01-241-0/+20
|\ | | | | | | | | | | | | 93bc5848 CPack: accept --trace and --trace-expand Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1583
| * CPack: accept --trace and --trace-expandIsaiah Norton2018-01-231-0/+20
| |
* | Extend libuv file translate mode workaround to all executablesBrad King2018-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cpack: Enable MSVC debug hook earlierBrad King2018-01-231-2/+1
|/ | | | | All other executables do this just after console and command-line encoding conversion. Do the same in CPack.
* cpack: Fix compilation on Cygwin after auto_ptr removalBrad King2017-09-271-1/+1
| | | | | Fix a compilation error on Cygwin introduced by commit f0489856e3 (Retire std::auto_ptr and its macro CM_AUTO_PTR, 2017-09-21).
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-27/+25
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* CPack: Add missing check for CPACK_INSTALL_SCRIPT variableAlex Turbov2017-09-201-1/+2
| | | | | | | Also add a test case that uses CPACK_INSTALL_SCRIPT. Co-Author: Domen Vrankar <domen.vrankar@gmail.com> Fixes: #15005
* Merge topic 'ranged-for'Brad King2017-09-191-12/+6
|\ | | | | | | | | | | | | f43baf69 Meta: modernize old-fashioned loops to range-based `for` (CPack). Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1274
| * Meta: modernize old-fashioned loops to range-based `for` (CPack).Pavel Solodovnikov2017-09-191-12/+6
| | | | | | | | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* | Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-1/+1
|/
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-6/+6
|
* cmState: remove RemoveUnscriptableCommandsDaniel Pfeifer2017-05-081-2/+0
|