From 63ad1862738f5cce24761fe82d8ac1f7c0fe3cb9 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 10 Oct 2018 23:27:32 +0300 Subject: [PATCH] Use PYTHON_ROOT_DIR environment variable --- CMakeCommon/FindPython.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeCommon/FindPython.cmake b/CMakeCommon/FindPython.cmake index c38d22127..da2a36152 100644 --- a/CMakeCommon/FindPython.cmake +++ b/CMakeCommon/FindPython.cmake @@ -25,6 +25,13 @@ ENDIF() IF(DEFINED 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) +ELSE() + IF(WIN32) + IF(DEFINED ENV{PYTHON_ROOT_DIR}) + SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR}) + SET(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR} CACHE PATH "path to where Python.h is found" FORCE) + ENDIF() + ENDIF() ENDIF() FIND_PACKAGE(PythonInterp REQUIRED) -- 2.39.2