]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #1321 : remove dependency on additional environment variables
authormpv <mpv@opencascade.com>
Wed, 4 May 2016 09:01:45 +0000 (12:01 +0300)
committermpv <mpv@opencascade.com>
Wed, 4 May 2016 09:01:45 +0000 (12:01 +0300)
CMakeCommon/UnitTest.cmake
doc/tui/CMakeLists.txt
env_Salome.bat
env_linux.sh
src/Config/Config_XMLReader.cpp
src/Config/Config_XMLReader.h
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp

index 34cdeba1bd7db452f56a5edb7cc5b6be218e05c4..1a69191c0e62f7c374bad5eb81d6e1737e51d463 100644 (file)
@@ -54,10 +54,10 @@ MACRO(ADD_UNIT_TESTS)
                COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
       if (WIN32) # different path to libraries variable name
         SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
-               ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH};PLUGINS_CONFIG_FILE=${_CONFIG_FILE}")
+               ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH}")
       else()
         SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
-               ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};PLUGINS_CONFIG_FILE=${_CONFIG_FILE}")
+               ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH}")
       endif()
       # Debug output...
       #MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
index 2c0f54b346fd80f9487ca7a363d00e90d1b7a610..9ff4df7c961f8cb77336dcedb0374428bd562cf6 100644 (file)
@@ -21,4 +21,5 @@ ADD_CUSTOM_TARGET(dev_docs
     COMMAND "${CMAKE_COMMAND}" --build "${PROJECT_BINARY_DIR}" --target install --config ${CMAKE_BUILD_TYPE}
     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc/tui"
 )
+
 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tui/ DESTINATION ${SHAPER_INSTALL_TUI_DOC} OPTIONAL)
index 6b00e790bae0dd6a565b0dfba0325bc93f93605b..980ed7b0326d9a2cd3c20cc8dc7e08132a5b7325 100644 (file)
@@ -99,10 +99,8 @@ IF "%ARCH%" == "Win64" (
   )
 )
 
-@SET PLUGINS_CONFIG_FILE=%ROOT_DIR%\install\share\salome\resources\shaper
 @SET SHAPER_ROOT_DIR=%ROOT_DIR%\install
 @SET PATH=%SHAPER_ROOT_DIR%\bin\salome;%SHAPER_ROOT_DIR%\lib\salome;%PATH%
 @SET PYTHONPATH=%SHAPER_ROOT_DIR%\bin\salome;%SHAPER_ROOT_DIR%\lib\salome;%PYTHONPATH%
 
 @SET LightAppConfig=%SHAPER_ROOT_DIR%\share\salome\resources\shaper;%GUI_ROOT_DIR%\share\salome\resources\gui
-@SET SHAPERResources=%SHAPER_ROOT_DIR%\share\salome\resources\shaper
index d7f2e2f722ed2588cb1afedc7b4466d389bb3753..c376a2059cd44cc8a48e5aa9fe8c6e381e1c12cf 100644 (file)
@@ -55,5 +55,3 @@ export PATH=${CASROOT}:${PATH}
 export PATH=${SHAPER_ROOT_DIR}/bin/salome:${SHAPER_ROOT_DIR}/lib/salome:${PATH}
 export PYTHONPATH=${SHAPER_ROOT_DIR}//bin/salome:${SHAPER_ROOT_DIR}/lib/salome:${PYTHONPATH}
 export LD_LIBRARY_PATH=${SHAPER_ROOT_DIR}/bin/salome:${SHAPER_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
-export PLUGINS_CONFIG_FILE=${SHAPER_ROOT_DIR}/share/salome/resources/shaper
-export SHAPERResources=${SHAPER_ROOT_DIR}/share/salome/resources/shaper
index 11b2c5890eb34708c28062d3038acc30585e477c..0f36a154867dc7635377ef82d6d840492743a6b1 100644 (file)
@@ -62,10 +62,20 @@ Config_XMLReader::~Config_XMLReader()
 std::string Config_XMLReader::pluginConfigFile()
 {
   std::string aValue;
-  char* anEnv = getenv("PLUGINS_CONFIG_FILE");
+  char* anEnv = getenv("SHAPER_ROOT_DIR");
   if (anEnv) {
     aValue = std::string(anEnv);
+  } else {
+    anEnv = getenv("OPENPARTS_ROOT_DIR");
+    if (anEnv)
+      aValue = std::string(anEnv);
   }
+#ifdef WIN32
+    aValue += "\\";
+#else
+    aValue += "/";
+#endif
+  aValue += "plugins";
   return aValue;
 }
 
index c983e3a49f3304279acf0acb97b4b33ddb3870b1..62173af3155810e23726be7d22f34d3633e1fc87 100644 (file)
@@ -44,7 +44,7 @@ class Config_XMLReader
   CONFIG_EXPORT Config_XMLReader(const std::string& theXmlFile);
   CONFIG_EXPORT virtual ~Config_XMLReader();
   /*!
-   * Returns value of PLUGINS_CONFIG_FILE env variable, a path to the plugins.xml file
+   * Returns a path to the plugins.xml file (created from ROOT_DIR environment variable)
    * \return string value
    */
   CONFIG_EXPORT static std::string pluginConfigFile();
index 73c43f7175673078f933a06f276a38cbc4922859..ad415c53a5d75abd2f790ef593180e8200620750 100644 (file)
@@ -273,16 +273,24 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon()
     return myIconsMap[iconName()];
   }
   // Load icon for the presentation
-  char* aEnv = getenv("SHAPERResources");
-  if (aEnv != NULL) {
-    TCollection_AsciiString aFile(aEnv);
-    aFile += FSEP;
-    aFile += iconName();
-    Handle(Image_AlienPixMap) aPixMap = new Image_AlienPixMap();
-    if (aPixMap->Load(aFile)) {
-      myIconsMap[iconName()] = aPixMap;
-      return aPixMap;
-    }
+  std::string aFile;
+  char* anEnv = getenv("SHAPER_ROOT_DIR");
+  if (anEnv) {
+    aFile = std::string(anEnv);
+  } else {
+    anEnv = getenv("OPENPARTS_ROOT_DIR");
+    if (anEnv)
+      aFile = std::string(anEnv);
+  }
+  aFile += FSEP;
+  aFile += "resources";
+
+  aFile += FSEP;
+  aFile += iconName();
+  Handle(Image_AlienPixMap) aPixMap = new Image_AlienPixMap();
+  if (aPixMap->Load(aFile.c_str())) {
+    myIconsMap[iconName()] = aPixMap;
+    return aPixMap;
   }
   // The icon for constraint is not found
   static const char aMsg[] = "Error! constraint images are not found";