From 69fd7a49ef98203d9e514cf52e3f7c6c0c2211c7 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 21 Aug 2007 09:30:32 +0000 Subject: [PATCH] *** empty log message *** --- bin/runLightSalome.csh | 63 ++++++++++++++++++++++++++++++++++++++++-- bin/runLightSalome.sh | 60 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 119 insertions(+), 4 deletions(-) diff --git a/bin/runLightSalome.csh b/bin/runLightSalome.csh index 053654e5a..39c742dc8 100755 --- a/bin/runLightSalome.csh +++ b/bin/runLightSalome.csh @@ -30,6 +30,15 @@ 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 ### diff --git a/bin/runLightSalome.sh b/bin/runLightSalome.sh index ea135a94e..cc2540a04 100755 --- a/bin/runLightSalome.sh +++ b/bin/runLightSalome.sh @@ -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 ### -- 2.39.2