CMakeLists.txt
changeset 7525 e5ae3502a25e
parent 7427 c47b59bac287
child 7666 603fb699946c
     1.1 --- a/CMakeLists.txt	Sat Jul 27 02:45:26 2013 -0700
     1.2 +++ b/CMakeLists.txt	Sat Jul 27 02:50:19 2013 -0700
     1.3 @@ -38,6 +38,8 @@
     1.4  math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}")
     1.5  math(EXPR LT_AGE "${SDL_BINARY_AGE} - ${SDL_INTERFACE_AGE}")
     1.6  set(LT_REVISION "${SDL_INTERFACE_AGE}")
     1.7 +set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}")
     1.8 +set(LT_VERSION "${LT_CURRENT}.${LT_REVISION}.${LT_AGE}")
     1.9  
    1.10  # General settings & flags
    1.11  set(LIBRARY_OUTPUT_DIRECTORY "build")
    1.12 @@ -1144,9 +1146,17 @@
    1.13  
    1.14  if(SDL_SHARED)
    1.15    add_library(SDL2 SHARED ${SOURCE_FILES})
    1.16 -  set_target_properties(SDL2 PROPERTIES
    1.17 -    VERSION ${SDL_VERSION}
    1.18 -    SOVERSION ${LT_CURRENT})
    1.19 +  if(UNIX)
    1.20 +    set_target_properties(SDL2 PROPERTIES
    1.21 +      VERSION ${LT_VERSION}
    1.22 +      SOVERSION ${LT_CURRENT}
    1.23 +      OUTPUT_NAME "SDL2-${LT_RELEASE}")
    1.24 +  else(UNIX)
    1.25 +    set_target_properties(SDL2 PROPERTIES
    1.26 +      VERSION ${SDL_VERSION}
    1.27 +      SOVERSION ${LT_CURRENT}
    1.28 +      OUTPUT_NAME "SDL2")
    1.29 +  endif(UNIX)
    1.30   set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
    1.31   target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
    1.32  endif(SDL_SHARED)
    1.33 @@ -1174,6 +1184,13 @@
    1.34  list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
    1.35  install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
    1.36  
    1.37 +if(SDL_SHARED)
    1.38 +  install(CODE "
    1.39 +    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
    1.40 +    \"libSDL2-2.0.so\" \"libSDL2.so\")")
    1.41 +  install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}")
    1.42 +endif(SDL_SHARED)
    1.43 +
    1.44  if(NOT WINDOWS OR CYGWIN)
    1.45    if(FREEBSD)
    1.46      # FreeBSD uses ${PREFIX}/libdata/pkgconfig