summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Maheshwari <tushar27192@gmail.com>2019-09-14 00:39:15 +0530
committerTushar Maheshwari <tushar27192@gmail.com>2019-09-19 19:20:30 +0530
commit71f088f53ae7f59e002ec893933d0f670347ea93 (patch)
tree52917f8ec74efaa57676a9ca26dad2a51dd75241
parent6511fa6f3309984fc10de8471017c2bb32d8d286 (diff)
downloadcmake-71f088f53ae7f59e002ec893933d0f670347ea93.tar.gz
cmExportSet: subsume cmExportSetMap source files
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/cmExportBuildFileGenerator.cxx1
-rw-r--r--Source/cmExportCommand.cxx3
-rw-r--r--Source/cmExportInstallAndroidMKGenerator.cxx1
-rw-r--r--Source/cmExportInstallFileGenerator.cxx2
-rw-r--r--Source/cmExportSet.cxx12
-rw-r--r--Source/cmExportSet.h13
-rw-r--r--Source/cmExportSetMap.cxx17
-rw-r--r--Source/cmExportSetMap.h27
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmInstallCommand.cxx1
-rwxr-xr-xbootstrap1
12 files changed, 30 insertions, 52 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 65cd6c9fe4..7b580e52a4 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -226,8 +226,6 @@ set(SRCS
cmExportTryCompileFileGenerator.cxx
cmExportSet.h
cmExportSet.cxx
- cmExportSetMap.h
- cmExportSetMap.cxx
cmExternalMakefileProjectGenerator.cxx
cmExternalMakefileProjectGenerator.h
cmExtraCodeBlocksGenerator.cxx
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 08c6e7bd2b..c751966610 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmake.h"
#include <map>
+#include <memory>
#include <set>
#include <sstream>
#include <utility>
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 66dcb97efa..27138569fb 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -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__)
diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx
index 8f7e2ddd7d..2d732c1db9 100644
--- a/Source/cmExportInstallAndroidMKGenerator.cxx
+++ b/Source/cmExportInstallAndroidMKGenerator.cxx
@@ -3,6 +3,7 @@
#include "cmExportInstallAndroidMKGenerator.h"
#include <cstddef>
+#include <memory>
#include <ostream>
#include "cmExportBuildAndroidMKGenerator.h"
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 28e824418d..0009b3af46 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -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>
diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx
index 05f1b5ddd8..a20aa9a8aa 100644
--- a/Source/cmExportSet.cxx
+++ b/Source/cmExportSet.cxx
@@ -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;
+}
diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h
index 2eee84944d..f0d921f5e4 100644
--- a/Source/cmExportSet.h
+++ b/Source/cmExportSet.h
@@ -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
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx
deleted file mode 100644
index 68e76d52c4..0000000000
--- a/Source/cmExportSetMap.cxx
+++ /dev/null
@@ -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;
-}
diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h
deleted file mode 100644
index 5764c0b9f7..0000000000
--- a/Source/cmExportSetMap.h
+++ /dev/null
@@ -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
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index d67c7258d6..372e658aed 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -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"
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 54f6cc6975..0d0b4531e7 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -11,7 +11,6 @@
#include "cmArgumentParser.h"
#include "cmExportSet.h"
-#include "cmExportSetMap.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmInstallCommandArguments.h"
diff --git a/bootstrap b/bootstrap
index 9504250cb1..ca5441fa6e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -307,7 +307,6 @@ CMAKE_CXX_SOURCES="\
cmExportFileGenerator \
cmExportInstallFileGenerator \
cmExportSet \
- cmExportSetMap \
cmExportTryCompileFileGenerator \
cmExprParserHelper \
cmExternalMakefileProjectGenerator \