Debian Codegraph @

CMakeLists.txt

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 # Copyright (c) 2022 Ultimaker B.V.
2 # Cura is released under the terms of the LGPLv3 or higher.
3
4 project(cura)
5 cmake_minimum_required(VERSION 3.18)
6
7 include(GNUInstallDirs)
8
9 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
10
11 set(URANIUM_DIR "${CMAKE_SOURCE_DIR}/../Uranium" CACHE PATH "The location of the Uranium repository")
12 set(URANIUM_SCRIPTS_DIR "${URANIUM_DIR}/scripts" CACHE PATH "The location of the scripts directory of the Uranium repository")
13
14 option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF)
15 if(CURA_DEBUGMODE)
16 set(_cura_debugmode "ON")
17 endif()
18
19 option(GENERATE_TRANSLATIONS "Should the translations be generated?" ON)
20
21 set(CURA_APP_NAME "cura" CACHE STRING "Short name of Cura, used for configuration folder")
22 set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura")
23 set(CURA_VERSION "master" CACHE STRING "Version name of Cura")
24 set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
25 set(CURA_CLOUD_API_ROOT "" CACHE STRING "Alternative Cura cloud API root")
26 set(CURA_CLOUD_API_VERSION "" CACHE STRING "Alternative Cura cloud API version")
27 set(CURA_CLOUD_ACCOUNT_API_ROOT "" CACHE STRING "Alternative Cura cloud account API version")
28 set(CURA_MARKETPLACE_ROOT "" CACHE STRING "Alternative Marketplace location")
29 set(CURA_DIGITAL_FACTORY_URL "" CACHE STRING "Alternative Digital Factory location")
30
31 configure_file(${CMAKE_SOURCE_DIR}/com.ultimaker.cura.desktop.in ${CMAKE_BINARY_DIR}/com.ultimaker.cura.desktop @ONLY)
32
33 configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
34
35 if(NOT DEFINED Python_VERSION)
36 set(Python_VERSION
37 3.10
38 CACHE STRING "Python Version" FORCE)
39 message(STATUS "Setting Python version to ${Python_VERSION}. Set Python_VERSION if you want to compile against an other version.")
40 endif()
41 if(APPLE)
42 set(Python_FIND_FRAMEWORK NEVER)
43 endif()
44 find_package(Python ${Python_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
45 message(STATUS "Linking and building ${project_name} against Python ${Python_VERSION}")
46 if(NOT DEFINED Python_SITELIB_LOCAL)
47 set(Python_SITELIB_LOCAL
48 "${Python_SITELIB}"
49 CACHE PATH "Local alternative site-package location to install Cura" FORCE)
50 endif()
51
52 # Tests
53 include(CuraTests)
54
55 if(NOT ${URANIUM_DIR} STREQUAL "")
56 set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${URANIUM_DIR}/cmake")
57 endif()
58 if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "")
59 list(APPEND CMAKE_MODULE_PATH ${URANIUM_DIR}/cmake)
60 include(UraniumTranslationTools)
61 # Extract Strings
62 add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura)
63 # Build Translations
64 if(${GENERATE_TRANSLATIONS})
65 CREATE_TRANSLATION_TARGETS()
66 endif()
67 endif()
68
69 install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
70
71 include(CuraPluginInstall)
72
73 install(FILES cura_app.py DESTINATION ${CMAKE_INSTALL_BINDIR}
74 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
75 install(DIRECTORY cura DESTINATION "${Python_SITELIB_LOCAL}")
76 install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py DESTINATION "${Python_SITELIB_LOCAL}/cura/")
77 if(NOT APPLE AND NOT WIN32)
78 install(FILES ${CMAKE_BINARY_DIR}/com.ultimaker.cura.desktop
79 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
80 install(FILES ${CMAKE_SOURCE_DIR}/resources/images/cura-icon.png
81 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/)
82 install(FILES com.ultimaker.cura.appdata.xml
83 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
84 install(FILES cura.sharedmimeinfo
85 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages/
86 RENAME cura.xml )
87 endif()