]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Synchronize adm files
authorinv <inv@opencascade.com>
Wed, 4 Dec 2013 08:44:55 +0000 (08:44 +0000)
committerinv <inv@opencascade.com>
Wed, 4 Dec 2013 08:44:55 +0000 (08:44 +0000)
adm_local_without_kernel/cmake_files/FindGraphviz.cmake
adm_local_without_kernel/cmake_files/FindSalomePython.cmake
adm_local_without_kernel/cmake_files/SalomeMacros.cmake

index 6eb1e5a71767dde06bb1fcac0053cc285629a88f..d25cffe6330423fc61081303eaca21cab8cffb2e 100644 (file)
@@ -35,19 +35,23 @@ FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h)
 SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz)
 
 FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY      NAMES cdt PATH_SUFFIXES bin)
-FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
 FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph PATH_SUFFIXES bin)
 FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc PATH_SUFFIXES bin)
 FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
 
 SET(GRAPHVIZ_LIBRARIES 
   ${GRAPHVIZ_cdt_LIBRARY}
-  ${GRAPHVIZ_cgraph_LIBRARY} 
   ${GRAPHVIZ_graph_LIBRARY} 
   ${GRAPHVIZ_gvc_LIBRARY}
   ${GRAPHVIZ_pathplan_LIBRARY}
   )
 
+## Don't detect cgraph on Windows
+#IF(NOT WIN32)
+#  FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
+#  SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_cgraph_LIBRARY})
+#ENDIF()
+
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS 
index 680f862a582704c0fd8923a80f8ec70600fe3ea7..9fa592048266be5e52432d58d08a8a613f0a9cd9 100644 (file)
@@ -74,6 +74,10 @@ SET(_found1 ${PYTHONINTERP_FOUND})
 IF (PYTHONINTERP_FOUND)
   # Now ensure we find the Python libraries matching the interpreter:
   # This uses the variable PYTHON_EXECUTABLE
+
+  GET_FILENAME_COMPONENT(_python_bin "${PYTHON_EXECUTABLE}" NAME )
+  SET(PYTHONBIN "${_python_bin}" CACHE STRING "Name of Python interpreter")
+
   GET_FILENAME_COMPONENT(_python_dir "${PYTHON_EXECUTABLE}" PATH)
   GET_FILENAME_COMPONENT(CMAKE_INCLUDE_PATH "${_python_dir}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
   GET_FILENAME_COMPONENT(CMAKE_LIBRARY_PATH "${_python_dir}/../lib" ABSOLUTE)
index a402d661b5f7a78c259128008b641d3fe8f864b5..f79dbcf526898a47c762a4f11d3d23f87306d168 100755 (executable)
@@ -801,32 +801,56 @@ ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT)
 # and puts this variable into <output> argument.
 #
 MACRO(SALOME_GENERATE_TESTS_ENVIRONMENT output)
-  SET(_env)
-  SET(_WIN_LD_LIBRARY OFF)
-  FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
-    IF(${_item} STREQUAL "LD_LIBRARY_PATH")
-      SET(_WIN_LD_LIBRARY ON)
-    ENDIF()
-    SET(_env_${_item})
-    FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
-      IF(WIN32)
-        SET(_env_${_item} "${_val};${_env_${_item}}")
-      ELSE()
-        SET(_env_${_item} "${_val}:${_env_${_item}}")
-      ENDIF()
-    ENDFOREACH()
-  ENDFOREACH()
+ SET(_env)
+ SET(_WIN_LD_LIBRARY OFF)
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+   IF(${_item} STREQUAL "LD_LIBRARY_PATH")
+     SET(_WIN_LD_LIBRARY ON)
+   ENDIF()
+   SET(_env_${_item})
+   FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
+     IF(WIN32)
+       STRING(REPLACE "/" "\\" _val "${_val}")
+       SET(_env_${_item} "${_val};${_env_${_item}}")
+     ELSE()
+       SET(_env_${_item} "${_val}:${_env_${_item}}")
+     ENDIF()
+   ENDFOREACH()
+ ENDFOREACH()
+
+ IF(_WIN_LD_LIBRARY AND WIN32)
+   SET(_env_PATH "${_env_PATH}$ENV{LD_LIBRARY_PATH};${_env_LD_LIBRARY_PATH}")
+ ENDIF()
+
+ IF(WIN32)
+   SET(sep ",")
+ ELSE()
+   SET(sep ";")
+ ENDIF()
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+   IF(WIN32)
+     IF(NOT ${_item} STREQUAL "LD_LIBRARY_PATH")
+       SET(_env "${_item}=$ENV{${_item}};${_env_${_item}}${sep}${_env}")
+     ENDIF()
+   ELSE()
+     SET(_env "${_item}=$ENV{${_item}}:${_env_${_item}}${sep}${_env}")
+   ENDIF()
+ ENDFOREACH()
+
+ # Get module name as substring of "Salome<ModuleName>"
+ STRING(SUBSTRING "${PROJECT_NAME}" 6 -1 PRNAME) 
+ SET(_env "${PRNAME}_ROOT_DIR=${CMAKE_INSTALL_PREFIX}${sep}${_env}")
+  
+ # Creating follow string for Windows environement:
+ # "VAR1_ENV=1\;2\;3\;...\;...\;...;VAR2_ENV=1\;2\;3\;...\;...\;...;VAR3_ENV=1\;2\;3\;...\;...\;...;..."
+ IF(WIN32)
+   STRING(REGEX REPLACE "\\\\*;" "\\\\;" _env "${_env}")
+   STRING(REGEX REPLACE "\\\\*;*," ";" _env "${_env}")
+ ENDIF()
 
-  IF(_WIN_LD_LIBRARY AND WIN32)
-    SET(_env_PATH "${_env_PATH} ${_env_LD_LIBRARY_PATH}")
-  ENDIF()
+ SET(${output} "${_env}")
 
-  FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
-    IF(NOT(WIN32 AND ${_item} STREQUAL "LD_LIBRARY_PATH"))
-      SET(_env "${_item}=${_env_${_item}} ${_env}")
-    ENDIF()
-  ENDFOREACH()
-  SET(${output} ${_env})  
 ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT) 
 
 #########################################################################
@@ -847,7 +871,8 @@ MACRO(SALOME_APPEND_LIST_OF_LIST result element_list)
   SET(_tmp_res)
   STRING(REPLACE ";" "," _tmp_res "${${element_list}}")
 
-  LIST(LENGTH result _list_len)
+  # Yet another CMake stupidity - LIST(LENGTH ";" var) returns 0
+  STRING(LENGTH result _list_len)
   IF(NOT _list_len EQUAL 0)
     SET(${result} "${${result}}${_tmp_res};")  # LIST(APPEND ...) doesn't handle well empty elements!?
   ELSE()