Add Python 3.6 requirement
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
macro(SetupPython)
|
||||
# -------------------------------- Python --------------------------------
|
||||
|
||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598
|
||||
# Acceptable versions of Python
|
||||
set(Python_ADDITIONAL_VERSIONS "2.7")
|
||||
|
||||
# For building on OS X
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA)
|
||||
|
||||
@@ -118,31 +114,29 @@ macro(SetupPython)
|
||||
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA)
|
||||
|
||||
find_package(PythonInterp REQUIRED)
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.12")
|
||||
set(Python_ADDITIONAL_VERSIONS ${Python_ADDITIONAL_VERSIONS} "3.10" "3.9" "3.8" "3.7" "3.6")
|
||||
find_package(PythonInterp REQUIRED)
|
||||
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
if (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
else (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
|
||||
endif(NOT DEFINED PYTHON_VERSION_STRING)
|
||||
else()
|
||||
find_package(Python3 COMPONENTS Interpreter Development)
|
||||
endif()
|
||||
|
||||
# Issue in cmake prevents finding pythonlibs 3.x when python 2.7 is present
|
||||
# setting NOTFOUND here resolves the issue
|
||||
set(PYTHON_INCLUDE_DIR "NOTFOUND")
|
||||
set(PYTHON_LIBRARY "NOTFOUND")
|
||||
|
||||
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
if (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
else (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
|
||||
endif(NOT DEFINED PYTHON_VERSION_STRING)
|
||||
|
||||
|
||||
if(NOT PYTHONLIBS_FOUND)
|
||||
message(FATAL_ERROR "=================================\n"
|
||||
"Python not found, install Python!\n"
|
||||
"=================================\n")
|
||||
else(NOT PYTHONLIBS_FOUND)
|
||||
# prevent python3 lower than 3.3 (not enough utf8<->unicode tools)
|
||||
# prevent python3 lower than 3.6 (not enough utf8<->unicode tools)
|
||||
if(PYTHON_VERSION_MAJOR EQUAL 3)
|
||||
if(PYTHON_VERSION_MINOR LESS 4)
|
||||
message(FATAL_ERROR "To build FreeCAD with Python3, you need at least version 3.4\n")
|
||||
endif(PYTHON_VERSION_MINOR LESS 4)
|
||||
if(PYTHON_VERSION_MINOR LESS 6)
|
||||
message(FATAL_ERROR "To build FreeCAD you need at least Python 3.6\n")
|
||||
endif(PYTHON_VERSION_MINOR LESS 6)
|
||||
endif(PYTHON_VERSION_MAJOR EQUAL 3)
|
||||
endif(NOT PYTHONLIBS_FOUND)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user