From 8bcfdb0c925a11a8f4b47ab589e5c37458337787 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 23 Aug 2024 03:20:39 +0200
Subject: [PATCH] cmake: fix SDL3-x.y.z.jar installation on Windows
---
CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c7bd73abcb95..208dc9bcc570e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3602,7 +3602,8 @@ if(NOT SDL_DISABLE_INSTALL)
if(TARGET SDL3-jar)
set(SDL_INSTALL_JAVADIR "${CMAKE_INSTALL_DATAROOTDIR}/java" CACHE PATH "Path where to install java clases + java sources")
set(PROGUARD_RULES_PATH "${CMAKE_CURRENT_SOURCE_DIR}/android-project/app/proguard-rules.pro")
- install(FILES $<TARGET_PROPERTY:SDL3-jar,INSTALL_FILES>
+ # install_jar or $<TARGET_PROPERTY:SDL3-jar,INSTALL_FILES> does not work on Windows: a SDL3.jar symlink is not generated
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SDL3-${SDL3_VERSION}.jar"
DESTINATION "${SDL_INSTALL_JAVADIR}/SDL3")
install(FILES "${PROGUARD_RULES_PATH}" RENAME "proguard.txt"
DESTINATION "${SDL_INSTALL_JAVADIR}/SDL3")