From 5e8c81673fde1201cd6de0639f2a45deeb8deae0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 15 Apr 2018 09:37:51 -0700 Subject: [PATCH] Fixed bug 4135 - Broken symlink libSDL2.so since rev11940 Tiago O. Symlink points to the wrong folder, and target will always have debug postfix, so it'll be broken for other build types. --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97ccb2ee7..13b2e1a9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1808,6 +1808,13 @@ endforeach() list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) +string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) +if (UPPER_BUILD_TYPE MATCHES DEBUG) + set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") +else() + set(SOPOSTFIX "") +endif() + if(NOT (WINDOWS OR CYGWIN)) if(SDL_SHARED) if (APPLE) @@ -1818,7 +1825,8 @@ if(NOT (WINDOWS OR CYGWIN)) if(NOT ANDROID) install(CODE " execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - \"${SDL2_BINARY_DIR}/libSDL2-2.0${SDL_CMAKE_DEBUG_POSTFIX}.${SOEXT}\" \"${SDL2_BINARY_DIR}/libSDL2.${SOEXT}\")") + \"libSDL2-2.0${SOPOSTFIX}.${SOEXT}\" \"libSDL2.${SOEXT}\")" + WORKING_DIR "${SDL2_BINARY_DIR}") install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}") endif() endif()