From: nri Date: Thu, 22 May 2003 13:39:09 +0000 (+0000) Subject: NRI : Add KERNEL_ROOT_DIR in addition to SALOME_[ROOT, SITE]_DIR. X-Git-Tag: V1_4_0~100 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8c0d86ffe14acb708877b1556027d7f817b089ce;p=modules%2Fkernel.git NRI : Add KERNEL_ROOT_DIR in addition to SALOME_[ROOT, SITE]_DIR. --- diff --git a/bin/runSalome.in b/bin/runSalome.in index d1a3d4bde..9d08bdd32 100644 --- a/bin/runSalome.in +++ b/bin/runSalome.in @@ -4,6 +4,22 @@ PYTHON_VERSION=python@PYTHON_VERSION@ # you must define SALOME_ROOT_DIR and SALOME_SITE_DIR (if you need it) +if test -n KERNEL_ROOT_DIR +then + export PATH=$KERNEL_ROOT_DIR/bin/salome:${PATH} + export LD_LIBRARY_PATH=$KERNEL_ROOT_DIR/lib/salome:${LD_LIBRARY_PATH} + export PYTHONPATH=${KERNEL_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/$PYTHON_VERSION/site-packages/salome:${KERNEL_ROOT_DIR}/share/salome/resources:${PYTHONPATH} + # add bin, because some script are in (KERNEL_SWIG) !!!! + export PYTHONPATH=${KERNEL_ROOT_DIR}/bin/salome:${PYTHONPATH} + echo "#############################################" + echo $PATH + echo "------------------------" + echo $LD_LIBRARY_PATH + echo "------------------------" + echo $PYTHONPATH + echo "#############################################" +fi + if test -n $SALOME_ROOT_DIR then export PATH=$SALOME_ROOT_DIR/bin/salome:${PATH} @@ -83,7 +99,7 @@ SALOME_Session_Server& #sleep 2 echo "Starting runNotify.sh" -notifd -c ${SALOME_ROOT_DIR}/share/salome/resources/channel.cfg -DFactoryIORFileName=/tmp/${LOGNAME}_rdifact.ior -DChannelIORFileName=/tmp/${LOGNAME}_rdichan.ior& +notifd -c ${KERNEL_ROOT_DIR}/share/salome/resources/channel.cfg -DFactoryIORFileName=/tmp/${LOGNAME}_rdifact.ior -DChannelIORFileName=/tmp/${LOGNAME}_rdichan.ior& echo "SALOME_Container FactoryServer -ORBInitRef NameService=corbaname::localhost" SALOME_Container FactoryServer -ORBInitRef NameService=corbaname::localhost & diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index 3d0ea1507..5baa010df 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -2512,6 +2512,25 @@ void QAD_Desktop::onDispatchTools(int id) dir = dir + "libToolsGUI.dll" ; #else dir = dir + "libToolsGUI.so" ; +#endif + MESSAGE ( " GUI library = " << dir ); + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ToolsLib = fileInfo.fileName() ; + found = true; + } + } + + if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; +#ifdef WNT + dir = dir + "libToolsGUI.dll" ; +#else + dir = dir + "libToolsGUI.so" ; #endif MESSAGE ( " GUI library = " << dir ); fileInfo.setFile(dir) ; @@ -2553,6 +2572,21 @@ void QAD_Desktop::onDispatchTools(int id) found = true; } } + + if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + QAD_XmlHandler::_bibmap[ id ].latin1() ; + MESSAGE ( " GUI library = " << dir ); + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ToolsLib = fileInfo.fileName() ; + found = true; + } + } } ToolsLibrary.SetName(TCollection_AsciiString((char*)ToolsLib.latin1()).ToCString()); diff --git a/src/SALOMEGUI/QAD_RightFrame.cxx b/src/SALOMEGUI/QAD_RightFrame.cxx index feb272649..b7a30e2b4 100644 --- a/src/SALOMEGUI/QAD_RightFrame.cxx +++ b/src/SALOMEGUI/QAD_RightFrame.cxx @@ -81,6 +81,27 @@ QAD_RightFrame::QAD_RightFrame(QWidget *parent, const char *name, dir = dir + "libOCCViewer.dll" ; #else dir = dir + "libOCCViewer.so" ; +#endif + MESSAGE ( " GUI library = " << dir ) + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ComponentLib = fileInfo.fileName(); + found = true; + MESSAGE (" Found ") + } else + MESSAGE (" Not found ") + } + + if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; +#ifdef WNT + dir = dir + "libOCCViewer.dll" ; +#else + dir = dir + "libOCCViewer.so" ; #endif MESSAGE ( " GUI library = " << dir ) fileInfo.setFile(dir) ; @@ -124,6 +145,27 @@ QAD_RightFrame::QAD_RightFrame(QWidget *parent, const char *name, dir = dir + "libVTKViewer.dll" ; #else dir = dir + "libVTKViewer.so" ; +#endif + MESSAGE ( " GUI library = " << dir ); + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ComponentLib = fileInfo.fileName(); + found = true; + MESSAGE (" Found "); + } else + MESSAGE (" Not found "); + } + + if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; +#ifdef WNT + dir = dir + "libVTKViewer.dll" ; +#else + dir = dir + "libVTKViewer.so" ; #endif MESSAGE ( " GUI library = " << dir ); fileInfo.setFile(dir) ; @@ -166,6 +208,27 @@ QAD_RightFrame::QAD_RightFrame(QWidget *parent, const char *name, dir = dir + "libSUPERVGraph.dll" ; #else dir = dir + "libSUPERVGraph.so" ; +#endif + MESSAGE ( " GUI library = " << dir ) + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ComponentLib = fileInfo.fileName() ; + found = true; + MESSAGE (" Found ") + } else + MESSAGE (" Not found ") + } + + if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; +#ifdef WNT + dir = dir + "libSUPERVGraph.dll" ; +#else + dir = dir + "libSUPERVGraph.so" ; #endif MESSAGE ( " GUI library = " << dir ) fileInfo.setFile(dir) ; @@ -208,6 +271,27 @@ QAD_RightFrame::QAD_RightFrame(QWidget *parent, const char *name, dir = dir + "libPlot2d.dll" ; #else dir = dir + "libPlot2d.so" ; +#endif + MESSAGE ( " GUI library = " << dir ) + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ComponentLib = fileInfo.fileName() ; + found = true; + MESSAGE (" Found ") + } else + MESSAGE (" Not found ") + } + + if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) { + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "salome" ; + dir = QAD_Tools::addSlash(dir) ; +#ifdef WNT + dir = dir + "libPlot2d.dll" ; +#else + dir = dir + "libPlot2d.so" ; #endif MESSAGE ( " GUI library = " << dir ) fileInfo.setFile(dir) ; diff --git a/src/SALOMEGUI/SALOMEGUI_Application.cxx b/src/SALOMEGUI/SALOMEGUI_Application.cxx index 437d6f054..56fc4e2b6 100644 --- a/src/SALOMEGUI/SALOMEGUI_Application.cxx +++ b/src/SALOMEGUI/SALOMEGUI_Application.cxx @@ -480,6 +480,27 @@ void SALOMEGUI_Application::onDisplay(int id) MESSAGE ( " Not found " ) } } + if ( !found && getenv("KERNEL_ROOT_DIR") ) { + dir.fill('\0'); + dir.sprintf("%s", getenv("KERNEL_ROOT_DIR")); + dir = QAD_Tools::addSlash(dir) ; + dir = dir + "lib" ; + dir = QAD_Tools::addSlash(dir) ; +#ifdef WNT + dir = dir + "lib" + parentComp.latin1() + "GUI.dll" ; +#else + dir = dir + "lib" + parentComp.latin1() + "GUI.so" ; +#endif + MESSAGE ( " GUI library = " << dir ) + fileInfo.setFile(dir) ; + if (fileInfo.exists()) { + ComponentLib = fileInfo.fileName() ; + found = true; + MESSAGE ( " found " ) + } else { + MESSAGE ( " Not found " ) + } + } if (ComponentLib.isEmpty()) { waitCursor.stop(); diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx index 30cb959ee..970b0d591 100644 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx @@ -324,7 +324,17 @@ void ToolsGUI_CatalogGeneratorDlg::onApply() tr ("TOOLS_BUT_OK") ); } else { - QString command = QString( getenv( "SALOME_ROOT_DIR" ) ) + "/bin/runIDLparser -Wbcatalog=" + XmlFile; + QString command = ""; + if ( getenv("SALOME_ROOT_DIR") ) + command = QString( getenv( "SALOME_ROOT_DIR" ) ) + "/bin/runIDLparser -Wbcatalog=" + XmlFile; + else if ( getenv("KERNEL_ROOT_DIR") ) + command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/runIDLparser -Wbcatalog=" + XmlFile; + else { + QAD_MessageBox::error1( this, + tr("TOOLS_ERR_ERROR"), + tr("SALOME_ROOT_DIR or KERNEL_ROOT_DIR variables are not defined"), + tr("TOOLS_BUT_OK") ); + } if (!Author.isEmpty()) command += ",author=" + Author; if (!Version.isEmpty()) command += ",version=" + Version; if (!PngFile.isEmpty()) {