mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0030749: Inspectors - compilation under tcl scripts
- 'Search Qt4' is renamed into 'Search Qt'. Configuration uses Qt5 from now. For Qt4 use CMake configuration. - 'Build Inspector' check box is added. It causes 'tools' toolkits compilation. Activates automatically 'Search Qt' control. - Many Tcl procedures are extended with additional parameter to giving a directory of processed toolkits. The default directory is 'src', inspector directory is 'tools'. This way is similar Inspector compilation implemented in Cmake build procedure. - Dependency libraries in DEBUG are stored in __TKDEP_DEBUG__. Qt requires it as names of debug and release libraries are different.
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
|
||||
#include <inspector/TInspector_Communicator.hxx>
|
||||
|
||||
#include <OSD_Directory.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#include <inspector/TInspector_Window.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
@@ -37,16 +39,59 @@ TInspector_Communicator::TInspector_Communicator()
|
||||
static int argc = 1;
|
||||
static char* argv[] = { (char*)"", 0 };
|
||||
#if QT_VERSION > 0x050000
|
||||
OSD_Environment anEnvironment ("QTDIR");
|
||||
TCollection_AsciiString aPlugindsDirName = anEnvironment.Value();
|
||||
aPlugindsDirName += "/plugins";
|
||||
QApplication::addLibraryPath (aPlugindsDirName.ToCString());
|
||||
TCollection_AsciiString aPlugindsDirName;
|
||||
if (TInspector_Communicator::PluginsDir (aPlugindsDirName))
|
||||
QApplication::addLibraryPath (aPlugindsDirName.ToCString());
|
||||
#endif
|
||||
new QApplication (argc, argv);
|
||||
}
|
||||
myWindow = new TInspector_Window();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : PluginsDir
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean TInspector_Communicator::PluginsDir (TCollection_AsciiString& thePlugindsDirName)
|
||||
{
|
||||
OSD_Environment anEnvironment ("QTDIR");
|
||||
TCollection_AsciiString aQtDirValue = anEnvironment.Value();
|
||||
if (!aQtDirValue.IsEmpty())
|
||||
{
|
||||
thePlugindsDirName = aQtDirValue + "/plugins";
|
||||
return Standard_True;
|
||||
}
|
||||
anEnvironment = OSD_Environment ("PATH");
|
||||
TCollection_AsciiString aPathValue = anEnvironment.Value();
|
||||
TCollection_AsciiString aPathSep =
|
||||
#ifdef _WIN32
|
||||
';';
|
||||
#else
|
||||
':';
|
||||
#endif
|
||||
for (int i = 1; !aPathValue.IsEmpty(); i++)
|
||||
{
|
||||
Standard_Integer aSepIndex = aPathValue.FirstLocationInSet (aPathSep, 1, aPathValue.Length());
|
||||
if (aSepIndex <= 1)
|
||||
break;
|
||||
|
||||
TCollection_AsciiString aCurPath = aPathValue.SubString (1, aSepIndex - 1);
|
||||
aPathValue = aSepIndex < aPathValue.Length() ? aPathValue.SubString (aSepIndex + 1, aPathValue.Length()) : "";
|
||||
if (aCurPath.IsEmpty())
|
||||
continue;
|
||||
|
||||
aCurPath += "/../plugins";
|
||||
OSD_Path aPath (aCurPath);
|
||||
OSD_Directory aCurDir (aPath);
|
||||
if (aCurDir.Exists())
|
||||
{
|
||||
thePlugindsDirName = aCurPath;
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetVisible
|
||||
// purpose :
|
||||
|
Reference in New Issue
Block a user