diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-23 15:08:57 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-23 15:08:57 (GMT) |
commit | 8ef1cedbefe2aec394bcaea8eb8aeab7f06326e1 (patch) | |
tree | f2bbdd23cd3f7e36729535cd8bab07c2b6979611 /Source/cmFLTKWrapUICommand.cxx | |
parent | 465a36484e435faa787d8c3af49d00657b78f825 (diff) | |
download | CMake-8ef1cedbefe2aec394bcaea8eb8aeab7f06326e1.zip CMake-8ef1cedbefe2aec394bcaea8eb8aeab7f06326e1.tar.gz CMake-8ef1cedbefe2aec394bcaea8eb8aeab7f06326e1.tar.bz2 |
BUG: fix for bug 7228 FLTK_WRAP_UI segfault fixed
Diffstat (limited to 'Source/cmFLTKWrapUICommand.cxx')
-rw-r--r-- | Source/cmFLTKWrapUICommand.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 8090eb1..ec4a30e 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -121,8 +121,20 @@ void cmFLTKWrapUICommand::FinalPass() // people should add the srcs to the target themselves, but the old command // didn't support that, so check and see if they added the files in and if // they didn;t then print a warning and add then anyhow + cmTarget* target = this->Makefile->FindTarget(this->Target.c_str()); + if(!target) + { + std::string msg = + "FLTK_WRAP_UI was called with a target that was never created: "; + msg += this->Target; + msg +=". The problem was found while processing the source directory: "; + msg += this->Makefile->GetStartDirectory(); + msg += ". This FLTK_WRAP_UI call will be ignored."; + cmSystemTools::Message(msg.c_str(),"Warning"); + return; + } std::vector<cmSourceFile*> const& srcs = - this->Makefile->GetTargets()[this->Target].GetSourceFiles(); + target->GetSourceFiles(); bool found = false; for (unsigned int i = 0; i < srcs.size(); ++i) { |