From 093307f1f4031aa1f916b6f5b64ecfc4847c1b4b Mon Sep 17 00:00:00 2001 From: "Boris I. Bendovsky" Date: Mon, 21 Apr 2025 12:31:57 +0300 Subject: [PATCH] [SDL2] Fix using of DXSDK_DIR in older CMake - Remove duplicate 'dollar' symbol in the path - Use command 'file' to normalize file paths (cherry picked from commit 40b1eac541fcf8a0cdf500e5ea0fa41c5168a29a) --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d2de3a5d4..f08c51d647 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1829,8 +1829,10 @@ elseif(WINDOWS) set(HAVE_DIRECTX TRUE) if(NOT MINGW AND NOT USE_WINSDK_DIRECTX) # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks - target_link_directories(sdl-build-options INTERFACE "$$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}") - target_include_directories(sdl-build-options INTERFACE "$ENV{DXSDK_DIR}\\Include") + file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}" SDL2_TMP_DXSDK_LIB_DIR) + target_link_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_LIB_DIR}") + file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\Include" SDL2_TMP_DXSDK_INCLUDE_DIR) + target_include_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_INCLUDE_DIR}") endif() endif() set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})