Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2020-08-20 15:30:28 +0300
committerGhostkeeper <rubend@tutanota.com>2020-08-20 15:30:28 +0300
commit808a0bf4aa7106eb90aabe1f0fe4848c4b765d7e (patch)
tree81ccf819ade86ce3bc553edc9cdc047795bc289e /CMakeLists.txt
parentb685da5a247ffc86ef186411cb857d66ed3c7fe7 (diff)
Don't use the new FindPython3 script from CMake
I don't know what it is with this one, but it's finding the wrong one. We specify through the prefix that it should search in the cura-build-environment first, but apparently it's not listening to that. As a result it's getting Python 3.6, and then stops because it can't find the headers for that version. It wouldn't need the headers in this case, but if it didn't crash here it would crash during the run time because libArcus and libSavitar have been linked to Python 3.5.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 9 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 035191ebf7..39628b8fa8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,24 +30,16 @@ configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desk
configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
-# FIXME: Remove the code for CMake <3.12 once we have switched over completely.
-# FindPython3 is a new module since CMake 3.12. It deprecates FindPythonInterp and FindPythonLibs. The FindPython3
-# module is copied from the CMake repository here so in CMake <3.12 we can still use it.
-if(${CMAKE_VERSION} VERSION_LESS 3.12)
- # Use FindPythonInterp and FindPythonLibs for CMake <3.12
- find_package(PythonInterp 3 REQUIRED)
-
- set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
-
- 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()
- # Use FindPython3 for CMake >=3.12
- find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
-endif()
+# FIXME: The new FindPython3 finds the system's Python3.6 reather than the Python3.5 that we built for Cura's environment.
+# So we're using the old method here, with FindPythonInterp for now.
+find_package(PythonInterp 3 REQUIRED)
+
+set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
+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})
if(NOT ${URANIUM_DIR} STREQUAL "")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${URANIUM_DIR}/cmake")