CMake: Don't make a libSDL2.so symlink on Mac OS X (do .dylib instead).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 03 Jan 2016 20:52:44 -0500
changeset 100048f2f519d1e61
parent 10003 d91a2c45825e
child 10005 dea345d3b00a
CMake: Don't make a libSDL2.so symlink on Mac OS X (do .dylib instead).
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Sun Jan 03 06:50:50 2016 -0500
     1.2 +++ b/CMakeLists.txt	Sun Jan 03 20:52:44 2016 -0500
     1.3 @@ -1507,12 +1507,17 @@
     1.4  list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
     1.5  install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
     1.6  
     1.7 -if(NOT WINDOWS OR CYGWIN)
     1.8 +if(NOT (WINDOWS OR CYGWIN))
     1.9    if(SDL_SHARED)
    1.10 +    if (APPLE)
    1.11 +        set(SOEXT "dylib")
    1.12 +    else()
    1.13 +        set(SOEXT "so")
    1.14 +    endif()
    1.15      install(CODE "
    1.16        execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
    1.17 -      \"libSDL2-2.0.so\" \"libSDL2.so\")")
    1.18 -    install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}")
    1.19 +      \"libSDL2-2.0.${SOEXT}\" \"libSDL2.${SOEXT}\")")
    1.20 +    install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
    1.21    endif()
    1.22    if(FREEBSD)
    1.23      # FreeBSD uses ${PREFIX}/libdata/pkgconfig