From 6ac2a2061f8b7a515ced1b38452ddc2315c617c7 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Thu, 3 Oct 2019 11:34:04 -0600 Subject: Fix: Unit tests on windows. Problem was twofold 1) `GENERATOR_IS_MULTI_CONFIG` is a property not a variable so the test for it would always be false, unless you set a custom CMAKE_INSTALL_PREFIX (like the buildbot does) the unit tests would have a wrong working directory and complain about missing dlls or blender executable 2) Tests added outside of `/test` (like libmv) would have no working folder set since the variable would not be visible for them. consulted @sergey who voiced the opinion that duplicating the code to the test macro was slightly less evil than moving it to the main CMakeLists.txt --- tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7d8a1390628..94b6e49181c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,6 +4,7 @@ # # Getting the install path of the executable is somewhat involved, as there are # no direct CMake generator expressions to get the install paths of executables. +get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(GENERATOR_IS_MULTI_CONFIG) string(REPLACE "\${BUILD_TYPE}" "$" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) else() -- cgit v1.2.3