bug fixes
This commit is contained in:
parent
e14d38d3c8
commit
d13d283f14
|
@ -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,6 +55,9 @@ 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];
|
||||||
|
// if we should wrap the class
|
||||||
|
if (!curr.m_WrapExclude)
|
||||||
|
{
|
||||||
cmClassFile file;
|
cmClassFile file;
|
||||||
file.m_AbstractClass = curr.m_AbstractClass;
|
file.m_AbstractClass = curr.m_AbstractClass;
|
||||||
std::string newName = curr.m_ClassName + "Tcl";
|
std::string newName = curr.m_ClassName + "Tcl";
|
||||||
|
@ -44,7 +67,7 @@ bool cmWrapTclCommand::Invoke(std::vector<std::string>& args)
|
||||||
std::string hname = cdir + "/" + curr.m_ClassName + ".h";
|
std::string hname = cdir + "/" + curr.m_ClassName + ".h";
|
||||||
m_WrapHeaders.push_back(hname);
|
m_WrapHeaders.push_back(hname);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,13 +78,9 @@ 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();
|
||||||
|
@ -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;
|
||||||
|
@ -114,6 +130,8 @@ bool cmWrapTclCommand::CreateInitFile(std::string& res)
|
||||||
int lastClass = m_WrapHeaders.size();
|
int lastClass = m_WrapHeaders.size();
|
||||||
int classNum;
|
int classNum;
|
||||||
for(classNum = 0; classNum < lastClass; classNum++)
|
for(classNum = 0; classNum < lastClass; classNum++)
|
||||||
|
{
|
||||||
|
if (!m_WrapClasses[classNum].m_AbstractClass)
|
||||||
{
|
{
|
||||||
std::string cls = m_WrapHeaders[classNum];
|
std::string cls = m_WrapHeaders[classNum];
|
||||||
cls = cls.substr(0,cls.size()-2);
|
cls = cls.substr(0,cls.size()-2);
|
||||||
|
@ -124,6 +142,7 @@ bool cmWrapTclCommand::CreateInitFile(std::string& res)
|
||||||
}
|
}
|
||||||
classes.push_back(cls);
|
classes.push_back(cls);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// open the init file
|
// open the init file
|
||||||
std::string outFileName =
|
std::string outFileName =
|
||||||
|
@ -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");
|
||||||
|
|
Loading…
Reference in New Issue