# #ragel # #Ragel State Machine Compiler # #A client project can import the ragel tool as follows (crosscompiling or not): # #find_file (IMPORT_RAGEL "tool/ragel.cmake") #include (${IMPORT_RAGEL}) #add_custom_command ( # OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.cpp # COMMAND tool-ragel ${CMAKE_CURRENT_SOURCE_DIR}/input.rl -o ${CMAKE_CURRENT_BINARY_DIR}/generated.cpp # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/input.rl #) # #The file ${CMAKE_CURRENT_BINARY_DIR}/generated.cpp can be specified as input #to the (cross)compiler as if it was an ordinary source file. #For further details, see #http://www.vtk.org/Wiki/CMake_Cross_Compiling #http://www.cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets if (WIN32) ExternalProject_Add ( ragel PREFIX ${CMAKE_INSTALL_PREFIX} URL http://www.colm.net/files/ragel/ragel-6.9.tar.gz URL_MD5 0c3110d7f17f7af4d9cb774443898dc1 PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/patch . CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_BUILD_TYPE:STRING=Release ) endif (WIN32) if (UNIX) #Rely on manual installation via the package manager #You can then invoke ragel as /usr/bin/ragel #sudo apt-get -q -y install ragel ExternalProject_Add ( ragel PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 DOWNLOAD_COMMAND "" UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND /usr/bin/ragel --version INSTALL_COMMAND "" ) endif (UNIX)