- Accumulate environment variables, to be used later to run some command in proper environment.
CONFIGURE_FILE(VERSION.in VERSION @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ${SALOME_INSTALL_BINS})
+# Accumulate environment variables for MED module
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
+ ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
+SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
+
+
# Sources
# ========
IF(WIN32)
SET(MED_INCLUDE_DIRS "${MED_INCLUDE_DIRS};@_SalomeMED_EXTRA_HEADERS@")
SET(MED_DEFINITIONS)
+# Package specific environment variables
+@_SalomeMED_EXTRA_ENV_FULL@
+
#### Now the specificities
# Options exported by the package:
IF(NOT SalomeMED_FIND_QUIETLY)
MESSAGE(STATUS "Found Salome MED: ${MED_ROOT_DIR}")
ENDIF()
+
+FOREACH(_res ${SalomeMED_EXTRA_ENV})
+ SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeMED_EXTRA_ENV_${_res}}")
+ENDFOREACH()
\ No newline at end of file
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Metis METIS_INCLUDE_DIRS 1)
#MARK_AS_ADVANCED()
-SALOME_ACCUMULATE_HEADERS(METIS_INCLUDE_DIRS)
+IF(METIS_FOUND)
+ SALOME_ACCUMULATE_HEADERS(METIS_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${METIS_LIBRARIES})
+ENDIF()
\ No newline at end of file
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParMetis PARMETIS_INCLUDE_DIRS 1)
#MARK_AS_ADVANCED()
-SALOME_ACCUMULATE_HEADERS(PARMETIS_INCLUDE_DIRS)
\ No newline at end of file
+IF(PARMETIS_FOUND)
+ SALOME_ACCUMULATE_HEADERS(PARMETIS_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PARMETIS_LIBRARIES})
+ENDIF()
\ No newline at end of file
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Scotch SCOTCH_INCLUDE_DIRS 1)
#MARK_AS_ADVANCED()
-SALOME_ACCUMULATE_HEADERS(SCOTCH_INCLUDE_DIRS)
\ No newline at end of file
+IF(SCOTCH_FOUND)
+ SALOME_ACCUMULATE_HEADERS(SCOTCH_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SCOTCH_LIBRARIES})
+ENDIF()
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(XDR XDR_FOUND 1)
#MARK_AS_ADVANCED()
-#SALOME_ACCUMULATE_HEADERS(XDR_INCLUDE_DIRS) # useless here because XDR is used only in CXX of MEDLoader
+#IF(XDR_FOUND) # useless here because XDR is used only in CXX of MEDLoader
+# SALOME_ACCUMULATE_HEADERS(XDR_INCLUDE_DIRS)
+# SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${XDR_LIBRARIES})
+#ENDIF()
\ No newline at end of file