diff options
author | Brad King <brad.king@kitware.com> | 2012-10-01 18:05:35 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-10-01 18:05:35 (GMT) |
commit | 49c7b649f958d34e06023a85af705122124328f5 (patch) | |
tree | da779fbe7ff05fd344c241fb4f863cbc27f6efce /Source/cmExportSetMap.cxx | |
parent | 7dce31f3d03e2202ad54d8b6eb8ab00bce8bbe00 (diff) | |
parent | 80112da54e1aa8e64f73a2a5a6a4f73431ac6764 (diff) | |
download | CMake-49c7b649f958d34e06023a85af705122124328f5.zip CMake-49c7b649f958d34e06023a85af705122124328f5.tar.gz CMake-49c7b649f958d34e06023a85af705122124328f5.tar.bz2 |
Merge topic 'export-sets'
80112da Merge topic 'AutomocUseTargetProperties' into export-sets
955b966 exports: add a test for exporting dependent targets
6f50a04 exports: define a CMAKE_FIND_PACKAGE_NAME var set by find_package()
0cfd055 exports: move the handling of missing targets into subclasses
190f2c8 exports: fix build with MSVC6
8b5f448 exports: first try at error handling if a target is missing
87f4c01 exports: accept a missing target if it is exported exactly once
999061a exports: store pointers to all installations of each export set
64b3a6c exports: cmGlobalGenerator::ExportSets destructor will clear it
81cdab5 exports: Hold an ExportSet pointer in cm*Export*Generator
5c898fb exports: Add cmExportSetMap class
d13ec1a exports: Create class cmExportSet
4e2347c exports: Rename cmGlobalGenerator::AddTargetToExport{s,}
e846e70 exports: Remove cmTargetExport constructor
81c66c8 exports: Move cmTargetExport to a dedicated header file
ae4ab62 find_package: add support for a <package>_NOT_FOUND_MESSAGE variable
...
Diffstat (limited to 'Source/cmExportSetMap.cxx')
-rw-r--r-- | Source/cmExportSetMap.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx new file mode 100644 index 0000000..96fdb3e --- /dev/null +++ b/Source/cmExportSetMap.cxx @@ -0,0 +1,34 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2012 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#include "cmExportSetMap.h" +#include "cmExportSet.h" + +cmExportSet* cmExportSetMap::operator[](const std::string &name) +{ + std::map<std::string, cmExportSet*>::iterator it = this->find(name); + if (it == this->end()) // Export set not found + { + it = this->insert(std::make_pair(name, new cmExportSet(name))).first; + } + return it->second; +} + +cmExportSetMap::~cmExportSetMap() +{ + for(std::map<std::string, cmExportSet*>::iterator it = this->begin(); + it != this->end(); + ++ it) + { + delete it->second; + } +} |