CMakeLists.txt
changeset 12200 c0b17b32b95e
parent 12199 4972784f494e
child 12229 2fb171be56e0
     1.1 --- a/CMakeLists.txt	Mon Sep 24 08:41:59 2018 -0700
     1.2 +++ b/CMakeLists.txt	Sat Aug 18 17:23:40 2018 -0400
     1.3 @@ -1727,7 +1727,9 @@
     1.4  if(SDL_SHARED)
     1.5    add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
     1.6    if(APPLE)
     1.7 -    set_target_properties(SDL2 PROPERTIES MACOSX_RPATH 1)
     1.8 +    set_target_properties(SDL2 PROPERTIES
     1.9 +      MACOSX_RPATH 1
    1.10 +      OUTPUT_NAME "SDL2-${LT_RELEASE}")
    1.11    elseif(UNIX AND NOT ANDROID)
    1.12      set_target_properties(SDL2 PROPERTIES
    1.13        VERSION ${LT_VERSION}
    1.14 @@ -1840,17 +1842,14 @@
    1.15  
    1.16  if(NOT (WINDOWS OR CYGWIN))
    1.17    if(SDL_SHARED)
    1.18 -    if (APPLE)
    1.19 -        set(SOEXT "dylib")
    1.20 -    else()
    1.21 -        set(SOEXT "so")
    1.22 -    endif()
    1.23 +    set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
    1.24 +    get_target_property(SONAME SDL2 OUTPUT_NAME)
    1.25      if(NOT ANDROID)
    1.26          install(CODE "
    1.27            execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
    1.28 -            \"libSDL2-2.0${SOPOSTFIX}.${SOEXT}\" \"libSDL2.${SOEXT}\")"
    1.29 +            \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\")"
    1.30              WORKING_DIR "${SDL2_BINARY_DIR}")
    1.31 -        install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
    1.32 +        install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
    1.33      endif()
    1.34    endif()
    1.35    if(FREEBSD)