summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'backport-cxxmodules-export-file-collisions'Brad King2024-01-181-6/+9
|\
| * cxxmodules: make export trampoline script files uniqueBen Boeckel2024-01-181-6/+9
| | | | | | | | | | | | | | | | | | | | | | Include the name of the `EXPORT` in the filename when generating export information for C++ modules. This allows the same directory to be used for multiple sets of C++ module-using targets. For `export(TARGETS)` uses, generate a name based on the hash of the concatenation of the target names involved with the `export()` call. Fixes: #25609
* | install(EXPORT): Add ability to point to .xcframework fileKyle Edwards2023-11-151-3/+20
| | | | | | | | Issue: #25262
* | cmExportFileGenerator: Add function to set required CMake versionKyle Edwards2023-11-131-14/+3
|/
* cxxmodules: include `INCLUDES DESTINATION` directoriesBen Boeckel2023-10-161-2/+4
| | | | | | | These paths are added outside the normal property management mechanisms. Shuttle the value to the C++ module export as needed. Fixes: #25289
* cmExportFileGenerator: export private compile info for C++ modulesBen Boeckel2023-08-171-0/+7
| | | | | | | | | When consuming exported targets which contain C++ modules, the consuming project must be able to recompile BMI files using the original target's flags. This is because a module source may use some private target usage requirement but not want to propagate it to consumers. To facilitate this, export the private information as necessary for consumers to be able to perform the BMI compilations.
* strings: use `emplace_back` with `cmStrCat` argumentsBen Boeckel2023-07-281-2/+2
|
* Merge topic 'export-file-set-absolute-cmake-install-includedir'Brad King2023-06-231-9/+14
|\ | | | | | | | | | | | | | | 70f36de1e5 File set: Allow absolute CMAKE_INSTALL_INCLUDEDIR Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8577
| * File set: Allow absolute CMAKE_INSTALL_INCLUDEDIRKyle Edwards2023-06-201-9/+14
| | | | | | | | | | | | | | | | | | When install(TARGETS) and install(EXPORT) were called with file sets and an absolute CMAKE_INSTALL_INCLUDEDIR, "${_IMPORT_PREFIX}/" was still being prepended to the base directory and files, resulting in incorrect paths. Don't prepend this when absolute paths are used. Fixes: #25010
* | cmList: Add container conversion to stringMarc Chevrier2023-06-221-1/+2
|/
* cxxmodules: remove support for `CXX_MODULE_HEADER_UNITS` filesetsBen Boeckel2023-05-311-4/+2
| | | | | There's no backing implementation for header units anyways, so just remove it for now.
* cxxmodules: Do not expect collator install scripts with no CXX_MODULESTyler2023-05-231-0/+6
| | | | | | | | | | | | Calling `install(EXPORT)` with the `CXX_MODULES_DIRECTORY` parameter leads to installation rules being generated which `include()` CMake scripts that set the `IMPORTED_CXX_MODULES_[CONFIG]` target property for relevant targets. However, these scripts don't get generated for targets in an export set which don't have any C++20 modules. When the installation rules attempt to `include()` the missing scripts, the install fails. Co-authored-by: Brad King <brad.king@kitware.com>
* Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target propertyOrkun Tokdemir2023-04-091-0/+3
| | | | | | | | | | Add this target property to specify macro names that propagate to dependents as `AUTOMOC_MACRO_NAMES`. The dependents will automatically generate MOC files for source files that contain the inherited macro names. Co-Authored-By: Craig Scott <craig.scott@crascit.com> Fixes: #19679
* Apple: Handle generation and comsuption of text-based stubs (.tbd files)Marc Chevrier2023-03-011-1/+14
| | | | Fixes: #24123
* cmGeneratorExpression: Require cmake instanceKyle Edwards2022-11-111-2/+2
|
* export: Fix IMPORTED_LOCATION of iOS flat app bundlesHarry Mallon2022-09-141-1/+4
| | | | | | | | | iOS/tvOS app bundles are flat and do not include the `Contents/MacOS/` layers, so they should not be in the `IMPORTED_LOCATION`. Use the same logic that commit 34f5ef564a (iOS: Fix App Bundle layout, 2015-12-10, v3.5.0-rc1~129^2~1) added for the installation layout. Fixes: #23963
* cmExport*FileGenerator: support exporting C++ module propertiesBen Boeckel2022-07-061-1/+73
| | | | | C++ module properties will be generated at build time, so generate code that includes the files actually responsible for the information.
* cmTarget: add support for C++ module fileset typesBen Boeckel2022-06-161-0/+34
| | | | | | | | | | | | | | | C++ modules have two variants which are of importance to CMake: - `CXX_MODULES`: interface modules (those using `export module M;`, `export module M:part;`, or `module M:internal_part;`) - `CXX_MODULE_HEADER_UNITS`: importable header units Creating C++ modules or partitions are *not* supported in any other source listing. This is because the source files must be installed (so their scope matters), but not part of usage requirements (what it means for a module source to be injected into a consumer is not clear at this moment). Due to the way `FILE_SET` works with scopes, they are a perfect fit as long as `INTERFACE` is not allowed (which it is not).
* generated-scripts: use CMAKE_CURRENT_LIST_DIR where possibleBen Boeckel2022-04-201-2/+1
|
* generated-scripts: unset used variablesBen Boeckel2022-04-201-0/+2
|
* generated-scripts: use `foreach(IN LISTS)`Ben Boeckel2022-04-201-1/+1
|
* generated-scripts: quote variable expansionsBen Boeckel2022-04-201-1/+1
|
* generated-cmake: use `_cmake_` prefixes for local variablesBen Boeckel2022-04-201-3/+3
| | | | This avoids stomping on any user variables.
* cmExportFileGenerator: Simplify collection of targets missing from export setBrad King2022-04-111-28/+22
| | | | | Store the list of missing target names in a member instead of threading an explicit reference to it through the call stack.
* Merge topic 'restore-target-export-includes'Brad King2022-02-101-1/+2
|\ | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | install(EXPORT): Install file setsKyle Edwards2021-10-271-0/+105
|/
* Rename cmProp in cmValueMarc Chevrier2021-09-211-1/+1
|
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-0/+1
| | | | | | To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
* Refactor export file generator intefaceEugene Shalygin2021-07-221-7/+7
| | | | | Replace cmTargetExport with const cmGeneratorTarget to allow recursive processing of exported targets and their link dependencies.
* install(EXPORT): Set copy-if-different on install export config filesDaan De Meyer2021-01-191-0/+1
| | | | | Avoid reinstalling the per-config export install files if the contents didn't change after a configure.
* export: Do not fail generation for separate namelink only caseDeniz Bahadir2020-12-011-0/+3
| | | | | | | | Update the change from commit 64690f6df0 (export: Do not fail generation for namelink-only case, 2020-10-09, v3.19.0-rc1~7^2) to also handle separate namelink-only and namelink-skip calls. Fixes: #21529
* INSTALL_NAME_DIR: Add support for generator expressionsKyle Edwards2019-11-041-2/+3
|
* Refactor: Generalize cmExportInstallFileGenerator::ReplaceInstallPrefix()Kyle Edwards2019-11-011-9/+1
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-4/+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.
* PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT)Brad King2019-09-251-0/+3
| | | | | | | | | This was accidentally left out of commit 0467a2f91b (PCH: add PRECOMPILE_HEADERS to special properties, 2015-03-12). Also add a test case for `install(EXPORT)` and `export()` propagation of precompiled headers. Fixes: #19741
* cmExportSet: subsume cmExportSetMap source filesTushar Maheshwari2019-09-191-1/+1
|
* cmExportSet: default destructorTushar Maheshwari2019-09-191-7/+8
|
* cmExportSetMap: improve ownership of cmExportSetTushar Maheshwari2019-09-191-4/+3
| | | | | - use `std::piecewise_construct` to fix gcc-4.8 build. - can use `emplace(name, name)` gcc-6 onwards.
* clang-tidy: modernize-return-braced-init-listRegina Pfeifer2019-09-061-1/+1
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* cmExportInstallFileGenerator: improve error messageBen Boeckel2019-08-201-15/+23
| | | | | | | Following commit 49cfd390 (cmExportBuildFileGenerator: improve error message, 2019-06-26), improve the error message related to installed export sets by referencing the files which contain the exported target ambiguously.
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-1/+1
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* 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`.
* cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-4/+4
|
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-2/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* clang-tidy: Fix readability-static-accessed-through-instanceRegina Pfeifer2018-11-211-6/+6
| | | | Enable the check in .clang-tidy and fix all warnings.
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-0/+2
| | | | | | | | | | | | 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
* 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/+2
| | | | Fixes: #17997