[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 40b1eac541)
This commit is contained in:
Boris I. Bendovsky 2025-04-21 12:31:57 +03:00 committed by Sam Lantinga
parent f54014e173
commit 093307f1f4
1 changed files with 4 additions and 2 deletions

View File

@ -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})