From 04e517eddfcbfe680f94f73d05ed23b7ecdc809e Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 15 Mar 2017 17:23:54 +0100 Subject: Do not hardcode the path to Uranium but use a cache variable This allows us to override the uranium dir and make sure it is still found even when it is not the same as "../uranium" --- CMakeLists.txt | 3 ++- cmake/CuraTests.cmake | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b5a64056..cb42f35eee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/ include(GNUInstallDirs) -set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY "The location of the scripts directory of the Uranium repository") +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") # Tests include(CuraTests) diff --git a/cmake/CuraTests.cmake b/cmake/CuraTests.cmake index 5c58330a48..cf9fa4ba68 100644 --- a/cmake/CuraTests.cmake +++ b/cmake/CuraTests.cmake @@ -30,13 +30,13 @@ function(cura_add_test) set_tests_properties(${_NAME} PROPERTIES ENVIRONMENT PYTHONPATH=${_PYTHONPATH}) endfunction() -cura_add_test(NAME pytest-main DIRECTORY ${CMAKE_SOURCE_DIR}/tests PYTHONPATH "${CMAKE_SOURCE_DIR}/../Uranium:${CMAKE_SOURCE_DIR}") +cura_add_test(NAME pytest-main DIRECTORY ${CMAKE_SOURCE_DIR}/tests PYTHONPATH "${CMAKE_SOURCE_DIR}:${URANIUM_DIR}") file(GLOB_RECURSE _plugins plugins/*/__init__.py) foreach(_plugin ${_plugins}) get_filename_component(_plugin_directory ${_plugin} DIRECTORY) if(EXISTS ${_plugin_directory}/tests) get_filename_component(_plugin_name ${_plugin_directory} NAME) - cura_add_test(NAME pytest-${_plugin_name} DIRECTORY ${_plugin_directory} PYTHONPATH "${CMAKE_SOURCE_DIR}/../Uranium:${CMAKE_SOURCE_DIR}:${_plugin_directory}") + cura_add_test(NAME pytest-${_plugin_name} DIRECTORY ${_plugin_directory} PYTHONPATH "${_plugin_directory}:${CMAKE_SOURCE_DIR}:${URANIUM_DIR}") endif() endforeach() -- cgit v1.2.3