Commit 29985ad8 authored by Eon Jeong's avatar Eon Jeong Committed by Brad King
Browse files

FindBISON: Use BISON_TARGET macro argument names internally

The macro argument names are much clearer than ${ARGV#} references.
parent 801b799f
......@@ -171,23 +171,23 @@ if(BISON_EXECUTABLE)
# Header's name generated by bison (see option -d)
list(APPEND BISON_TARGET_cmdopt "-d")
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${BisonOutput}")
string(REPLACE "c" "h" _fileext ${_fileext})
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
BISON_${Name}_OUTPUT_HEADER "${BisonOutput}")
list(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
${BISON_TARGET_extraoutputs}
COMMAND ${BISON_EXECUTABLE}
ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
DEPENDS ${ARGV1}
ARGS ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput}
DEPENDS ${BisonInput}
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# define target variables
set(BISON_${Name}_DEFINED TRUE)
set(BISON_${Name}_INPUT ${ARGV1})
set(BISON_${Name}_INPUT ${BisonInput})
set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment