|
|
|
@ -1,17 +1,28 @@
|
|
|
|
|
IF (APPLE)
|
|
|
|
|
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.osx.tar.gz
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.dylib)
|
|
|
|
|
SET(RUBYLIB ${CMAKE_CURRENT_SOURCE_DIR}/osx${DFHACK_BUILD_ARCH}/libruby.dylib)
|
|
|
|
|
SET(RUBYLIB_INSTALL_NAME "libruby.dylib")
|
|
|
|
|
IF(${DFHACK_BUILD_ARCH} STREQUAL 64)
|
|
|
|
|
MESSAGE("No ruby lib for 64-bit OS X yet")
|
|
|
|
|
ELSE()
|
|
|
|
|
DOWNLOAD_FILE_UNZIP("https://github.com/DFHack/dfhack-bin/releases/download/0.43.05/osx32-libruby187.dylib.gz"
|
|
|
|
|
"gz"
|
|
|
|
|
${RUBYLIB}.gz
|
|
|
|
|
"e9bc4263557e652121b055a46abb4f97"
|
|
|
|
|
${RUBYLIB}
|
|
|
|
|
"3ee5356759f764a440be5b5b44649826")
|
|
|
|
|
ENDIF()
|
|
|
|
|
ELSEIF(UNIX)
|
|
|
|
|
SET(RUBYLIB ${CMAKE_CURRENT_SOURCE_DIR}/linux${DFHACK_BUILD_ARCH}/libruby.so)
|
|
|
|
|
SET(RUBYLIB_INSTALL_NAME "libruby.so")
|
|
|
|
|
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.linux.tar.gz
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/libruby1.8.so.1.8.7 ${CMAKE_CURRENT_BINARY_DIR}/libruby.so)
|
|
|
|
|
SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.so)
|
|
|
|
|
ELSE()
|
|
|
|
|
SET(RUBYLIB ${CMAKE_CURRENT_SOURCE_DIR}/win${DFHACK_BUILD_ARCH}/libruby.dll)
|
|
|
|
|
SET(RUBYLIB_INSTALL_NAME "libruby.dll")
|
|
|
|
|
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/msvcrtruby187.tar.gz
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/msvcrt-ruby18.dll ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll)
|
|
|
|
|
SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll)
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
IF (APPLE OR UNIX)
|
|
|
|
@ -35,7 +46,7 @@ INCLUDE_DIRECTORIES("${dfhack_SOURCE_DIR}/depends/tthread")
|
|
|
|
|
DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread)
|
|
|
|
|
ADD_DEPENDENCIES(ruby ruby-autogen-rb)
|
|
|
|
|
|
|
|
|
|
INSTALL(FILES ${RUBYLIB} DESTINATION ${DFHACK_LIBRARY_DESTINATION})
|
|
|
|
|
INSTALL(FILES ${RUBYLIB} DESTINATION ${DFHACK_LIBRARY_DESTINATION} RENAME ${RUBYLIB_INSTALL_NAME})
|
|
|
|
|
|
|
|
|
|
INSTALL(DIRECTORY .
|
|
|
|
|
DESTINATION hack/ruby
|
|
|
|
|