From 901835a2c7fdfe82c7fee46d8ff1809726bba001 Mon Sep 17 00:00:00 2001 From: vbeckham Date: Thu, 25 Sep 2025 15:27:33 +0200 Subject: [PATCH] Fix: Failure to pass the full PATH to Blender ctests on Windows Due to this bug only the first item in the current PATH on the system is used when running Blender. The PATH is appended to a string type variable, which is then used as one element of a list in build_files\cmake\testing.cmake line 24. Since in cmake the semicolon is a list element delimiter, we need to escape all the semicolons in our PATH string if we want to use the variable as a single entry in the list. Pull Request: https://projects.blender.org/blender/blender/pulls/146770 --- build_files/cmake/platform/platform_win32.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index fc06bc44dc8..94750d165b4 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -1352,6 +1352,8 @@ set(PLATFORM_ENV_BUILD_DIRS "${_msvc_path}\;${LIBDIR}/epoxy/bin\;${LIBDIR}/tbb/b set(PLATFORM_ENV_BUILD "PATH=${PLATFORM_ENV_BUILD_DIRS}") # Install needs the additional folders from PLATFORM_ENV_BUILD_DIRS as well, as tools like: # `idiff` and `abcls` use the release mode dlls. -set(PLATFORM_ENV_INSTALL "PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/\;${PLATFORM_ENV_BUILD_DIRS}\;$ENV{PATH}") +# Escape semicolons, since in cmake they denote elements in a list if surrounded by square brackets +string(REPLACE ";" "\\;" ESCAPED_PATH "$ENV{PATH}") +set(PLATFORM_ENV_INSTALL "PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/\;${PLATFORM_ENV_BUILD_DIRS}\;${ESCAPED_PATH}") unset(_library_paths) unset(_msvc_path)