summaryrefslogtreecommitdiffstats
path: root/Source/cmExportBuildFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* export: Refactor obtaining export informationMatthew Woehlke2024-07-251-10/+8
| | | | | | | | 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-8/+9
| | | | | 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-382/+53
| | | | | | | | | | | | | | | | | | 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-11/+11
| | | | | | | | 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!)
* 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-8/+23
|\ \ | |/
| * cxxmodules: make export trampoline script files uniqueBen Boeckel2024-01-181-8/+23
| | | | | | | | | | | | | | | | | | | | | | 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/+19
| | | | | | | | Issue: #25262
* | cmExportBuildFileGenerator: Add structs for target exportsKyle Edwards2023-11-141-11/+15
| |
* | cmExportFileGenerator: Add function to set required CMake versionKyle Edwards2023-11-131-1/+1
|/
* cxxmodules: include `INCLUDES DESTINATION` directoriesBen Boeckel2023-10-161-1/+1
| | | | | | | 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/+9
| | | | | | | | | 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
|
* 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/+1
| | | | Fixes: #24123
* cmExport*FileGenerator: support exporting C++ module propertiesBen Boeckel2022-07-061-0/+66
| | | | | 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/+32
| | | | | | | | | | | | | | | 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).
* Merge topic 'file-set-build-export'Brad King2022-04-211-8/+85
|\ | | | | | | | | | | | | | | 9ee47188c0 cmExportBuildFileGenerator: handle genex-wrapped source paths 60fab8a6e0 cmInstallCommand: tweak error message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7182
| * cmExportBuildFileGenerator: handle genex-wrapped source pathsBen Boeckel2022-04-181-8/+85
| | | | | | | | | | | | | | Previously a fileset with `$<$<CONFIG:Debug>:some_file>` would show up as-is (with escaping) in the build directory export. Instead, evaluate all fileset entries as generator expressions and list them as they are similar to the installation information.
* | Merge topic 'export-missing-targets'Brad King2022-04-141-24/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | 8c65b7042e cmExportFileGenerator: Simplify collection of targets missing from export set Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7165
| * | cmExportFileGenerator: Simplify collection of targets missing from export setBrad King2022-04-111-24/+19
| |/ | | | | | | | | Store the list of missing target names in a member instead of threading an explicit reference to it through the call stack.
* | cmTarget: Add `HasKnownObjectFileLocation()` shorthandHyper Nova Sun2022-04-111-1/+1
|/ | | | | | | | Allow `cmGlobalGenerator`s to decide `HasKnownObjectFileLocation()` per given `cmTarget` - `cmGlobalGenerator::HasKnownObjectFileLocation()` now takes an optional `cmGeneratorTarget` - `cmTarget::HasKnownObjectFileLocation()` added as a shorthand
* install(EXPORT): Install file setsKyle Edwards2021-10-271-0/+19
|
* 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-3/+3
| | | | | Replace cmTargetExport with const cmGeneratorTarget to allow recursive processing of exported targets and their link dependencies.
* 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
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-2/+3
|
* cmGlobalGenerator: modernize memrory managemenbtMarc Chevrier2019-12-301-3/+2
|
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-0/+1
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+6
| | | | | 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.
* cmExportSet: subsume cmExportSetMap source filesTushar Maheshwari2019-09-191-0/+1
|
* cmExportSet: default destructorTushar Maheshwari2019-09-191-1/+2
|
* clang-tidy: modernize-return-braced-init-listRegina Pfeifer2019-09-061-1/+1
|
* PCH: add PRECOMPILE_HEADERS to special propertiesDaniel Pfeifer2019-08-261-0/+3
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-2/+1
| | | | Also, use the new function where applicable.
* 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`.
* Refactor checks for whether a target has an import libraryBrad King2019-07-121-4/+5
| | | | Use `HasImportLibrary` for such checks.
* cmExportBuildFileGenerator: improve error messageBen Boeckel2019-06-271-22/+23
| | | | | | | | When an exported target depends on another exported target that is included in multiple build export sets, the error message was woefully unhelpful. Now, include information about what build exports the dependent target was included in with instructions for fixing the problem that are actually helpful.
* Export: A singular CMake version written for interface targetsRobert Maynard2019-06-171-3/+6
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-3/+5
| | | | Reduce the number of files relying on `cmake.h`.
* LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-0/+3
| | | | | | | | | | | | 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
* LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDSMarc Chevrier2018-06-271-0/+3
| | | | Fixes: #17997
* LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-0/+3
| | | | | | | | | | | | | | This family enable to manage link flags Three new properties: * directory property: LINK_OPTIONS * target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS Two new commands * add_link_options(): to populate directory property * target_link_options(): to populate target properties Fixes: #16543