|
@@ -1,5 +1,8 @@
|
|
|
+# Copyright (c) 2022 Ultimaker B.V.
|
|
|
+# Cura is released under the terms of the LGPLv3 or higher.
|
|
|
+
|
|
|
project(cura)
|
|
|
-cmake_minimum_required(VERSION 3.6)
|
|
|
+cmake_minimum_required(VERSION 3.18)
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
@@ -8,9 +11,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
|
|
set(URANIUM_DIR "${CMAKE_SOURCE_DIR}/../Uranium" CACHE PATH "The location of the Uranium repository")
|
|
|
set(URANIUM_SCRIPTS_DIR "${URANIUM_DIR}/scripts" CACHE PATH "The location of the scripts directory of the Uranium repository")
|
|
|
|
|
|
-# Tests
|
|
|
-include(CuraTests)
|
|
|
-
|
|
|
option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF)
|
|
|
if(CURA_DEBUGMODE)
|
|
|
set(_cura_debugmode "ON")
|
|
@@ -32,17 +32,25 @@ configure_file(${CMAKE_SOURCE_DIR}/com.ultimaker.cura.desktop.in ${CMAKE_BINARY_
|
|
|
|
|
|
configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
|
|
|
|
|
|
+if(NOT DEFINED Python_VERSION)
|
|
|
+ set(Python_VERSION
|
|
|
+ 3.10
|
|
|
+ CACHE STRING "Python Version" FORCE)
|
|
|
+ message(STATUS "Setting Python version to ${Python_VERSION}. Set Python_VERSION if you want to compile against an other version.")
|
|
|
+endif()
|
|
|
+if(APPLE)
|
|
|
+ set(Python_FIND_FRAMEWORK NEVER)
|
|
|
+endif()
|
|
|
+find_package(Python ${Python_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
|
|
|
+message(STATUS "Linking and building ${project_name} against Python ${Python_VERSION}")
|
|
|
+if(NOT DEFINED Python_SITELIB_LOCAL)
|
|
|
+ set(Python_SITELIB_LOCAL
|
|
|
+ "${Python_SITELIB}"
|
|
|
+ CACHE PATH "Local alternative site-package location to install Cura" FORCE)
|
|
|
+endif()
|
|
|
|
|
|
-# FIXME: The new FindPython3 finds the system's Python3.6 rather 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})
|
|
|
+# Tests
|
|
|
+include(CuraTests)
|
|
|
|
|
|
if(NOT ${URANIUM_DIR} STREQUAL "")
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${URANIUM_DIR}/cmake")
|
|
@@ -58,30 +66,15 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "")
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
-
|
|
|
-install(DIRECTORY resources
|
|
|
- DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
|
|
|
+install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
|
|
|
|
|
|
include(CuraPluginInstall)
|
|
|
|
|
|
+install(FILES cura_app.py DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
+install(DIRECTORY cura DESTINATION "${Python_SITELIB_LOCAL}")
|
|
|
+install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py DESTINATION "${Python_SITELIB_LOCAL}/cura/")
|
|
|
if(NOT APPLE AND NOT WIN32)
|
|
|
- install(FILES cura_app.py
|
|
|
- DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
- RENAME cura)
|
|
|
- if(EXISTS /etc/debian_version)
|
|
|
- install(DIRECTORY cura
|
|
|
- DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}/dist-packages
|
|
|
- FILES_MATCHING PATTERN *.py)
|
|
|
- install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
|
|
|
- DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}/dist-packages/cura)
|
|
|
- else()
|
|
|
- install(DIRECTORY cura
|
|
|
- DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages
|
|
|
- FILES_MATCHING PATTERN *.py)
|
|
|
- install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
|
|
|
- DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/cura)
|
|
|
- endif()
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/com.ultimaker.cura.desktop
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/resources/images/cura-icon.png
|
|
@@ -91,13 +84,4 @@ if(NOT APPLE AND NOT WIN32)
|
|
|
install(FILES cura.sharedmimeinfo
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages/
|
|
|
RENAME cura.xml )
|
|
|
-else()
|
|
|
- install(FILES cura_app.py
|
|
|
- DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
- install(DIRECTORY cura
|
|
|
- DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages
|
|
|
- FILES_MATCHING PATTERN *.py)
|
|
|
- install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
|
|
|
- DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/cura)
|
|
|
endif()
|