bug fixes

This commit is contained in:
Ken Martin 2001-02-27 16:49:53 -05:00
parent e14d38d3c8
commit d13d283f14
1 changed files with 42 additions and 23 deletions

View File

@ -24,6 +24,26 @@ bool cmWrapTclCommand::Invoke(std::vector<std::string>& args)
return false; return false;
} }
// Now check and see if the value has been stored in the cache
// already, if so use that value and don't look for the program
const char* cacheValue
= cmCacheManager::GetInstance()->GetCacheValue("WRAP_TCL");
if(!cacheValue)
{
cmCacheManager::GetInstance()->AddCacheEntry("WRAP_TCL","1",
cmCacheManager::BOOL);
m_Makefile->AddDefinition("WRAP_TCL", "1");
}
else
{
m_Makefile->AddDefinition("WRAP_TCL", cacheValue);
// if it is turned off then return
if (!strcmp(cacheValue,"0"))
{
return true;
}
}
// get the list of classes for this library // get the list of classes for this library
std::vector<cmClassFile> &classes = m_Makefile->GetClasses(); std::vector<cmClassFile> &classes = m_Makefile->GetClasses();
@ -35,16 +55,19 @@ bool cmWrapTclCommand::Invoke(std::vector<std::string>& args)
for(int classNum = 0; classNum < lastClass; classNum++) for(int classNum = 0; classNum < lastClass; classNum++)
{ {
cmClassFile &curr = classes[classNum]; cmClassFile &curr = classes[classNum];
cmClassFile file; // if we should wrap the class
file.m_AbstractClass = curr.m_AbstractClass; if (!curr.m_WrapExclude)
std::string newName = curr.m_ClassName + "Tcl"; {
file.SetName(newName.c_str(), m_Makefile->GetCurrentOutputDirectory(), cmClassFile file;
"cxx",false); file.m_AbstractClass = curr.m_AbstractClass;
m_WrapClasses.push_back(file); std::string newName = curr.m_ClassName + "Tcl";
std::string hname = cdir + "/" + curr.m_ClassName + ".h"; file.SetName(newName.c_str(), m_Makefile->GetCurrentOutputDirectory(),
m_WrapHeaders.push_back(hname); "cxx",false);
m_WrapClasses.push_back(file);
std::string hname = cdir + "/" + curr.m_ClassName + ".h";
m_WrapHeaders.push_back(hname);
}
} }
return true; return true;
} }
@ -55,14 +78,10 @@ void cmWrapTclCommand::FinalPass()
std::vector<std::string> depends; std::vector<std::string> depends;
std::string wtcl = "${WRAP_TCL_EXE}"; std::string wtcl = "${WRAP_TCL_EXE}";
std::string hints = "${WRAP_HINTS}"; std::string hints = "${WRAP_HINTS}";
std::string wti = "${WRAP_TCL_INIT_EXE}";
m_Makefile->ExpandVariablesInString(wtcl); m_Makefile->ExpandVariablesInString(wtcl);
m_Makefile->ExpandVariablesInString(hints); m_Makefile->ExpandVariablesInString(hints);
m_Makefile->ExpandVariablesInString(wti);
depends.push_back(wti);
// Create the init file // Create the init file
std::string res = m_Makefile->GetLibraryName(); std::string res = m_Makefile->GetLibraryName();
res += "Init.cxx"; res += "Init.cxx";
@ -92,9 +111,6 @@ void cmWrapTclCommand::FinalPass()
} }
char *names[1000];
int anindex = 0;
bool cmWrapTclCommand::CreateInitFile(std::string& res) bool cmWrapTclCommand::CreateInitFile(std::string& res)
{ {
unsigned int i; unsigned int i;
@ -115,14 +131,17 @@ bool cmWrapTclCommand::CreateInitFile(std::string& res)
int classNum; int classNum;
for(classNum = 0; classNum < lastClass; classNum++) for(classNum = 0; classNum < lastClass; classNum++)
{ {
std::string cls = m_WrapHeaders[classNum]; if (!m_WrapClasses[classNum].m_AbstractClass)
cls = cls.substr(0,cls.size()-2);
std::string::size_type pos = cls.rfind('/');
if(pos != std::string::npos)
{ {
cls = cls.substr(pos+1); std::string cls = m_WrapHeaders[classNum];
cls = cls.substr(0,cls.size()-2);
std::string::size_type pos = cls.rfind('/');
if(pos != std::string::npos)
{
cls = cls.substr(pos+1);
}
classes.push_back(cls);
} }
classes.push_back(cls);
} }
// open the init file // open the init file
@ -183,7 +202,7 @@ bool cmWrapTclCommand::WriteInit(const char *kitName, std::string& outFileName,
fprintf(fout,"\n\nint VTK_EXPORT %s_Init(Tcl_Interp *interp)\n{\n", fprintf(fout,"\n\nint VTK_EXPORT %s_Init(Tcl_Interp *interp)\n{\n",
kitName); kitName);
if (!strcmp(kitName,"Vtkcommontcl")) if (!strcmp(kitName,"Vtkcommon"))
{ {
fprintf(fout, fprintf(fout,
" vtkTclInterpStruct *info = new vtkTclInterpStruct;\n"); " vtkTclInterpStruct *info = new vtkTclInterpStruct;\n");