summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Work around clang-cl breakage on make_unique/std::forwardZsolt Parragi2019-02-111-1/+2
| | | | | | | Clang on Windows with the MSVC ABI produces link errors of the form `unresolved std::_Iosb<int>::{app,_Openmode} in ...`. Use a temporary variable to forward as lvalue rather than rvalue to work around the problem.
* cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-1/+1
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-9/+10
| | | | Reduce the number of files relying on `cmake.h`.
* clang-tidy: fix warnings from version 7Regina Pfeifer2018-11-201-1/+1
| | | | | Fix some warnings that are new since clang-tidy version 4, and update `.clang-tidy` to suppress the rest.
* CSharp: Fix regression in VS project type selection for custom targetBrad King2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | A target created by `add_custom_target` should always be a `.vcxproj` file even if it has `.cs` sources involved in custom commands and such. The latter case was broken by refactoring in commit v3.12.0-rc1~160^2~7 (remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget, 2018-03-19). The reason is that the `HasLanguage` method added by commit v3.12.0-rc1~239^2~6 (cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages(), 2018-03-19) does not check the target type and so is not a suitable check for deciding the project file extension. The `HasLanguage` method was an attempt at an abstraction that turns out not to work very well. Replace it with a dedicated `IsCSharpOnly` method that considers the target type, sources, and non-transitive `LINKER_LANGUAGE`. Fixes: #18515
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-0/+31
| | | | | | | | | | | | These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
* Merge topic 'getsafedef-stdstring'Brad King2018-09-181-1/+1
|\ | | | | | | | | | | | | f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2350
| * cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-1/+1
| |
* | cmExportFileGenerator: Use cmGeneratorTarget::ResolveTargetReferenceBrad King2018-09-121-2/+7
|/ | | | Avoid calling `FindGeneratorTargetToUse` directly.
* cmLinkItem: Convert to a "sum type" over a string and target pointerBrad King2018-09-071-1/+11
| | | | | | | | | Avoid exposing the item name implicitly as std::string. When the item is a target, avoid storing a second copy of its name. Most link item construction is paired with calls to `FindTargetToLink` to get the possible target pointer. Rename these methods to `ResolveLinkItem` and refactor them to construct the entire item.
* Merge topic 'export-properties-undefined'Craig Scott2018-08-181-0/+5
|\ | | | | | | | | | | | | | | dbd3e2c53d EXPORT_PROPERTIES: Prevent null dereference for undefined property b88bf6796e EXPORT_PROPERTIES: Add test for an undefined property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2294
| * EXPORT_PROPERTIES: Prevent null dereference for undefined propertyCraig Scott2018-08-161-0/+5
| | | | | | Fixes: #18260
* | 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
* | LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDSMarc Chevrier2018-06-271-0/+31
|/ | | | Fixes: #17997
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-4/+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.
* cmExportFileGenerator: set IMPORTED_COMMON_LANGUAGE_RUNTIME for CSharp targetMichael Stürmer2018-04-231-2/+7
|