Merge pull request #96 from matthew-cline/dfapi

CMake linux: copy LD_PRELOAD script
develop
Petr Mrázek 2011-07-12 17:55:06 -07:00
commit 927711d4e3
2 changed files with 22 additions and 0 deletions

@ -144,6 +144,15 @@ COMMAND ${CMAKE_COMMAND} -E make_directory ${DFHACK_PLUGIN_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${DFHACK_OUTPUT_DIR})
ADD_DEPENDENCIES(dfhack prepare)
# Copy our version of the df launch script which sets LD_PRELOAD
IF(UNIX)
ADD_CUSTOM_TARGET( prepare_UNIX
DEPENDS ${dfhack_SOURCE_DIR}/package/linux/dfhack
COMMAND ${CMAKE_COMMAND} -E make_directory ${DFHACK_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/package/linux/dfhack ${DFHACK_OUTPUT_DIR})
ADD_DEPENDENCIES(dfhack prepare_UNIX)
ENDIF()
install(TARGETS dfhack
LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION}
RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION}) #linux: lib

@ -0,0 +1,13 @@
#!/bin/sh
# NOTE: This is dfhack's modification of the normal invocation script,
# changed to properly set LD_PRELOAD so as to run DFHACK.
DF_DIR=$(dirname "$0")
cd "${DF_DIR}"
export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
export LD_PRELOAD=./libdfhack.so
./libs/Dwarf_Fortress $* # Go, go, go! :)