]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Build Shaper on Fedora 26 with native prerequsites. V8_5_0rc2
authorrnv <rnv@opencascade.com>
Mon, 28 May 2018 13:04:39 +0000 (16:04 +0300)
committerrnv <rnv@opencascade.com>
Mon, 28 May 2018 13:04:39 +0000 (16:04 +0300)
CMakeCommon/FindPython.cmake

index d48364e6797550c9b3aa2e5c7f2ebb3d2fbf4376..e48b6c206a10b729b18c512bde81b071b6368f0a 100644 (file)
@@ -13,15 +13,19 @@ ElSE()
     SET(PYTHON_LIBRARY_FILE "libpython2.7.so")
 ENDIF()
 
-IF(WIN32)
-  FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/libs/${PYTHON_LIBRARY_FILE}" PATH_PYTHON_LIBRARY)
-ElSE()
-  FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/lib/${PYTHON_LIBRARY_FILE}" PATH_PYTHON_LIBRARY)
+IF($ENV{PYTHONHOME})
+  IF(WIN32)
+    FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/libs/${PYTHON_LIBRARY_FILE}" PATH_PYTHON_LIBRARY)
+  ElSE()
+    FILE(TO_CMAKE_PATH "$ENV{PYTHONHOME}/lib/${PYTHON_LIBRARY_FILE}" PATH_PYTHON_LIBRARY)
+  ENDIF()
+  SET(PYTHON_LIBRARY ${PATH_PYTHON_LIBRARY} CACHE FILEPATH "path to the python library" FORCE)
 ENDIF()
-FILE(TO_CMAKE_PATH $ENV{PYTHON_INCLUDE} PATH_PYTHON_INCLUDE_DIR)
 
-SET(PYTHON_INCLUDE_DIR ${PATH_PYTHON_INCLUDE_DIR} CACHE PATH "path to where Python.h is found" FORCE)
-SET(PYTHON_LIBRARY ${PATH_PYTHON_LIBRARY} CACHE FILEPATH "path to the python library" FORCE)
+IF($ENV{PYTHON_INCLUDE})
+  FILE(TO_CMAKE_PATH $ENV{PYTHON_INCLUDE} PATH_PYTHON_INCLUDE_DIR)
+  SET(PYTHON_INCLUDE_DIR ${PATH_PYTHON_INCLUDE_DIR} CACHE PATH "path to where Python.h is found" FORCE)
+ENDIF()
 
 FIND_PACKAGE(PythonLibs REQUIRED)
 FIND_PACKAGE(PythonInterp REQUIRED)