multistage autogen en route
parent
3f39e285d0
commit
689cc50409
@ -1,9 +1,26 @@
|
|||||||
find_package(Ruby)
|
find_package(Ruby)
|
||||||
if(RUBY_FOUND)
|
if(RUBY_FOUND)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ruby-autogen.cpp
|
||||||
|
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/codegen.pl ${dfhack_SOURCE_DIR}/library/include/df/codegen.out.xml ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.cpp
|
||||||
|
DEPENDS ${dfhack_SOURCE_DIR}/library/include/df/codegen.out.xml codegen.pl
|
||||||
|
)
|
||||||
|
ADD_EXECUTABLE(ruby-autogen ruby-autogen.cpp)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ruby-autogen.offsets
|
||||||
|
COMMAND ruby-autogen ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.offsets
|
||||||
|
DEPENDS ruby-autogen
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ruby-autogen.rb
|
||||||
|
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/codegen.pl ${dfhack_SOURCE_DIR}/library/include/df/codegen.out.xml ${CMAKE_CURRENT_SOURCE_DIR}/ruby-autogen.rb ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.offsets
|
||||||
|
DEPENDS ruby-autogen.offsets
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_TARGET(ruby-autogen-rb ALL DEPENDS ruby-autogen.rb)
|
||||||
include_directories("${dfhack_SOURCE_DIR}/depends/tthread" ${RUBY_INCLUDE_PATH})
|
include_directories("${dfhack_SOURCE_DIR}/depends/tthread" ${RUBY_INCLUDE_PATH})
|
||||||
DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread)
|
DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread)
|
||||||
target_link_libraries(ruby ${RUBY_LIBRARY})
|
target_link_libraries(ruby ${RUBY_LIBRARY})
|
||||||
install(FILES ruby.rb DESTINATION ${DFHACK_LIBRARY_DESTINATION})
|
install(FILES ruby.rb ruby-autogen.rb DESTINATION ${DFHACK_LIBRARY_DESTINATION})
|
||||||
else(RUBY_FOUND)
|
else(RUBY_FOUND)
|
||||||
MESSAGE(STATUS "Required library (ruby) not found - ruby plugin can't be built.")
|
MESSAGE(STATUS "Required library (ruby) not found - ruby plugin can't be built.")
|
||||||
endif(RUBY_FOUND)
|
endif(RUBY_FOUND)
|
||||||
|
Loading…
Reference in New Issue