From: Nabil Ghodbane Date: Mon, 18 Sep 2023 10:59:39 +0000 (+0200) Subject: bos #37534: X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ae64986409ea51912b379a5defe1c8dfb01645a;p=tools%2Fconfiguration.git bos #37534: - load SalomePythonInterp if not already loaded - Handle Windows case --- diff --git a/cmake/FindSalomeBootstrap.cmake b/cmake/FindSalomeBootstrap.cmake index 6e4ffcd..67b944f 100644 --- a/cmake/FindSalomeBootstrap.cmake +++ b/cmake/FindSalomeBootstrap.cmake @@ -18,10 +18,19 @@ # 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}")