mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-08 02:27:26 +05:00
Patch for MacOS (from SALOME forum)
This commit is contained in:
parent
84e542cbbe
commit
02b418c3b2
@ -257,13 +257,19 @@ GEOMGUI* GeometryGUI::getLibrary( const QString& libraryName )
|
|||||||
{
|
{
|
||||||
if ( !myGUIMap.contains( libraryName ) ) {
|
if ( !myGUIMap.contains( libraryName ) ) {
|
||||||
// try to load library if it is not loaded yet
|
// try to load library if it is not loaded yet
|
||||||
#ifndef WIN32
|
#if defined(WIN32)
|
||||||
QString dirs = getenv( "LD_LIBRARY_PATH" );
|
|
||||||
QString sep = ":";
|
|
||||||
#else
|
|
||||||
QString dirs = getenv( "PATH" );
|
QString dirs = getenv( "PATH" );
|
||||||
QString sep = ";";
|
#elif defined(__APPLE__)
|
||||||
|
QString dirs = getenv( "DYLD_LIBRARY_PATH" );
|
||||||
|
#else
|
||||||
|
QString dirs = getenv( "LD_LIBRARY_PATH" );
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(WIN32)
|
||||||
|
QString sep = ";";
|
||||||
|
#else
|
||||||
|
QString sep = ":";
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( !dirs.isEmpty() ) {
|
if ( !dirs.isEmpty() ) {
|
||||||
QStringList dirList = dirs.split(sep, QString::SkipEmptyParts ); // skip empty entries
|
QStringList dirList = dirs.split(sep, QString::SkipEmptyParts ); // skip empty entries
|
||||||
QListIterator<QString> it( dirList ); it.toBack();
|
QListIterator<QString> it( dirList ); it.toBack();
|
||||||
@ -301,13 +307,20 @@ GEOMPluginGUI* GeometryGUI::getPluginLibrary( const QString& libraryName )
|
|||||||
{
|
{
|
||||||
if ( !myGUIMap.contains( libraryName ) ) {
|
if ( !myGUIMap.contains( libraryName ) ) {
|
||||||
// try to load library if it is not loaded yet
|
// try to load library if it is not loaded yet
|
||||||
#ifndef WIN32
|
|
||||||
QString dirs = getenv( "LD_LIBRARY_PATH" );
|
#if defined(WIN32)
|
||||||
QString sep = ":";
|
|
||||||
#else
|
|
||||||
QString dirs = getenv( "PATH" );
|
QString dirs = getenv( "PATH" );
|
||||||
QString sep = ";";
|
#elif defined(__APPLE__)
|
||||||
|
QString dirs = getenv( "DYLD_LIBRARY_PATH" );
|
||||||
|
#else
|
||||||
|
QString dirs = getenv( "LD_LIBRARY_PATH" );
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(WIN32)
|
||||||
|
QString sep = ";";
|
||||||
|
#else
|
||||||
|
QString sep = ":";
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( !dirs.isEmpty() ) {
|
if ( !dirs.isEmpty() ) {
|
||||||
QStringList dirList = dirs.split(sep, QString::SkipEmptyParts ); // skip empty entries
|
QStringList dirList = dirs.split(sep, QString::SkipEmptyParts ); // skip empty entries
|
||||||
QListIterator<QString> it( dirList ); it.toBack();
|
QListIterator<QString> it( dirList ); it.toBack();
|
||||||
@ -698,10 +711,12 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
|
|||||||
|
|
||||||
GEOMPluginGUI* library = 0;
|
GEOMPluginGUI* library = 0;
|
||||||
if ( !libName.isEmpty() ) {
|
if ( !libName.isEmpty() ) {
|
||||||
#ifndef WIN32
|
#if defined(WIN32)
|
||||||
libName = QString( "lib" ) + libName + ".so";
|
|
||||||
#else
|
|
||||||
libName = libName + ".dll";
|
libName = libName + ".dll";
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
libName = QString( "lib" ) + libName + ".dylib";
|
||||||
|
#else
|
||||||
|
libName = QString( "lib" ) + libName + ".so";
|
||||||
#endif
|
#endif
|
||||||
library = getPluginLibrary( libName );
|
library = getPluginLibrary( libName );
|
||||||
}
|
}
|
||||||
@ -727,10 +742,12 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
|
|||||||
|
|
||||||
GEOMGUI* library = 0;
|
GEOMGUI* library = 0;
|
||||||
if ( !libName.isEmpty() ) {
|
if ( !libName.isEmpty() ) {
|
||||||
#ifndef WIN32
|
#if defined(WIN32)
|
||||||
libName = QString( "lib" ) + libName + ".so";
|
|
||||||
#else
|
|
||||||
libName = libName + ".dll";
|
libName = libName + ".dll";
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
libName = QString( "lib" ) + libName + ".dylib";
|
||||||
|
#else
|
||||||
|
libName = QString( "lib" ) + libName + ".so";
|
||||||
#endif
|
#endif
|
||||||
library = getLibrary( libName );
|
library = getLibrary( libName );
|
||||||
}
|
}
|
||||||
|
@ -2499,12 +2499,15 @@ GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(CORBA::Long theStudyI
|
|||||||
void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
|
void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
|
||||||
{
|
{
|
||||||
std::string aPlatformLibName;
|
std::string aPlatformLibName;
|
||||||
#ifdef WIN32
|
#if !defined(WIN32)
|
||||||
aPlatformLibName = theLibName;
|
|
||||||
aPlatformLibName += ".dll" ;
|
|
||||||
#else
|
|
||||||
aPlatformLibName = "lib";
|
aPlatformLibName = "lib";
|
||||||
|
#endif
|
||||||
aPlatformLibName += theLibName;
|
aPlatformLibName += theLibName;
|
||||||
|
#if defined(WIN32)
|
||||||
|
aPlatformLibName += ".dll" ;
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
aPlatformLibName += ".dylib";
|
||||||
|
#else
|
||||||
aPlatformLibName += ".so";
|
aPlatformLibName += ".so";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user