mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-09 16:16:58 +00:00
cmExportSet: subsume cmExportSetMap source files
This commit is contained in:
@@ -226,8 +226,6 @@ set(SRCS
|
||||
cmExportTryCompileFileGenerator.cxx
|
||||
cmExportSet.h
|
||||
cmExportSet.cxx
|
||||
cmExportSetMap.h
|
||||
cmExportSetMap.cxx
|
||||
cmExternalMakefileProjectGenerator.cxx
|
||||
cmExternalMakefileProjectGenerator.h
|
||||
cmExtraCodeBlocksGenerator.cxx
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "cmake.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "cmArgumentParser.h"
|
||||
#include "cmExportBuildAndroidMKGenerator.h"
|
||||
#include "cmExportBuildFileGenerator.h"
|
||||
#include "cmExportSetMap.h"
|
||||
#include "cmExportSet.h"
|
||||
#include "cmGeneratedFileStream.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmTarget.h"
|
||||
|
||||
class cmExportSet;
|
||||
class cmExecutionStatus;
|
||||
|
||||
#if defined(__HAIKU__)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "cmExportInstallAndroidMKGenerator.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
|
||||
#include "cmExportBuildAndroidMKGenerator.h"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "cmExportInstallFileGenerator.h"
|
||||
|
||||
#include "cmExportSet.h"
|
||||
#include "cmExportSetMap.h"
|
||||
#include "cmGeneratedFileStream.h"
|
||||
#include "cmGeneratorExpression.h"
|
||||
#include "cmGeneratorTarget.h"
|
||||
@@ -19,6 +18,7 @@
|
||||
#include "cmTarget.h"
|
||||
#include "cmTargetExport.h"
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmExportSet.h"
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "cmLocalGenerator.h"
|
||||
@@ -30,3 +31,14 @@ void cmExportSet::AddInstallation(cmInstallExportGenerator const* installation)
|
||||
{
|
||||
this->Installations.push_back(installation);
|
||||
}
|
||||
|
||||
cmExportSet& cmExportSetMap::operator[](const std::string& name)
|
||||
{
|
||||
auto it = this->find(name);
|
||||
if (it == this->end()) // Export set not found
|
||||
{
|
||||
auto tup_name = std::make_tuple(name);
|
||||
it = this->emplace(std::piecewise_construct, tup_name, tup_name).first;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -49,4 +50,16 @@ private:
|
||||
std::vector<cmInstallExportGenerator const*> Installations;
|
||||
};
|
||||
|
||||
/// 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);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmExportSetMap.h"
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
cmExportSet& cmExportSetMap::operator[](const std::string& name)
|
||||
{
|
||||
auto it = this->find(name);
|
||||
if (it == this->end()) // Export set not found
|
||||
{
|
||||
auto tup_name = std::make_tuple(name);
|
||||
it = this->emplace(std::piecewise_construct, tup_name, tup_name).first;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#ifndef cmExportSetMap_h
|
||||
#define cmExportSetMap_h
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "cmExportSet.h"
|
||||
|
||||
/// A name -> cmExportSet map with overloaded operator[].
|
||||
class cmExportSetMap : public std::map<std::string, cmExportSet>
|
||||
{
|
||||
using derived = 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);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "cmAlgorithms.h"
|
||||
#include "cmCustomCommandLines.h"
|
||||
#include "cmDuration.h"
|
||||
#include "cmExportSetMap.h"
|
||||
#include "cmExportSet.h"
|
||||
#include "cmStateSnapshot.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmSystemTools.h"
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "cmArgumentParser.h"
|
||||
#include "cmExportSet.h"
|
||||
#include "cmExportSetMap.h"
|
||||
#include "cmGeneratorExpression.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmInstallCommandArguments.h"
|
||||
|
||||
Reference in New Issue
Block a user