SDL: [SDL2] Fix using of DXSDK_DIR in older CMake

From 40b1eac541fcf8a0cdf500e5ea0fa41c5168a29a Mon Sep 17 00:00:00 2001
From: "Boris I. Bendovsky" <[EMAIL REDACTED]>
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
---
 CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index afd4e13eb7b0b..ea2368cdfe9aa 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})