Fixed bug 4135 - Broken symlink libSDL2.so since rev11940
authorSam Lantinga <slouken@libsdl.org>
Sun, 15 Apr 2018 09:37:51 -0700
changeset 11943fb7758471f13
parent 11942 2ad9729d3975
child 11944 295cf9910d75
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
     1.1 --- a/CMakeLists.txt	Wed Apr 11 18:28:03 2018 -0700
     1.2 +++ b/CMakeLists.txt	Sun Apr 15 09:37:51 2018 -0700
     1.3 @@ -1808,6 +1808,13 @@
     1.4  list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
     1.5  install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
     1.6  
     1.7 +string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
     1.8 +if (UPPER_BUILD_TYPE MATCHES DEBUG)
     1.9 +  set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
    1.10 +else()
    1.11 +  set(SOPOSTFIX "")
    1.12 +endif()
    1.13 +
    1.14  if(NOT (WINDOWS OR CYGWIN))
    1.15    if(SDL_SHARED)
    1.16      if (APPLE)
    1.17 @@ -1818,7 +1825,8 @@
    1.18      if(NOT ANDROID)
    1.19          install(CODE "
    1.20            execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
    1.21 -            \"${SDL2_BINARY_DIR}/libSDL2-2.0${SDL_CMAKE_DEBUG_POSTFIX}.${SOEXT}\" \"${SDL2_BINARY_DIR}/libSDL2.${SOEXT}\")")
    1.22 +            \"libSDL2-2.0${SOPOSTFIX}.${SOEXT}\" \"libSDL2.${SOEXT}\")"
    1.23 +            WORKING_DIR "${SDL2_BINARY_DIR}")
    1.24          install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
    1.25      endif()
    1.26    endif()