summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* export: Allow multiple exports when only one export is installedMartin Duffy2025-03-171-4/+6
| | | | | | | | | | | | Since commit c8997fc046 (export: Allow depending on targets exported multiple times, 2024-12-26, v4.0.0-rc1~241^2), it is possible to depend on a target exported multiple times so long as the target is exported in only one set and with a consistent namespace. However, as a side-effect, a target could not be in multiple export sets even if only one of those sets was installed. Update the check so that uninstalled export sets do not count towards a target being exported multiple times.
* LICENSE: Replace references to Copyright.txt with LICENSE.rstKitware Robot2025-03-031-1/+1
| | | | | | | | | | ``` git grep -lz 'Copyright.txt or https://cmake.org/licensing ' | while IFS= read -r -d $'\0' f ; do sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / { s/Copyright.txt/LICENSE.rst/ }' "$f" ; done ```
* CMP0052: Remove support for OLD behaviorBrad King2025-01-201-36/+3
|
* CMP0041: Remove support for OLD behaviorBrad King2025-01-191-19/+7
|
* export: Allow depending on targets exported multiple timesMartin Duffy2025-01-071-16/+25
| | | | Fixes: #26556
* cmExportInstallFileGenerator: Report errors with IssueMessageMartin Duffy2024-12-301-1/+4
|
* export: Convert ExportInfo to a struct with meaningful field namesMartin Duffy2024-12-301-4/+3
|
* cmPolicies: Remove now-unused REQUIRED_IF_USED and REQUIRED_ALWAYS statesBrad King2024-11-131-4/+0
|
* Source: Avoid comparing pointers to nullptrVitaly Stakhovsky2024-08-271-1/+1
|
* export: Fix handling of import prefixMatthew Woehlke2024-07-261-20/+21
| | | | | | | | | | Fix some additional places in export generation logic that were still hard-coding the import prefix. Change cmGeneratorExpression::Preprocess to take the desired prefix as an argument. (This replaces taking a boolean whether to resolve relative paths; if a non-empty prefix is given, that is used to resolve relative paths, otherwise relative paths are left alone.) This should ensure that import properties always spell the prefix according to the format being generated.
* export: Generalize GenerateImportFileConfigMatthew Woehlke2024-07-251-0/+40
| | | | | | | | | | Move some logic that is specific to CMake-format exports from GenerateImportFileConfig to an overload of GenerateImportConfig, so that the former can be moved (back) to the generic base class. This will allow it to also be used for Common Package Specification exports. To facilitate this, also add a method to get the format-specific character used to separate the export file base name from the config suffix, so that the rest of the logic to determine the file name can be shared.
* export: Refactor obtaining export informationMatthew Woehlke2024-07-251-19/+17
| | | | | | | | Refactor methods in the build and install export file generators to have the same, simplified API. Expose the resulting method as an abstract method on the base class, so that it can be called from mode-agnostic generators. While we're at it, refactor cmExportInstallFileGenerator's version to use std::any_of.
* export: Use std::all_of to collect exportsMatthew Woehlke2024-07-231-7/+11
| | | | | Rewrite cmExport{Build,Install}FileGenerator::CollectExports to use std::all_of as recommended by clang-tidy.
* export: Factor out CMake-specific export generation (2/2)Matthew Woehlke2024-07-231-529/+371
| | | | | | | | | | | | | | | | | | In order to support generation of Common Package Specifications, the mechanisms CMake uses to export package information need to be made more abstract. The prior commits began this refactoring; this continues by (actually) restructuring the classes used to generate the actual export files. To minimize churn, this introduces virtual base classes and diamond inheritance in order to separate logic which is format-agnostic but depends on the export mode (build-tree versus install-tree) from logic which is format-specific but mode-agnostic. This could probably be refactored further to use helper classes instead, and a future commit may do that, however an initial attempt to do that was proving even more invasive, such that this approach was deemed more manageable. While we're at it, add 'const' in more places where possible.
* export: Fix const placementMatthew Woehlke2024-07-181-10/+10
| | | | | | | | Use clang-format to fix placement of const qualifiers to be consistently right of the typename. The inconsistency was getting annoying, especially as the following refactor changes a lot of methods and sometimes adds const. (Being inconsistent within a file is not ideal, but in some cases there was inconsistency within single lines!)
* export: Factor out CMake-specific export generation (1/2)Matthew Woehlke2024-07-181-6/+10
| | | | | | | | | | | | | | | | In order to support generation of Common Package Specifications, the mechanisms CMake uses to export package information need to be made more abstract. As a first step toward this, refactor cmInstallExportGenerator so that logic specific to config.cmake and Android .mk lives in separate subclasses. While we're at it, clean up the code style a bit and try to use moves a bit more consistently. This is step 1 of 2. The next step will refactor the individual file generators along similar lines, which will also involve creating additional classes for format-agnostic logic that is shared between build-tree and install-tree variants.
* GenEx: Add support for custom transitive compile propertiesBrad King2024-05-211-0/+2
| | | | | | | | | Teach the `$<TARGET_PROPERTY:...>` generator expression to check for a new `TRANSITIVE_COMPILE_PROPERTIES` property in the target's link closure to enable transitive evaluation of named properties through the link closure, excluding entries guarded by `$<LINK_ONLY:...>`. Issue: #20416
* Merge topic 'export-name-safe-name'Brad King2024-05-011-2/+2
|\ | | | | | | | | | | | | | | | | 142a85f9c1 cxxmodules: use filesystem-safe export names in filenames 4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9474
| * cxxmodules: use filesystem-safe export names in filenamesBen Boeckel2024-04-301-2/+2
| | | | | | | | | | | | Also add tests. Fixes: #25828
* | 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.