]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
bos #37534:
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 18 Sep 2023 10:59:39 +0000 (12:59 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 20 Feb 2024 07:48:16 +0000 (08:48 +0100)
 - load SalomePythonInterp if not already loaded
 - Handle Windows case

cmake/FindSalomeBootstrap.cmake

index 6e4ffcdce6687bf76c5212674240846c44ff0800..67b944f1cde1367e1096e8e0535d68f35b2f3419 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+IF (NOT SALOMEPYTHONINTERP_FOUND)
+  MESSAGE(STATUS "Loading SALOME Python environment")
+  FIND_PACKAGE(SalomePythonInterp REQUIRED)
+ENDIF(NOT SALOMEPYTHONINTERP_FOUND)
+
 SET(SALOMEBOOTSTRAP_ROOT_DIR "$ENV{SALOMEBOOTSTRAP_ROOT_DIR}")
-SET(ENV{PYTHONPATH} "${SALOMEBOOTSTRAP_ROOT_DIR}/__SALOME_BOOTSTRAP__:$ENV{PYTHONPATH}")
+IF(WIN32 AND NOT CYGWIN)
+  SET(ENV{PYTHONPATH} "${SALOMEBOOTSTRAP_ROOT_DIR}\\__SALOME_BOOTSTRAP__;$ENV{PYTHONPATH}")
+ELSE()
+  SET(ENV{PYTHONPATH} "${SALOMEBOOTSTRAP_ROOT_DIR}/__SALOME_BOOTSTRAP__:$ENV{PYTHONPATH}")
+ENDIF()
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import SalomeOnDemandTK; print(SalomeOnDemandTK.__version__)" OUTPUT_VARIABLE SALOMEBOOTSTRAP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-EXECUTE_PROCESS(COMMAND python3 -c "import SalomeOnDemandTK; print(SalomeOnDemandTK.__version__)" OUTPUT_VARIABLE SALOMEBOOTSTRAP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
 IF(SALOMEBOOTSTRAP_VERSION)
   SET(SALOMEBOOTSTRAP_FOUND TRUE)
   MESSAGE(STATUS "Found Salome Bootstrap version ${SALOMEBOOTSTRAP_VERSION}")