Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2019-10-03 20:34:04 +0300
committerRay Molenkamp <github@lazydodo.com>2019-10-03 20:34:04 +0300
commit6ac2a2061f8b7a515ced1b38452ddc2315c617c7 (patch)
treed772043a29ac2e015cd441c615921f938f61a1de /build_files/cmake/Modules
parent79ca5ad368fb78c29c97d40be4a2c817c900fc58 (diff)
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
Diffstat (limited to 'build_files/cmake/Modules')
-rw-r--r--build_files/cmake/Modules/GTestTesting.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake
index 1c98a6456b8..a93e829e6b0 100644
--- a/build_files/cmake/Modules/GTestTesting.cmake
+++ b/build_files/cmake/Modules/GTestTesting.cmake
@@ -48,6 +48,14 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
if(WITH_OPENMP_STATIC)
target_link_libraries(${TARGET_NAME} ${OpenMP_LIBRARIES})
endif()
+
+ get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(GENERATOR_IS_MULTI_CONFIG)
+ string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
+ else()
+ string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
+ endif()
+
set_target_properties(${TARGET_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"