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