summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallExportGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmExport*FileGenerator: support exporting C++ module propertiesBen Boeckel2022-07-061-0/+69
| | | | | C++ module properties will be generated at build time, so generate code that includes the files actually responsible for the information.
* exports: support `CXX_MODULES_DIRECTORY`Ben Boeckel2022-07-061-1/+3
| | | | | | | | | | | | 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.
* Merge topic 'file-set-crash'Brad King2022-06-301-2/+1
|\ | | | | | | | | | | | | 3fee5398bd install(EXPORT): Check for missing file sets at generate time Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7420
| * install(EXPORT): Check for missing file sets at generate timeKyle Edwards2022-06-291-2/+1
| | | | | | | | | | | | | | | | | | | | Missing file sets were originally checked at configure time in install(TARGETS ... EXPORT), but were not checked at generate time. If a file set was added after install(TARGETS ... EXPORT) was called, an abortion error was thrown. Check again at generate time to gracefully display an error message instead of crashing. Fixes: #23680
* | clang-tidy: address `modernize-use-default-member-init` lintsBen Boeckel2022-05-241-1/+0
| |
* | cmInstallExportGenerator: expose the temporary directoryBen Boeckel2022-04-281-57/+19
| | | | | | | | | | | | | | | | | | | | | | | | This needs to be known so that C++ module properties for the install can be staged beside the other files. Always perform the MD5 transformation (in non-bootstrap builds) so that the path can be computed prior to generation (where it used the longest configuration name to detect too-long paths). Update tests to expect the always-present MD5 value. Note that this improves robustness of the test suite as testing in a too-long path may have triggered the MD5 conversion anyways.
* | generated-scripts: improve prose messages with CMake listsBen Boeckel2022-04-201-1/+3
| | | | | | | | | | | | Instead of printing a CMake list, make it an English-style list. This also allows the line-break algorithm to make these messages much more readable.
* | generated-scripts: unset used variablesBen Boeckel2022-04-201-0/+2
| |
* | generated-cmake: use `_cmake_` prefixes for local variablesBen Boeckel2022-04-201-6/+6
| | | | | | | | This avoids stomping on any user variables.
* | cmConstStack: Factor out of cmListFileBacktraceBrad King2022-04-021-0/+1
|/ | | | | | | This presents value semantics for a stack of constant values. Internally it shares ownership to avoid copies. Previously this was implemented by `cmListFileBacktrace` explicitly, but the approach can be re-used for other kinds of stacks.
* bootstrap: Do not declare cmSystemTools functions that are not implementedBrad King2021-10-271-0/+2
| | | | Convert runtime error messages into compile-time errors.
* Refactor: Move common methods into cmInstallGeneratorKyle Edwards2021-05-311-3/+2
|
* install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTSNils Gladitz2021-05-191-1/+1
| | | | | | | | | | | In a per-component installation the generated installation scripts are invoked once for each component. Per default custom installation script code added by install(CODE|SCRIPT) only runs for one specific component in this context. The new ALL_COMPONENTS option allows custom script code to be run once for each component being installed.
* cmInstallGenerator: Add backtrace to all install generatorsBrad King2021-01-281-2/+3
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-3/+3
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Modernize memory managementMarc Chevrier2020-02-271-6/+5
| | | | Update internals of various classes
* cmInstallGenerator: std::string paramsVitaly Stakhovsky2020-01-211-2/+2
| | | | | Several construction parameters converted to std::string Also made a few class members const
* cmInstall*Generator: std::string paramsVitaly Stakhovsky2020-01-211-9/+9
| | | | | Several construction parameters converted to std::string Also made a few class members const
* cmExportSet: default destructorTushar Maheshwari2019-09-191-1/+1
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* Merge topic 'double-export-error-message-install'Brad King2019-08-211-0/+5
|\ | | | | | | | | | | | | | | d17580909f cmExportInstallFileGenerator: improve error message a18100898a cmInstallExportGenerator: add a method for the file destination Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3703
| * cmInstallExportGenerator: add a method for the file destinationBen Boeckel2019-08-191-0/+5
| | | | | | | | | | This will be used in the error message which remarks about a target being exported ambiguously into different installations.
* | avoid adding multiple consecutive string literals to std::stringRolf Eike Beer2019-08-181-2/+1
|/ | | | While at it change some single character additions to be of type char.
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-2/+2
|
* Refactor: Allow cmInstallGenerator::Compute() to return an errorKyle Edwards2019-05-131-1/+2
| | | | | | This is preparation for an upcoming merge request, which will add a new cmInstallGenerator that returns false if there are errors in the Compute() step.
* Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-1/+1
|
* Merge topic 'cmake-files-directory'Brad King2019-01-251-2/+1
|\ | | | | | | | | | | | | | | 3e867ed400 cmake: inlined files dir constant and removed it from cmake.h Acked-by: Kitware Robot <kwrobot@kitware.com> Rejected-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2655
| * cmake: inlined files dir constant and removed it from cmake.hBruno Manganelli2019-01-211-2/+1
| |
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-1/+1
|/
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-0/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-1/+1
| | | | | | | | | | | | 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.
* 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.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-15/+8
| | | | | | 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-5/+5
|
* cmScriptGenerator: pass Indent by valueDaniel Pfeifer2017-04-211-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.
* Add support for creating prebuilt Android.mk filesBill Hoffman2016-09-131-2/+11
| | | | | | | | | | | 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
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-10/+8
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-2/+1
|
* install(EXPORT): Fix support for mid-length install destinations on WindowsBrad King2016-08-091-2/+25
| | | | | | | | | | | | The implementation of `install(EXPORT)` generates files into a staging directory for later installation. We use the full install destination in the path to the staging directory to avoid collisions. In order to avoid exceeding maximum path lengths (especially on Windows) we compute a hash of the install destination when it is too long. Fix this logic to account for the length of the file name(s) when deciding whether to switch to the hashed name. Reported-by: Alan W. Irwin <irwin@beluga.phys.uvic.ca>
* use CM_NULLPTRDaniel Pfeifer2016-06-281-4/+5
|
* Use std::replace for replacing chars in strings.Daniel Pfeifer2016-05-241-2/+2
| | | | | | | | | | | Find uses of `cmSystemTools::ReplaceString` where both `replace` and `with` are string literals with a size of one. Automate with: git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\2', '\3');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\\\\\\\\\");|std::replace(\1.begin(), \1.end(), '\2', '\\\\\\\\');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\\\\\\\\\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\\\\\\\\', '\2');|g"
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-78/+48
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* install: Add EXCLUDE_FROM_ALL option (#14921)Nick Lewis2016-02-041-1/+3
| | | | | | | | | | | | | | | | | | | Let us take an example of a project that has some tests in a component that need to be installed into a dedicated test package. The user expectation is that the result could be achieved by typing the following: make make tests make install DESTDIR=/testpkgs make install-tests However this results in test components in the default installation as well as the testpkg. Add an EXCLUDE_FROM_ALL option to the install() command to tell it that the installation rule should not be included unless its component is explicitly specified for installation.
* cmExportSet: Store a cmGeneratorTarget.Stephen Kelly2015-10-181-0/+1
| | | | Set the member at compute time from the stored name.
* cmLocalGenerator: Add current binary directory accessor.Stephen Kelly2015-10-101-1/+1
|
* cmInstallExportGenerator: Require cmLocalGenerator, not cmMakefile.Stephen Kelly2015-08-231-4/+9
|