FindBISON: Use BISON_TARGET macro argument names internally

The macro argument names are much clearer than ${ARGV#} references.
This commit is contained in:
Eon Jeong 2015-06-08 23:35:49 +09:00 committed by Brad King
parent 801b799f9d
commit 29985ad894
1 changed files with 5 additions and 5 deletions

View File

@ -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}")