]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
*** empty log message ***
authorvsr <vsr@opencascade.com>
Tue, 21 Aug 2007 09:30:32 +0000 (09:30 +0000)
committervsr <vsr@opencascade.com>
Tue, 21 Aug 2007 09:30:32 +0000 (09:30 +0000)
bin/runLightSalome.csh
bin/runLightSalome.sh

index 053654e5a4572e872407f103db0112cf2bc7c632..39c742dc829a50005f471036ad53112523902d83 100755 (executable)
 if ( ! $?LightAppConfig )    setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
 if ( ! $?LightAppResources ) setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
 
+###
+# default settings 
+###
+
+if (! ($?PATH) ) setenv PATH
+if (! ($?LD_LIBRARY_PATH) ) setenv LD_LIBRARY_PATH
+if (! ($?PYTHONPATH) ) setenv PYTHONPATH
+if (! ($?SALOMEPATH) ) setenv SALOMEPATH
+
 ###
 # process --modules=... command line option (get list of modules)
 ###
@@ -67,20 +76,70 @@ end
 # set additional environment
 ###
 
+set python_version=`python -c "import sys; print sys.version[:3]"`
+
+set MY_PATH=""
+set MY_LD_LIBRARY_PATH=""
+set MY_PYTHONPATH=""
+
 foreach mod ( $mods )
     if ( "$arg" != "X" ) then
        set root_dir=`printenv ${mod}_ROOT_DIR`
        if ( "$root_dir" != "" ) then
            set mod_lower=`echo $mod | tr "A-Z" "a-z"`
-           setenv PATH ${root_dir}/bin/salome:${PATH}
-           setenv LD_LIBRARY_PATH ${root_dir}/lib/salome:${LD_LIBRARY_PATH}
+           if ( -d ${root_dir}/bin/salome ) then
+               if ( "${MY_PATH}" == "" ) then
+                   set MY_PATH=${root_dir}/bin/salome
+               else
+                   set MY_PATH=${MY_PATH}:${root_dir}/bin/salome
+               endif
+           endif
+           if ( -d ${root_dir}/lib/salome ) then
+               if ( "${MY_LD_LIBRARY_PATH}" == "" ) then
+                   set MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
+               else
+                   set MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
+               endif
+           endif
+           if ( "${python_version}" != "" ) then
+               if ( -d ${root_dir}/bin/salome ) then
+                   if ( "${MY_PYTHONPATH}" == "" ) then
+                       set MY_PYTHONPATH=${root_dir}/bin/salome
+                   else
+                       set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
+                   endif
+               endif
+               if ( -d ${root_dir}/lib/salome ) then
+                   if ( "${MY_PYTHONPATH}" == "" ) then
+                       set MY_PYTHONPATH=${root_dir}/lib/salome
+                   else
+                       set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
+                   endif
+               endif
+               if ( -d ${root_dir}/lib/python${python_version}/site-packages/salome ) then 
+                   if ( "${MY_PYTHONPATH}" == "" ) then
+                       set MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
+                   else
+                       set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
+                   endif
+               endif
+           endif
            if ( "$mod" != "KERNEL" && "$mod" != "GUI" ) then
                setenv LightAppConfig ${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
            endif
+           if ( "${SALOMEPATH}" == "" ) then
+               setenv SALOMEPATH ${root_dir}
+           else
+               setenv SALOMEPATH ${SALOMEPATH}:${root_dir}
+           endif
        endif
     endif
 end
 
+if ( "${MY_PATH}" != "" ) setenv PATH ${MY_PATH}:${PATH}
+if ( "${MY_LD_LIBRARY_PATH}" != "" ) setenv LD_LIBRARY_PATH ${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+if ( "${PYTHONPATH}" != "" ) setenv PYTHONPATH ${MY_PYTHONPATH}:${PYTHONPATH}
+
 ###
 # start application
 ###
index ea135a94e89acc4afb8f69cea71df8797e997cba..cc2540a04c456aa6b5e3963768afc6b3d8e85eda 100755 (executable)
@@ -68,20 +68,76 @@ done
 # set additional environment
 ###
 
+python_version=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
+
+MY_PATH=""
+MY_LD_LIBRARY_PATH=""
+MY_PYTHONPATH=""
+
 for mod in $mods ; do
     if [ "$arg" != "X" ] ; then
        root_dir=`printenv ${mod}_ROOT_DIR`
        if [ "$root_dir" != "" ] ; then
            mod_lower=`echo $mod | tr "A-Z" "a-z"`
-           export PATH=${root_dir}/bin/salome:${PATH}
-           export LD_LIBRARY_PATH=${root_dir}/lib/salome:${LD_LIBRARY_PATH}
+           if [ -d ${root_dir}/bin/salome ] ; then
+               if [ "${MY_PATH}" == "" ] ; then
+                   MY_PATH=${root_dir}/bin/salome
+               else
+                   MY_PATH=${MY_PATH}:${root_dir}/bin/salome
+               fi
+           fi
+           if [ -d ${root_dir}/lib/salome ] ; then
+               if [ "${MY_LD_LIBRARY_PATH}" == "" ] ; then
+                   MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
+               else
+                   MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
+               fi
+           fi
+           if [ "${python_version}" != "" ] ; then
+               if [ -d ${root_dir}/bin/salome ] ; then
+                   if [ "${MY_PYTHONPATH}" == "" ] ; then
+                       MY_PYTHONPATH=${root_dir}/bin/salome
+                   else
+                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
+                   fi
+               fi
+               if [ -d ${root_dir}/lib/salome ] ; then
+                   if [ "${MY_PYTHONPATH}" == "" ] ; then
+                       MY_PYTHONPATH=${root_dir}/lib/salome
+                   else
+                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
+                   fi
+               fi
+               if [ -d ${root_dir}/lib/python${python_version}/site-packages/salome ] ; then 
+                   if [ "${MY_PYTHONPATH}" == "" ] ; then
+                       MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
+                   else
+                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
+                   fi
+               fi
+           fi
            if [ "$mod" != "KERNEL" ] && [ "$mod" != "GUI" ] ; then
                export LightAppConfig=${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
            fi
+           if [ "${SALOMEPATH}" == "" ] ; then
+               export SALOMEPATH=${root_dir}
+           else
+               export SALOMEPATH=${SALOMEPATH}:${root_dir}
+           fi
        fi
     fi
 done
 
+if [ "${MY_PATH}" != "" ] ; then
+    export PATH=${MY_PATH}:${PATH}
+fi
+if [ "${MY_LD_LIBRARY_PATH}" != "" ] ; then
+    export LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+fi
+if [ "${PYTHONPATH}" != "" ] ; then
+    export PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
+fi
+
 ###
 # start application
 ###