Make a separate copy of DF's SDL library to link against on OS X

Linking to any library with ".framework" in its path on OS X causes
that directory to be included in the include path (with -F), which
causes all of the DFHack core to be rebuilt unnecessarily when
changing DF folders.
develop
lethosor 2015-12-01 17:32:59 -05:00
parent 4382198de4
commit 8b406cc0b3
1 changed files with 4 additions and 2 deletions

@ -304,10 +304,12 @@ ENDIF()
SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" )
IF(APPLE)
SET(SDL_LIBRARY ${CMAKE_INSTALL_PREFIX}/libs/SDL.framework)
IF(NOT EXISTS ${SDL_LIBRARY})
SET(DF_SDL_LIBRARY ${CMAKE_INSTALL_PREFIX}/libs/SDL.framework/Versions/A/SDL)
IF(NOT EXISTS ${DF_SDL_LIBRARY})
MESSAGE(SEND_ERROR "SDL framework not found. Make sure CMAKE_INSTALL_PREFIX is specified and correct.")
ENDIF()
SET(SDL_LIBRARY ${CMAKE_BINARY_DIR}/SDL)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DF_SDL_LIBRARY} ${SDL_LIBRARY})
SET(CXX_LIBRARY ${CMAKE_INSTALL_PREFIX}/libs/libstdc++.6.dylib)
SET(ZIP_LIBRARY /usr/lib/libz.dylib)
TARGET_LINK_LIBRARIES(dfhack ${SDL_LIBRARY})