Salome HOME
CMake:
authormpa <mpa@opencascade.com>
Tue, 29 Oct 2013 08:32:59 +0000 (08:32 +0000)
committermpa <mpa@opencascade.com>
Tue, 29 Oct 2013 08:32:59 +0000 (08:32 +0000)
- Accumulate environment variables, to be used later to run some command in proper environment.

CMakeLists.txt
SalomeSMESHConfig.cmake.in
adm_local/cmake_files/FindSalomeCGNS.cmake
adm_local/cmake_files/FindSalomeSMESH.cmake
adm_local/cmake_files/FindSalomeTBB.cmake
adm_local/cmake_files/FindSalomef2c.cmake

index 2a53533..ed90b46 100755 (executable)
@@ -240,6 +240,12 @@ MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
 MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
 MARK_AS_ADVANCED(SALOME_SMESH_INSTALL_RES_DATA SALOME_SMESH_INSTALL_PLUGINS)
 
+# Accumulate environment variables for SMESH module
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
+                                         ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
+                                         ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
+SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) 
+
 # Sources 
 # ========
 
index c875e75..c4417cb 100644 (file)
@@ -46,6 +46,9 @@ SET_AND_CHECK(SMESH_INCLUDE_DIRS "${SMESH_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@
 SET(SMESH_INCLUDE_DIRS "${SMESH_INCLUDE_DIRS};@_SalomeSMESH_EXTRA_HEADERS@")
 SET(SMESH_DEFINITIONS "@GEOM_DEFINITIONS@")
 
+# Package specific environment variables
+@_SalomeSMESH_EXTRA_ENV_FULL@
+
 #### Now the specificities
 
 # Options exported by the package:
index 26517fd..2974e73 100644 (file)
@@ -20,4 +20,8 @@
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(CGNS CGNS_INCLUDE_DIRS 1)
 MARK_AS_ADVANCED(CGNS_INCLUDE_DIRS CGNS_LIBRARIES)
 
-SALOME_ACCUMULATE_HEADERS(CGNS_INCLUDE_DIRS)
+IF(CGNS_FOUND) 
+  SALOME_ACCUMULATE_HEADERS(CGNS_INCLUDE_DIRS)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${CGNS_ROOT_DIR}/bin)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CGNS_ROOT_DIR}/lib)
+ENDIF()
\ No newline at end of file
index c316f9d..ac29b1a 100644 (file)
@@ -29,3 +29,7 @@ SALOME_FIND_PACKAGE(SalomeSMESH SalomeSMESH CONFIG)
 IF(NOT SalomeSMESH_FIND_QUIETLY)
   MESSAGE(STATUS "Found Salome SMESH: ${SMESH_ROOT_DIR}")
 ENDIF()
+
+FOREACH(_res ${SalomeSMESH_EXTRA_ENV})
+  SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeSMESH_EXTRA_ENV_${_res}}")
+ENDFOREACH()
\ No newline at end of file
index 2b9dcd5..65b2851 100644 (file)
@@ -20,4 +20,8 @@
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(TBB TBB_INCLUDE_DIRS 2)
 MARK_AS_ADVANCED(TBB_INCLUDE_DIRS TBB_LIBRARIES)
 
-SALOME_ACCUMULATE_HEADERS(TBB_INCLUDE_DIRS)
+IF(TBB_FOUND) 
+  SALOME_ACCUMULATE_HEADERS(TBB_INCLUDE_DIRS)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${TBB_ROOT_DIR}/bin/intel64/cc4.1.0_libc2.4_kernel2.6.16.21)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${TBB_LIBRARIES})
+ENDIF()
\ No newline at end of file
index 1478d2d..dcaf893 100755 (executable)
@@ -20,4 +20,7 @@
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(f2c f2c_INCLUDE_DIRS 0)
 MARK_AS_ADVANCED(F2C_INCLUDE_DIRS F2C_LIBRARIES F2C_GENERATOR)
 
-SALOME_ACCUMULATE_HEADERS(F2C_INCLUDE_DIRS)
\ No newline at end of file
+IF(F2C_FOUND)
+  SALOME_ACCUMULATE_HEADERS(F2C_INCLUDE_DIRS)
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${F2C_LIBRARIES}) 
+ENDIF()
\ No newline at end of file