From 2ae64986409ea51912b379a5defe1c8dfb01645a Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Mon, 18 Sep 2023 12:59:39 +0200 Subject: [PATCH] bos #37534: - load SalomePythonInterp if not already loaded - Handle Windows case --- cmake/FindSalomeBootstrap.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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}") -- 2.39.2