# #Ruby script interpreter # if (WIN32) #Ruby is not expected to be present on WIN32. #Build from sources and install where find_package(ruby) will find it. #If the internal design of Ruby had not relied on the internals of FILE, #the following would have worked. # #if (CMAKE_CL_64) # set (RUBY_TARGET x64-mswin64) #else (CMAKE_CL_64) # set (RUBY_TARGET i386-mswin32) #endif (CMAKE_CL_64) # #ExternalProject_Add ( # ruby # PREFIX ${CMAKE_INSTALL_PREFIX} # URL https://github.com/ruby/ruby/archive/v1_9_3_551.zip # DOWNLOAD_NAME ruby-1.9.3.551.zip # URL_MD5 0ff83255ab508d5d88e2f3a1f9e4fa4b # PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/patch . # CONFIGURE_COMMAND $/win32/configure.bat> # --yacc=$ # --target=${RUBY_TARGET} # --prefix= # --disable-install-doc # BUILD_COMMAND ${CMAKE_COMMAND} -E env BISON_SIMPLE=$ nmake # INSTALL_COMMAND nmake install # DEPENDS bison #) #Ruby source code turned out ot be quite a nest. #Install from a precompiled binary distribution instead. ExternalProject_Add ( ruby PREFIX ${CMAKE_INSTALL_PREFIX} URL http://dl.bintray.com/oneclick/rubyinstaller/ruby-1.9.3-p551-i386-mingw32.7z URL_MD5 73ba6e292d3afec5cecc68ec64fd85bf CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ) endif (WIN32) if (UNIX) #Rely on manual installation via the package manager #You can then invoke ruby as /usr/bin/ruby #sudo apt-get install ruby-full ExternalProject_Add ( ruby PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 DOWNLOAD_COMMAND "" UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND /usr/bin/ruby --version INSTALL_COMMAND "" ) endif (UNIX)