CMakeLists.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. project(cura NONE)
  2. cmake_minimum_required(VERSION 2.8.12)
  3. set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/
  4. ${CMAKE_MODULE_PATH})
  5. include(GNUInstallDirs)
  6. set(URANIUM_DIR "${CMAKE_SOURCE_DIR}/../Uranium" CACHE DIRECTORY "The location of the Uranium repository")
  7. set(URANIUM_SCRIPTS_DIR "${URANIUM_DIR}/scripts" CACHE DIRECTORY "The location of the scripts directory of the Uranium repository")
  8. # Tests
  9. include(CuraTests)
  10. option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF)
  11. if(CURA_DEBUGMODE)
  12. set(_cura_debugmode "ON")
  13. endif()
  14. set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura")
  15. set(CURA_VERSION "master" CACHE STRING "Version name of Cura")
  16. set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
  17. set(CURA_SDK_VERSION "" CACHE STRING "SDK version of Cura")
  18. set(CURA_CLOUD_API_ROOT "" CACHE STRING "Alternative Cura cloud API root")
  19. set(CURA_CLOUD_API_VERSION "" CACHE STRING "Alternative Cura cloud API version")
  20. configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY)
  21. configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
  22. if(NOT ${URANIUM_DIR} STREQUAL "")
  23. set(CMAKE_MODULE_PATH "${URANIUM_DIR}/cmake")
  24. endif()
  25. if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "")
  26. list(APPEND CMAKE_MODULE_PATH ${URANIUM_DIR}/cmake)
  27. include(UraniumTranslationTools)
  28. # Extract Strings
  29. add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura)
  30. # Build Translations
  31. CREATE_TRANSLATION_TARGETS()
  32. endif()
  33. find_package(PythonInterp 3.5.0 REQUIRED)
  34. install(DIRECTORY resources
  35. DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
  36. install(DIRECTORY plugins
  37. DESTINATION lib${LIB_SUFFIX}/cura)
  38. if(NOT APPLE AND NOT WIN32)
  39. install(FILES cura_app.py
  40. DESTINATION ${CMAKE_INSTALL_BINDIR}
  41. PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
  42. RENAME cura)
  43. if(EXISTS /etc/debian_version)
  44. install(DIRECTORY cura
  45. DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}/dist-packages
  46. FILES_MATCHING PATTERN *.py)
  47. install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
  48. DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}/dist-packages/cura)
  49. else()
  50. install(DIRECTORY cura
  51. DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages
  52. FILES_MATCHING PATTERN *.py)
  53. install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
  54. DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/cura)
  55. endif()
  56. install(FILES ${CMAKE_BINARY_DIR}/cura.desktop
  57. DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
  58. install(FILES ${CMAKE_SOURCE_DIR}/resources/images/cura-icon.png
  59. DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/)
  60. install(FILES cura.appdata.xml
  61. DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
  62. install(FILES cura.sharedmimeinfo
  63. DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages/
  64. RENAME cura.xml )
  65. else()
  66. install(FILES cura_app.py
  67. DESTINATION ${CMAKE_INSTALL_BINDIR}
  68. PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
  69. install(DIRECTORY cura
  70. DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages
  71. FILES_MATCHING PATTERN *.py)
  72. install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
  73. DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/cura)
  74. endif()