3 find_program(LEMON_EXECUTABLE lemon)
7 macro(generate_lemon_file _out _in)
11 # These files are generated as side-effect
14 COMMAND ${LEMON_EXECUTABLE}
15 -T/usr/share/lemon/lempar.c
22 add_custom_target(lemon)
24 # Compile bundled lemon with support for -- to end options
25 macro(generate_lemon_file _out _in)
29 # These files are generated as side-effect
32 COMMAND $<TARGET_FILE:lemon>
33 -T${CMAKE_SOURCE_DIR}/tools/lemon/lempar.c
40 ${CMAKE_SOURCE_DIR}/tools/lemon/lempar.c
45 macro(ADD_LEMON_FILES _source _generated)
47 foreach (_current_FILE ${ARGN})
48 get_filename_component(_in ${_current_FILE} ABSOLUTE)
49 get_filename_component(_basename ${_current_FILE} NAME_WE)
51 set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename})
53 generate_lemon_file(${_out} ${_in})
55 list(APPEND ${_source} ${_in})
56 list(APPEND ${_generated} ${_out}.c)
57 endforeach(_current_FILE)
58 endmacro(ADD_LEMON_FILES)