summaryrefslogtreecommitdiffstats
path: root/Source/cmScriptGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-06-14 17:23:20 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-06-14 17:23:20 (GMT)
commitf616f263cd016a978dd04ce7b62d8dcabd0f4e2e (patch)
tree7821ed6c31f018537a8873fd5414758a4eb2c409 /Source/cmScriptGenerator.cxx
parentcf1c3c102f76d9dd5a7c62995987fc05c12edc8a (diff)
parenta4ec24269b32a28104e1d5681e718024b28bb4e7 (diff)
downloadCMake-f616f263cd016a978dd04ce7b62d8dcabd0f4e2e.zip
CMake-f616f263cd016a978dd04ce7b62d8dcabd0f4e2e.tar.gz
CMake-f616f263cd016a978dd04ce7b62d8dcabd0f4e2e.tar.bz2
Merge topic 'ctest-no-config-report-notrun'
a4ec242 CTest: Report tests not run due to unknown configuration 77ddb6a Use cascading-if for per-config test and install code
Diffstat (limited to 'Source/cmScriptGenerator.cxx')
-rw-r--r--Source/cmScriptGenerator.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index 86ecebe..cabe98a 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -209,6 +209,7 @@ void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os,
// In a multi-configuration generator we produce a separate rule
// in a block for each configuration that is built. We restrict
// the list of configurations to those to which this rule applies.
+ bool first = true;
for(std::vector<std::string>::const_iterator i =
this->ConfigurationTypes->begin();
i != this->ConfigurationTypes->end(); ++i)
@@ -218,10 +219,19 @@ void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os,
{
// Generate a per-configuration block.
std::string config_test = this->CreateConfigTest(config);
- os << indent << "IF(" << config_test << ")\n";
+ os << indent << (first? "IF(" : "ELSEIF(") << config_test << ")\n";
this->GenerateScriptForConfig(os, config, indent.Next());
- os << indent << "ENDIF(" << config_test << ")\n";
+ first = false;
}
}
+ if(!first)
+ {
+ if(this->NeedsScriptNoConfig())
+ {
+ os << indent << "ELSE()\n";
+ this->GenerateScriptNoConfig(os, indent.Next());
+ }
+ os << indent << "ENDIF()\n";
+ }
}
}