Salome HOME
CMake: Python detection was not always seting PYTHON_ROOT_DIR!
[modules/yacs.git] / salome_adm / cmake_files / FindSalomePython.cmake
index d7e2ba8240d8a428e21a7dcafc7498cae0c452fe..7704148dec791bb16076d8ea11de7b4ec993b314 100644 (file)
@@ -45,12 +45,12 @@ ENDIF()
 SET(PYTHON_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to Python directory (interpreter and libs)")
 
 # 2. Find package - config mode first (i.e. looking for XYZ-config.cmake)
-IF(WINDOWS)
+IF(WIN32)
  IF(CMAKE_BUILD_TYPE STREQUAL Debug)
   SET(PythonInterp_FIND_VERSION _d)
   SET(PYTHON_DEFINITIONS "-DHAVE_DEBUG_PYTHON")
  ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
-ENDIF(WINDOWS)
+ENDIF(WIN32)
 IF(EXISTS "${PYTHON_ROOT_DIR}")
   # Hope to find direclty a CMake config file there
   SET(_CONF_DIR "${PYTHON_ROOT_DIR}/share/cmake") 
@@ -146,8 +146,13 @@ IF (SALOMEPYTHON_FOUND)
       ENDIF()        
   ENDIF()
 
-  # 6. Specifics
-  #
+  ##
+  ## 6. Save the final detected installation
+  ##
+  SET(PYTHON_ROOT_DIR "${_tmp_ROOT_DIR}")
+
+  ## 7. Specifics
+  ##
   
   # NumPy detection 
   EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ERROR_QUIET )