summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'restore-target-export-includes'Brad King2022-02-101-2/+3
|\ | | | | | | | | | | | | | | 83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6969
| * install(TARGETS): Restore per-export INCLUDES DESTINATIONEugene Shalygin2022-02-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 55e4753bbb (Refactor cmTargetExport removing InterfaceIncludeDirecories, 2021-07-20, v3.22.0-rc1~337^2~1) the storage of `INCLUDES DESTINATION` was moved into each target. However, a target may be installed in multiple exports, and their `INCLUDES DESTINATION` should not be mixed. Convert the IncludeDirectoriesEntries vector to a map and modify access function to store the directories lists with respect to cmExportTarget object. This fixes error when the same target is exported more than once via different exports and each for consequent export its include directories list grows. Add a test for this case. Fixes: #23183
* | Merge topic 'post-rel-dev'Brad King2022-02-041-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 9a48012f93 Configure CMake itself with policies through CMake 3.22 a5a9687799 export: Increase maximum policy version in exported files to 3.22 a9ffded98c Add deprecation warnings for policies CMP0097 and below Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6948
| * | export: Increase maximum policy version in exported files to 3.22Brad King2022-02-031-2/+2
| | | | | | | | | | | | | | | | | | The files generatd by `install(EXPORT)` and `export()` commands are known to work with policies as of CMake 3.22, so enable them in sufficiently new CMake versions.
* | | Replace DEVEL_CMAKE_VERSION with literal 3.23 release versionBrad King2022-02-041-2/+1
|/ / | | | | | | | | | | This was accidentally left out of commit 736663deed (Begin 3.23 release versioning, 2022-02-03). The step is documented as part of the release branching process in the CMake Maintainer Guide `Help/dev/maint.rst`.
* | Add usage requirements to update direct link dependenciesBrad King2022-01-291-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Link line construction starts with `LINK_LIBRARIES` and appends dependencies from the transitive closure of `INTERFACE_LINK_LIBRARIES`. Only the entries of `LINK_LIBRARIES` are considered direct link dependencies. In some advanced use cases, particularly involving static libraries and static plugins, usage requirements need to update the list of direct link dependencies. This may mean adding new items, removing existing items, or both. Add target properties to encode these usage requirements: * INTERFACE_LINK_LIBRARIES_DIRECT * INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE Fixes: #22496
* | install(EXPORT): Install file setsKyle Edwards2021-10-271-0/+37
| |
* | Source: fix many -Wmissing-prototypes warnings by marking functions staticSean McBride2021-10-251-5/+6
| |
* | export: Propagate IMPORTED_NO_SYSTEM target property to consumersBrad King2021-10-151-0/+6
| | | | | | | | | | | | | | | | | | Enabling `IMPORTED_NO_SYSTEM` on a target built within the project has no effect on the build system, but it is still a useful way to set the property on imported targets generated by `install(EXPORT)` and `export()`. Issue: #17364
* | export: Increase maximum policy version in exported files to 3.21Brad King2021-10-081-2/+2
|/ | | | | | The files generatd by `install(EXPORT)` and `export()` commands are known to work with policies as of CMake 3.21, so enable them in sufficiently new CMake versions.
* Rename cmProp in cmValueMarc Chevrier2021-09-211-15/+15
|
* Config File Gen: When requiring >= 2.6, don't check < 2.5Marcus Müller2021-08-161-1/+1
| | | | | | This seems to be a clear-cut case. Signed-off-by: Marcus Müller <marcus@hostalia.de>
* Refactor export file generator intefaceEugene Shalygin2021-07-221-22/+21
| | | | | Replace cmTargetExport with const cmGeneratorTarget to allow recursive processing of exported targets and their link dependencies.
* Refactor cmTargetExport removing InterfaceIncludeDirecoriesEugene Shalygin2021-07-221-1/+2
| | | | | | | | Because of this property in the cmTargetExport struct, exporting targets is not uniform: top-level ones have to be dealt with via the cmTargetExport objects, while all linked ones are cmGeneratorTarget objects. Let's pass this additional includedirectories via a special target property making handling exported targets uniform.
* export: Increase maximum policy version in exported files to 3.20Brad King2021-06-301-2/+2
| | | | | | The files generatd by `install(EXPORT)` and `export()` commands are known to work with policies as of CMake 3.20, so enable them in sufficiently new CMake versions.
* Source: Remove unnecessary comparisons to nullptrVitaly Stakhovsky2021-05-101-1/+1
|
* export: Increase maximum policy version in exported files to 3.19Brad King2021-02-101-2/+2
| | | | | | The files generatd by `install(EXPORT)` and `export()` commands are known to work with policies as of CMake 3.19, so enable them in sufficiently new CMake versions.
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* export: Fix replacement of multiple TARGET_NAME expressionsBrad King2021-01-051-1/+1
| | | | | | | | After replacing each such expression, search for following expressions immediately after the end of the replacement text, not after the position of the end of the replaced text. Fixes: #21661
* export: Increase maximum policy version in exported files to 3.18Brad King2020-10-131-2/+2
| | | | | | The files generatd by `install(EXPORT)` and `export()` commands are known to work with policies as of CMake 3.18, so enable them in sufficiently new CMake versions.
* install(EXPORT): Fix exporting target w/ source named using CONFIG genexDeniz Bahadir2020-09-221-3/+1
| | | | Fixes: #21203
* cmMakefile: Refactor API to better handle empty config valuesRobert Maynard2020-07-031-2/+3
|
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* Export: Specify a policy range in exported filesCraig Scott2020-05-181-4/+6
| | | | | | | This should reduce policy-related warnings coming from the generated files, but in a way that doesn't increase the minimum CMake version for consumers. Relates: #20561
* cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-29/+28
|
* Refactor: Avoid `std::endl` where it's not necessary (part 1)Alex Turbov2020-03-261-2/+1
| | | | | | | The `std::endl` manupulator, except inserting `\n` character, also performs `os.flush()`, which may leads to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning.
* Merge topic 'prop_t'Brad King2020-03-171-6/+6
|\ | | | | | | | | | | | | 60f57d0dcc cmPropertyMap: Introduce cmProp as return type for GetProperty() functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4471
| * cmPropertyMap: Introduce cmProp as return type for GetProperty() functionsVitaly Stakhovsky2020-03-131-6/+6
| | | | | | | | | | | | | | Currently properties are usually stored internally as `std::string`. However, family of GetProperty() functions return them as `const char *` using `c_str()`. The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties more naturally.
* | Source: Remove trailing whitespace from export generation codeAlexandru Croitor2020-03-131-1/+1
|/
* Source: use std::string in place of const char*Vitaly Stakhovsky2020-01-291-2/+2
|
* target_link_libraries: Fix out-of-dir linking of a list of targetsBrad King2020-01-161-0/+4
| | | | | | | | | | | | | | In a case like target_link_libraries(targetInOtherDir PUBLIC "$<1:a;b>") then all entries in the list need to be looked up in the caller's scope. Previously our `::@(directory-id)` suffix would apply only to the last entry. Instead surround the entire entry by a pair `::@(directory-id);...;::@` so that the `::@` syntax can encode a directory lookup scope change evaluated as the list is processed. Fixes: #20204
* Add set_property option: DEPRECATIONJoseph Snyder2020-01-021-0/+6
| | | | | | | | | | | | Add a new property flag for a target which contains a message regarding deprecation status. Add a warning at "Generate" time if a linked target is marked as deprecated. Expand ExportImport test to ensure that new property is being set and passed correctly. Ensure that the message is shown during the "Generate" step run of the ExportImport test.
* install,export: Do not treat language names as target namesBrad King2019-10-161-13/+18
| | | | | | | When generating `IMPORTED_LINK_INTERFACE_LANGUAGES`, do not treat the entries as target names. Fixes: #19846
* install,export: Fix export of a genex following $<INSTALL_PREFIX>Brad King2019-10-041-3/+3
| | | | | | | | | The relative path check added by commit 5838aba1aa (Export: Report error on relative include with genex., 2013-11-26, v3.0.0-rc1~285^2) was added one condition too early. If the value starts in `${_IMPORT_PREFIX}` (which comes from `$<INSTALL_PREFIX>`) then it is an absolute path. Fixes: #19791
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-8/+9
| | | | | 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.
* cmGeneratorExpression: Move quiet flag to cmCompiledGeneratorExpressionDaniel Eiband2019-09-221-1/+1
| | | | | | The quiet flag is false for all but one call to Evaluate. Make the quiet flag a setter of cmCompiledGeneratorExpression to be able to remove it from the Evaluate function signature.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-1/+1
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* Merge topic 'source_sweep_ostringstream_single'Brad King2019-08-261-3/+1
|\ | | | | | | | | | | | | 3b2b02825d Source sweep: Replace std::ostringstream when used with a single append Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3726
| * Source sweep: Replace std::ostringstream when used with a single appendSebastian Holtermann2019-08-231-3/+1
| | | | | | | | | | | | | | This replaces `std::ostringstream`, when it is written to only once. If the single written argument was numeric, `std::to_string` is used instead. Otherwise, the single written argument is used directly instead of the `std::ostringstream::str()` invocation.
* | 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-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-2/+2
|
* Cleanups: Use cmHas{Prefix,Suffix} instead of String{Starts,Ends}WithSebastian Holtermann2019-08-011-2/+2
|
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | 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.
* cmPropertyMap: Use std::string as value container classSebastian Holtermann2019-06-081-1/+0
|
* cmPropertyMap: Make std::map container privateSebastian Holtermann2019-06-081-6/+3
|