From e10f0a9545937fb90b74236c4d268ff3fcd1be42 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Fri, 5 Mar 2021 14:13:31 -0600 Subject: [PATCH] Add forwards-compatibility definitions --- cMake/FreeCAD_Helpers/SetupPython.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cMake/FreeCAD_Helpers/SetupPython.cmake b/cMake/FreeCAD_Helpers/SetupPython.cmake index d00525d4cc..78fd5d7255 100644 --- a/cMake/FreeCAD_Helpers/SetupPython.cmake +++ b/cMake/FreeCAD_Helpers/SetupPython.cmake @@ -128,11 +128,20 @@ macro(SetupPython) "Python not found, install Python!\n" "=================================\n") endif() + + # For forward compatibility with new CMake scripts set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE}) + set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) + set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}) + set(Python3_LIBRARY_DIRS ${PYTHON_LIBRARY_DIRS}) + set(Python3_VERSION ${PYTHON_VERSION_STRING}) + set(Python3_VERSION_MAJOR ${PYTHON_VERSION_MAJOR}) + set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR}) + set(Python3_VERSION_PATCH ${PYTHON_VERSION_PATCH}) else() find_package(Python3 COMPONENTS Interpreter Development REQUIRED) - # For compatibility with old CMake scripts + # For backwards compatibility with old CMake scripts set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS})