cmake/Source/cmExportSet.h

63 lines
1.6 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2013-03-16 19:13:01 +02:00
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
2020-02-01 23:06:01 +01:00
#include <map>
#include <memory>
2016-10-30 18:24:19 +01:00
#include <string>
#include <vector>
2016-07-09 11:21:54 +02:00
2013-03-16 19:13:01 +02:00
class cmInstallExportGenerator;
2016-03-13 13:35:51 +01:00
class cmLocalGenerator;
2016-10-30 18:24:19 +01:00
class cmTargetExport;
2013-03-16 19:13:01 +02:00
/// A set of targets that were installed with the same EXPORT parameter.
class cmExportSet
{
public:
/// Construct an empty export set named \a name
2020-02-01 23:06:01 +01:00
cmExportSet(std::string name);
2013-03-16 19:13:01 +02:00
/// Destructor
~cmExportSet();
2019-11-11 23:01:05 +01:00
cmExportSet(const cmExportSet&) = delete;
cmExportSet& operator=(const cmExportSet&) = delete;
2016-03-13 13:35:51 +01:00
void Compute(cmLocalGenerator* lg);
2020-02-01 23:06:01 +01:00
void AddTargetExport(std::unique_ptr<cmTargetExport> tgt);
2013-03-16 19:13:01 +02:00
void AddInstallation(cmInstallExportGenerator const* installation);
std::string const& GetName() const { return this->Name; }
2020-02-01 23:06:01 +01:00
std::vector<std::unique_ptr<cmTargetExport>> const& GetTargetExports() const
2016-07-09 11:21:54 +02:00
{
2020-02-01 23:06:01 +01:00
return this->TargetExports;
2016-07-09 11:21:54 +02:00
}
2013-03-16 19:13:01 +02:00
std::vector<cmInstallExportGenerator const*> const* GetInstallations() const
2016-07-09 11:21:54 +02:00
{
return &this->Installations;
}
2013-03-16 19:13:01 +02:00
private:
2020-02-01 23:06:01 +01:00
std::vector<std::unique_ptr<cmTargetExport>> TargetExports;
2013-03-16 19:13:01 +02:00
std::string Name;
std::vector<cmInstallExportGenerator const*> Installations;
};
2020-02-01 23:06:01 +01:00
/// A name -> cmExportSet map with overloaded operator[].
class cmExportSetMap : public std::map<std::string, cmExportSet>
{
public:
/** \brief Overloaded operator[].
*
* The operator is overloaded because cmExportSet has no default constructor:
* we do not want unnamed export sets.
*/
cmExportSet& operator[](const std::string& name);
};