From 1240f8e0a6c1b80fff3cce3f90e92397e0ac9be0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 3 Jan 2016 20:52:44 -0500 Subject: [PATCH] CMake: Don't make a libSDL2.so symlink on Mac OS X (do .dylib instead). --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74356b60f..26b373b51 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1507,12 +1507,17 @@ endforeach() list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) -if(NOT WINDOWS OR CYGWIN) +if(NOT (WINDOWS OR CYGWIN)) if(SDL_SHARED) + if (APPLE) + set(SOEXT "dylib") + else() + set(SOEXT "so") + endif() install(CODE " execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - \"libSDL2-2.0.so\" \"libSDL2.so\")") - install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}") + \"libSDL2-2.0.${SOEXT}\" \"libSDL2.${SOEXT}\")") + install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}") endif() if(FREEBSD) # FreeBSD uses ${PREFIX}/libdata/pkgconfig