diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f662c2b50f..3993d76754 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,8 @@ include(GNUInstallDirs) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) -set(URANIUM_DIR "${CMAKE_SOURCE_DIR}/../Uranium" CACHE DIRECTORY "The location of the Uranium repository") -set(URANIUM_SCRIPTS_DIR "${URANIUM_DIR}/scripts" CACHE DIRECTORY "The location of the scripts directory of the Uranium repository") +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) @@ -16,6 +16,8 @@ if(CURA_DEBUGMODE) set(_cura_debugmode "ON") endif() +option(GENERATE_TRANSLATIONS "Should the translations be generated?" ON) + set(CURA_APP_NAME "cura" CACHE STRING "Short name of Cura, used for configuration folder") set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura") set(CURA_VERSION "master" CACHE STRING "Version name of Cura") @@ -24,30 +26,23 @@ set(CURA_CLOUD_API_ROOT "" CACHE STRING "Alternative Cura cloud API root") set(CURA_CLOUD_API_VERSION "" CACHE STRING "Alternative Cura cloud API version") set(CURA_CLOUD_ACCOUNT_API_ROOT "" CACHE STRING "Alternative Cura cloud account API version") set(CURA_MARKETPLACE_ROOT "" CACHE STRING "Alternative Marketplace location") +set(CURA_DIGITAL_FACTORY_URL "" CACHE STRING "Alternative Digital Factory location") configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY) configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY) -# FIXME: Remove the code for CMake <3.12 once we have switched over completely. -# FindPython3 is a new module since CMake 3.12. It deprecates FindPythonInterp and FindPythonLibs. The FindPython3 -# module is copied from the CMake repository here so in CMake <3.12 we can still use it. -if(${CMAKE_VERSION} VERSION_LESS 3.12) - # Use FindPythonInterp and FindPythonLibs for CMake <3.12 - find_package(PythonInterp 3 REQUIRED) +# FIXME: The new FindPython3 finds the system's Python3.6 reather 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}) -else() - # Use FindPython3 for CMake >=3.12 - find_package(Python3 REQUIRED COMPONENTS Interpreter Development) -endif() +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}) if(NOT ${URANIUM_DIR} STREQUAL "") set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${URANIUM_DIR}/cmake") @@ -58,7 +53,9 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # Extract Strings add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura) # Build Translations - CREATE_TRANSLATION_TARGETS() + if(${GENERATE_TRANSLATIONS}) + CREATE_TRANSLATION_TARGETS() + endif() endif() |