CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (c) 2022 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. # NOTE: This is only being used for translation scripts.
  4. # For MSVC flags, will be ignored on non-Windows OS's and this project in general. Only needed for cura-build-environment.
  5. cmake_policy(SET CMP0091 NEW)
  6. project(cura)
  7. cmake_minimum_required(VERSION 3.18)
  8. include(GNUInstallDirs)
  9. list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
  10. set(URANIUM_DIR "${CMAKE_SOURCE_DIR}/../Uranium" CACHE PATH "The location of the Uranium repository")
  11. set(URANIUM_SCRIPTS_DIR "${URANIUM_DIR}/scripts" CACHE PATH "The location of the scripts directory of the Uranium repository")
  12. option(GENERATE_TRANSLATIONS "Should the translations be generated?" ON)
  13. if(NOT ${URANIUM_DIR} STREQUAL "")
  14. set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${URANIUM_DIR}/cmake")
  15. endif()
  16. if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "")
  17. list(APPEND CMAKE_MODULE_PATH ${URANIUM_DIR}/cmake)
  18. include(UraniumTranslationTools)
  19. # Extract Strings
  20. add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura)
  21. # Build Translations
  22. if(${GENERATE_TRANSLATIONS})
  23. CREATE_TRANSLATION_TARGETS()
  24. endif()
  25. endif()