From 33b69f39bc16ca004cca3cea6a25ef05257ad2ba Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 6 May 2022 14:01:02 -0700 Subject: [PATCH] Make CMake use of CompileShaders more robust --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfc8a56..433a6e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,8 +134,7 @@ if(BUILD_DX11 AND WIN32) MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DirectXTex/Shaders/CompileShaders.cmd" DEPENDS ${SHADER_SOURCES} COMMENT "Generating HLSL shaders..." - COMMAND set CompileShadersOutput=${COMPILED_SHADERS} - COMMAND CompileShaders.cmd > ${COMPILED_SHADERS}/compileshaders.log + COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" CompileShaders.cmd > "${COMPILED_SHADERS}/compileshaders.log" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DirectXTex/Shaders" USES_TERMINAL) endif() @@ -273,8 +272,7 @@ if(BUILD_SAMPLE AND BUILD_DX11 AND WIN32 AND (NOT WINDOWS_STORE)) MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DDSView/hlsl.cmd" DEPENDS "${PROJECT_SOURCE_DIR}/DDSView/ddsview.fx" COMMENT "Generating HLSL shaders for DDSView..." - COMMAND set CompileShadersOutput=${COMPILED_DDSVIEW_SHADERS} - COMMAND hlsl.cmd > ${COMPILED_DDSVIEW_SHADERS}/hlsl.log + COMMAND COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_DDSVIEW_SHADERS}" hlsl.cmd > "${COMPILED_DDSVIEW_SHADERS}/hlsl.log" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DDSView" USES_TERMINAL) endif()