Skip to content
Snippets Groups Projects
Commit 10a497be authored by Massimiliano Galli's avatar Massimiliano Galli Committed by Oksana Shadura
Browse files

[CMake][Exp PyROOT] Force Python related CMake variables into CMakeCache

After investigating the bug reported here

https://sft.its.cern.ch/jira/browse/ROOT-10626

we noticed that the deprecated variables
PYTHON_EXECUTABLE
PYTHON_INCLUDE_DIRS
PYTHON_LIBRARIES
PYTHON_VERSION_MAJOR
PYTHON_VERSION_MINOR
PYTHON_VERSION_STRING
NUMPY_FOUND
NUMPY_INCLUDE_DIRS
are not set correctly in the CMakeCache. This should fix the problem.
parent 9ad4f473
No related branches found
No related tags found
No related merge requests found
......@@ -49,14 +49,14 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
# Search for NumPy, but not required:
find_package(Python2 COMPONENTS NumPy QUIET)
# Compat with find_package(PythonInterp), find_package(PythonLibs)
set(PYTHON_EXECUTABLE "${Python2_EXECUTABLE}")
set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}")
set(PYTHON_LIBRARIES "${Python2_LIBRARIES}")
set(PYTHON_VERSION_STRING "${Python2_VERSION}")
set(PYTHON_VERSION_MAJOR "${Python2_VERSION_MAJOR}")
set(PYTHON_VERSION_MINOR "${Python2_VERSION_MINOR}")
set(NUMPY_FOUND ${Python2_NumPy_FOUND})
set(NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}")
set(PYTHON_EXECUTABLE "${Python2_EXECUTABLE}" CACHE INTERNAL "" FORCE)
set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
set(PYTHON_LIBRARIES "${Python2_LIBRARIES}" CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_STRING "${Python2_VERSION}" CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MAJOR "${Python2_VERSION_MAJOR}" CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MINOR "${Python2_VERSION_MINOR}" CACHE INTERNAL "" FORCE)
set(NUMPY_FOUND ${Python2_NumPy_FOUND} CACHE INTERNAL "" FORCE)
set(NUMPY_INCLUDE_DIRS "${Python2_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
else()
if(PYTHON_EXECUTABLE AND NOT Python_EXECUTABLE)
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
......@@ -71,14 +71,14 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
# Search for NumPy, but not required:
find_package(Python COMPONENTS NumPy QUIET)
# Compat with find_package(PythonInterp), find_package(PythonLibs), find_package(NumPy)
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}")
set(PYTHON_LIBRARIES "${Python_LIBRARIES}")
set(PYTHON_VERSION_STRING "${Python_VERSION}")
set(PYTHON_VERSION_MAJOR "${Python_VERSION_MAJOR}")
set(PYTHON_VERSION_MINOR "${Python_VERSION_MINOR}")
set(NUMPY_FOUND ${Python_NumPy_FOUND})
set(NUMPY_INCLUDE_DIRS "${Python_NumPy_INCLUDE_DIRS}")
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE INTERNAL "" FORCE)
set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_STRING "${Python_VERSION}" CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MAJOR "${Python_VERSION_MAJOR}" CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MINOR "${Python_VERSION_MINOR}" CACHE INTERNAL "" FORCE)
set(NUMPY_FOUND ${Python_NumPy_FOUND} CACHE INTERNAL "" FORCE)
set(NUMPY_INCLUDE_DIRS "${Python_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
endif()
else()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment