summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-12 21:43:45 (GMT)
committerBrad King <brad.king@kitware.com>2008-05-12 21:43:45 (GMT)
commit771bdb7ef84b99f29b87c5424a78daf1d49c9dc7 (patch)
treed441dabefe0a3e05aee18941277bc39498035e8f /Source/cmGlobalGenerator.cxx
parent96525cf3c36650e2257f37a63d61a1244e4aa486 (diff)
downloadCMake-771bdb7ef84b99f29b87c5424a78daf1d49c9dc7.zip
CMake-771bdb7ef84b99f29b87c5424a78daf1d49c9dc7.tar.gz
CMake-771bdb7ef84b99f29b87c5424a78daf1d49c9dc7.tar.bz2
BUG: Make sure all source files are found before generating.
- Previously this was done implicitly by the check for a target link language which checked all source full paths. - The recent change to support computing a link language without finding all the source files skipped the implicit check. - This change adds an explicit check to find all source files.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b589332..dce60ff 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -764,6 +764,12 @@ void cmGlobalGenerator::Generate()
return;
}
+ // Check that all targets are valid.
+ if(!this->CheckTargets())
+ {
+ return;
+ }
+
// For each existing cmLocalGenerator
unsigned int i;
@@ -850,6 +856,34 @@ void cmGlobalGenerator::Generate()
this->CMakeInstance->UpdateProgress("Generating done", -1);
}
+//----------------------------------------------------------------------------
+bool cmGlobalGenerator::CheckTargets()
+{
+ // Make sure all targets can find their source files.
+ for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
+ {
+ cmTargets& targets =
+ this->LocalGenerators[i]->GetMakefile()->GetTargets();
+ for(cmTargets::iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ cmTarget& target = ti->second;
+ if(target.GetType() == cmTarget::EXECUTABLE ||
+ target.GetType() == cmTarget::STATIC_LIBRARY ||
+ target.GetType() == cmTarget::SHARED_LIBRARY ||
+ target.GetType() == cmTarget::MODULE_LIBRARY ||
+ target.GetType() == cmTarget::UTILITY)
+ {
+ if(!target.FindSourceFiles())
+ {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
void cmGlobalGenerator::CheckLocalGenerators()
{
std::map<cmStdString, cmStdString> notFoundMap;