1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Files
CMake/Source/cmExportBuildPackageInfoGenerator.h
Matthew Woehlke 0ccbe5a2e1 CPS: Refactor argument parsing
CPS package metadata involves a fair amount of passing around a
particular set of values, as well as shared argument handling, which is
only going to increase as additional features are added. In order to
reduce code duplication (now and going forward), create a helper class
to handle the shared argument parsing and to serve as a container to
pass metadata values.
2025-06-02 10:31:35 -04:00

51 lines
1.5 KiB
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file LICENSE.rst or https://cmake.org/licensing for details. */
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
#include <string>
#include "cmExportBuildFileGenerator.h"
#include "cmExportPackageInfoGenerator.h"
namespace Json {
class Value;
}
class cmGeneratorTarget;
class cmPackageInfoArguments;
/** \class cmExportBuildPackageInfoGenerator
* \brief Generate a file exporting targets from a build tree.
*
* cmExportBuildCMakeConfigGenerator generates a file exporting targets from
* a build tree. This exports the targets to the Common Package Specification
* (https://cps-org.github.io/cps/).
*
* This is used to implement the export() command.
*/
class cmExportBuildPackageInfoGenerator
: public cmExportBuildFileGenerator
, public cmExportPackageInfoGenerator
{
public:
cmExportBuildPackageInfoGenerator(cmPackageInfoArguments arguments);
protected:
// Implement virtual methods from the superclass.
bool GenerateMainFile(std::ostream& os) override;
void GenerateImportTargetsConfig(std::ostream&, std::string const&,
std::string const&) override
{
}
void GenerateInterfacePropertiesConfig(Json::Value& configurations,
cmGeneratorTarget* target,
std::string const& config);
std::string GetCxxModulesDirectory() const override;
// TODO: Generate C++ module info in a not-CMake-specific format.
};