[Bf-blender-cvs] [44928a2a8f2] master: Fix: Blender_test not working on windows.

Ray Molenkamp noreply at git.blender.org
Thu Jul 30 21:18:12 CEST 2020


Commit: 44928a2a8f2ebb3a9489e21aa3169b20f6945590
Author: Ray Molenkamp
Date:   Thu Jul 30 13:18:05 2020 -0600
Branches: master
https://developer.blender.org/rB44928a2a8f2ebb3a9489e21aa3169b20f6945590

Fix: Blender_test not working on windows.

This bumps the minimum requirement for cmake from 3.10 to 3.18 on windows
if `WITH_GTESTS` is enabled.

Reviewed By: sergey brecht sybren campbellbarton

Differential Revision: https://developer.blender.org/D8405

===================================================================

M	build_files/cmake/platform/platform_win32.cmake
M	tests/gtests/runner/CMakeLists.txt

===================================================================

diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 01d48364435..ebafe92c962 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -26,6 +26,10 @@ if(NOT MSVC)
   message(FATAL_ERROR "Compiler is unsupported")
 endif()
 
+if(WITH_GTESTS AND ${CMAKE_VERSION} VERSION_LESS "3.18.0")
+  message(FATAL_ERROR "CMake 3.18.0 is required for building WITH_GTESTS on windows, currently installed cmake version is ${CMAKE_VERSION}")
+endif()
+
 if(CMAKE_C_COMPILER_ID MATCHES "Clang")
   set(MSVC_CLANG On)
   set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt
index 59537aab571..954fcf914a9 100644
--- a/tests/gtests/runner/CMakeLists.txt
+++ b/tests/gtests/runner/CMakeLists.txt
@@ -77,10 +77,11 @@ set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
 )
 
 gtest_discover_tests(blender_test
-# So that the binary can find its shared libs on window.
-  WORKING_DIRECTORY "$<TARGET_FILE_DIR:blender>"
+  WORKING_DIRECTORY "${TEST_INSTALL_DIR}"
+# So that it will run after the install phase that will copy the required libraries
+  DISCOVERY_MODE PRE_TEST
 # So that unit tests know where to find files:
   EXTRA_ARGS
     --test-assets-dir "${CMAKE_SOURCE_DIR}/../lib/tests"
-    --test-release-dir "${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}"
+    --test-release-dir "${TEST_INSTALL_DIR}/${BLENDER_VERSION}"
 )



More information about the Bf-blender-cvs mailing list