CMakeLists.txt
changeset 12200 c0b17b32b95e
parent 12199 4972784f494e
child 12229 2fb171be56e0
equal deleted inserted replaced
12199:4972784f494e 12200:c0b17b32b95e
  1725 endif()
  1725 endif()
  1726 
  1726 
  1727 if(SDL_SHARED)
  1727 if(SDL_SHARED)
  1728   add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
  1728   add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
  1729   if(APPLE)
  1729   if(APPLE)
  1730     set_target_properties(SDL2 PROPERTIES MACOSX_RPATH 1)
  1730     set_target_properties(SDL2 PROPERTIES
       
  1731       MACOSX_RPATH 1
       
  1732       OUTPUT_NAME "SDL2-${LT_RELEASE}")
  1731   elseif(UNIX AND NOT ANDROID)
  1733   elseif(UNIX AND NOT ANDROID)
  1732     set_target_properties(SDL2 PROPERTIES
  1734     set_target_properties(SDL2 PROPERTIES
  1733       VERSION ${LT_VERSION}
  1735       VERSION ${LT_VERSION}
  1734       SOVERSION ${LT_REVISION}
  1736       SOVERSION ${LT_REVISION}
  1735       OUTPUT_NAME "SDL2-${LT_RELEASE}")
  1737       OUTPUT_NAME "SDL2-${LT_RELEASE}")
  1838   set(SOPOSTFIX "")
  1840   set(SOPOSTFIX "")
  1839 endif()
  1841 endif()
  1840 
  1842 
  1841 if(NOT (WINDOWS OR CYGWIN))
  1843 if(NOT (WINDOWS OR CYGWIN))
  1842   if(SDL_SHARED)
  1844   if(SDL_SHARED)
  1843     if (APPLE)
  1845     set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
  1844         set(SOEXT "dylib")
  1846     get_target_property(SONAME SDL2 OUTPUT_NAME)
  1845     else()
       
  1846         set(SOEXT "so")
       
  1847     endif()
       
  1848     if(NOT ANDROID)
  1847     if(NOT ANDROID)
  1849         install(CODE "
  1848         install(CODE "
  1850           execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1849           execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1851             \"libSDL2-2.0${SOPOSTFIX}.${SOEXT}\" \"libSDL2.${SOEXT}\")"
  1850             \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\")"
  1852             WORKING_DIR "${SDL2_BINARY_DIR}")
  1851             WORKING_DIR "${SDL2_BINARY_DIR}")
  1853         install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
  1852         install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
  1854     endif()
  1853     endif()
  1855   endif()
  1854   endif()
  1856   if(FREEBSD)
  1855   if(FREEBSD)
  1857     # FreeBSD uses ${PREFIX}/libdata/pkgconfig
  1856     # FreeBSD uses ${PREFIX}/libdata/pkgconfig
  1858     install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")
  1857     install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")