summaryrefslogtreecommitdiffstats
path: root/Source/cmExportCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gateBrad King2024-03-121-4/+13
| | | | | | | Some design concerns have been raised after trying the 3.29 release candidates. Avoid committing to a stable public interface for now. Issue: #25767
* Merge topic 'cmFileCopier-error-loss'Brad King2023-12-051-7/+5
|\ | | | | | | | | | | | | | | | | | | a820877d03 errors: avoid constructing a stream before getting the last error 5cf7018af6 cmFileCopier: remember error statuses and get their strings 0639a32d3a cmFileTimes: return status codes from APIs Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9023
| * errors: avoid constructing a stream before getting the last errorBen Boeckel2023-12-021-7/+5
| | | | | | | | | | Constructing a stream may involve operations that change the global error state. Avoid the streams by using `cmStrCat` instead.
* | install(EXPORT): Add ability to point to .xcframework fileKyle Edwards2023-11-151-1/+29
| | | | | | | | Issue: #25262
* | cmExportBuildFileGenerator: Add structs for target exportsKyle Edwards2023-11-141-2/+2
| |
* | install(EXPORT): Export find_dependency() callsKyle Edwards2023-11-131-1/+73
|/ | | | | | Issue: #20511 Co-Authored-by: Brad King <brad.king@kitware.com> Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
* cmExperimental: remove the flag for C++ modulesBen Boeckel2023-10-021-10/+5
| | | | | | | All the major compilers now have scheduled releases with support for scanning, so remove the experimental gate. Fixes: #18355
* cmCryptoHash: prefer to cmSystemTools::ComputeStringMD5Ben Boeckel2023-08-081-1/+3
| | | | | | | The latter call is no longer post-bootstrap only since 596439b1bb (cmCustomCommandGenerator: Add option to transform depfile, 2020-10-05) via !5325. Convert callers to just use `cmCryptoHash` directly and remove the bootstrap guard.
* cmArgumentParser: Model maybe-empty and non-empty lists with wrapper typesBrad King2022-07-071-1/+2
| | | | | | | | Previously bindings to `std::vector<std::string>` required at least one value. Some clients have been filtering `keywordsMissingValue` to support keywords followed by empty lists. Instead, require clients to specify whether a keyword's list can be empty as part of the binding type.
* exports: support `CXX_MODULES_DIRECTORY`Ben Boeckel2022-07-061-0/+9
| | | | | | | | | | | | This directory will be used to store build-discovered information about targets such as the modules provided by the files in the relevant `FILE_SET` types. A directory is used because basing the name on a `<FILE_NAME>-*.cmake` pattern makes it end up being globbed in the configuration-dependent information mechanism. Since old modules and targets may be around, unconditionally including them may refer to targets that do not actually exist.
* cmExportCommand: Use cm::optional for keyword argument presenceBrad King2022-07-051-9/+5
|
* cmArgumentParser: Avoid allocating copies of keyword stringsBrad King2022-07-051-1/+2
|
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-0/+1
|
* cmMakefile: Refactor API to better handle empty config valuesRobert Maynard2020-07-031-5/+3
|
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
|
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-2/+2
|
* export(): raise an error on multiple calls with same FILEMarc Chevrier2020-03-261-0/+23
| | | | Fixes: 20472
* export: Fix use-after-free on multiple calls overwriting same FILEBrad King2020-03-191-3/+3
| | | | | | | | | | | | | | | | | | | | | CMake 3.16 and below allow multiple `export()` calls with the same output file even without using `APPEND`. The implementation worked by accident by leaking memory. Refactoring in commit 5444a8095d (cmGlobalGenerator: modernize memrory managemenbt, 2019-12-29, v3.17.0-rc1~239^2) cleaned up that memory leak and converted it to a use-after-free instead. The problem is caused by using the `cmGlobalGenerator::BuildExportSets` map to own `cmExportBuildFileGenerator` instances. It can own only one instance per output FILE name at a time, so repeating use of the same file now frees the old `cmExportBuildFileGenerator` instance and leaves the pointer in the `cmMakefile::ExportBuildFileGenerators` vector dangling. Move ownership of the instances into `cmMakefile`'s vector since its entries are not replaced on a repeat output FILE. In future work we should introduce a policy to error out on this case. For now simply fix the use-after-free to restore CMake <= 3.16 behavior. Fixes: #20469
* cmGlobalGenerator: modernize memrory managemenbtMarc Chevrier2019-12-301-6/+8
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-3/+4
| | | | | 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.
* cmExportCommand: Port away from cmCommandRegina Pfeifer2019-09-211-48/+55
|
* cmExportSet: subsume cmExportSetMap source filesTushar Maheshwari2019-09-191-2/+1
|
* cmExportSetMap: improve ownership of cmExportSetTushar Maheshwari2019-09-191-5/+5
| | | | | - use `std::piecewise_construct` to fix gcc-4.8 build. - can use `emplace(name, name)` gcc-6 onwards.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-5/+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)`
* cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-4/+2
| | | | Also, use the new function where applicable.
* export: Restore support for empty TARGETS listBrad King2019-06-251-2/+9
| | | | | | | | | Refactoring in commit f5acecaa6f (cmExportCommand: Port to cmArgumentParser, 2019-03-23, v3.15.0-rc1~270^2~3) broke the `export` command's support for specifying `TARGETS` with no entries. Fix it and add a test case. Fixes: #19415
* cmExportCommand: Port to cmArgumentParserRegina Pfeifer2019-04-041-54/+48
|
* export: Disable PACKAGE mode user package registry by defaultRobert Maynard2019-03-151-4/+18
| | | | | | | The user package registry populated by the `export()` command causes side effects outside the build and source directories. Such effects should be opt-in rather than op-out. Introduce a policy to change default behavior of `export(PACKAGE)` to do nothing.
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-3/+3
| | | | Reduce the number of files relying on `cmake.h`.
* clang-tidy: Remove redundant member initializationsRegina Pfeifer2018-12-151-3/+1
|
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-3/+3
|
* Merge topic 'cleanup-find-cstr'Brad King2018-08-091-1/+1
|\ | | | | | | | | | | | | 69ca85cc7f Remove unnecessary c_str() in RegularExpression::find calls Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2271
| * Remove unnecessary c_str() in RegularExpression::find callsVitaly Stakhovsky2018-08-071-1/+1
| |
* | cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-1/+1
|/ | | | | | | | | | | | | | | 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
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-6/+6
| | | | | | | | | | | | 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.
* install,export: Maybe transform OBJECT libraries to INTERFACE librariesBrad King2018-02-281-11/+0
| | | | | | | | | | | Teach the `install` and `export` commands to support installing and exporting `OBJECT` libraries without their object files. Transform them to `INTERFACE` libraries in such cases. For `install(TARGETS)`, activate this when no destination for the object files is specified. For `export`, activate this only under Xcode with multiple architectures when we have no well-defined object file locations to give to clients.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-4/+4
| | | | | | | | | | * 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.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-14/+10
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-4/+4
|
* Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-181-5/+9
| | | | | | | | Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* fix include order of windows.hDaniel Pfeifer2017-03-141-1/+0
| | | | | | Comments that indicate a special include order is necessary because GetCurrentDirectory might get redefined are outdated. Remove those outdated comments and use the normal ordering of includes.
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+1
|
* Separate compilation for commands included in cmCommandsDaniel Pfeifer2016-10-211-5/+13
|
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-2/+2
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Avoid else after returnDaniel Pfeifer2016-09-161-1/+2
|
* Add support for creating prebuilt Android.mk filesBill Hoffman2016-09-131-3/+15
| | | | | | | | | | | Add options to the `install()` and `export()` commands to export the targets we build into Android.mk files that reference them as prebuilt libraries with associated usage requirements (compile definitions, include directories, link libraries). This will allow CMake-built projects to be imported into projects using the Android NDK build system. Closes: #15562
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-3/+2
|