summaryrefslogtreecommitdiffstats
path: root/Source/cmExportBuildFileGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-06 15:27:40 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-11 10:46:10 (GMT)
commit66b290e7e2bbeb987ea83e2f9edaac99fe8593f5 (patch)
tree2382c213f05d1a19d0d3c17e667c712335ec5756 /Source/cmExportBuildFileGenerator.cxx
parent5fe5c32480a5acf26bd20e52a091cd63747ed77d (diff)
downloadCMake-66b290e7e2bbeb987ea83e2f9edaac99fe8593f5.zip
CMake-66b290e7e2bbeb987ea83e2f9edaac99fe8593f5.tar.gz
CMake-66b290e7e2bbeb987ea83e2f9edaac99fe8593f5.tar.bz2
export(): Process the export() command at generate time.
Make the API for adding targets string based so that it can easily use cmGeneratorTarget. Teach the cmIncludeCommand to generate the exported file at configure-time instead if it is to be include()d. The RunCMake.ExportWithoutLanguage test now needs a dummy header.h file as expected error from export() is now reported after the missing file error.
Diffstat (limited to 'Source/cmExportBuildFileGenerator.cxx')
-rw-r--r--Source/cmExportBuildFileGenerator.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index e2ad74f..e593e0c 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -21,20 +21,19 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator()
//----------------------------------------------------------------------------
bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
{
- std::vector<cmTarget*> allTargets;
{
std::string expectedTargets;
std::string sep;
- for(std::vector<cmTarget*>::const_iterator
- tei = this->Exports->begin();
- tei != this->Exports->end(); ++tei)
+ for(std::vector<std::string>::const_iterator
+ tei = this->Targets.begin();
+ tei != this->Targets.end(); ++tei)
{
- expectedTargets += sep + this->Namespace + (*tei)->GetExportName();
+ cmTarget *te = this->Makefile->FindTargetToUse(tei->c_str());
+ expectedTargets += sep + this->Namespace + te->GetExportName();
sep = " ";
- cmTarget* te = *tei;
if(this->ExportedTargets.insert(te).second)
{
- allTargets.push_back(te);
+ this->Exports.push_back(te);
}
else
{
@@ -57,8 +56,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
// Create all the imported targets.
for(std::vector<cmTarget*>::const_iterator
- tei = allTargets.begin();
- tei != allTargets.end(); ++tei)
+ tei = this->Exports.begin();
+ tei != this->Exports.end(); ++tei)
{
cmTarget* te = *tei;
this->GenerateImportTargetCode(os, te);
@@ -113,8 +112,8 @@ cmExportBuildFileGenerator
std::vector<std::string> &missingTargets)
{
for(std::vector<cmTarget*>::const_iterator
- tei = this->Exports->begin();
- tei != this->Exports->end(); ++tei)
+ tei = this->Exports.begin();
+ tei != this->Exports.end(); ++tei)
{
// Collect import properties for this target.
cmTarget* target = *tei;