diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index f1df16db6..bb1b577c1 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -24,6 +24,7 @@ # [COMPILE_FLAGS ] # [DEFINES_FILE ] # [VERBOSE []] +# [REPORT_FILE ] # ) # # which will create a custom rule to generate a parser. ```` is @@ -41,7 +42,12 @@ # # ``VERBOSE []`` # Tell ``bison`` to write a report file of the grammar and parser. -# If given, the report file is copied to ````. +# If ```` is given, it specifies path the report file is copied to. +# ``[]`` is left for backward compatibility of this module. +# Use ``VERBOSE REPORT_FILE ``. +# +# ``REPORT_FILE `` +# Specify a non-default report ````, if generated. # # The macro defines the following variables: # @@ -158,7 +164,13 @@ if(BISON_EXECUTABLE) # internal macro macro(BISON_TARGET_option_defines Header) set(BISON_TARGET_output_header "${Header}") - list(APPEND BISON_TARGET_cmdopt --defines=${BISON_TARGET_output_header}) + list(APPEND BISON_TARGET_cmdopt "--defines=${BISON_TARGET_output_header}") + endmacro() + + # internal macro + macro(BISON_TARGET_option_report_file ReportFile) + set(BISON_TARGET_verbose_file "${ReportFile}") + list(APPEND BISON_TARGET_cmdopt "--report-file=${BISON_TARGET_verbose_file}") endmacro() #============================================================ @@ -178,6 +190,7 @@ if(BISON_EXECUTABLE) set(BISON_TARGET_PARAM_ONE_VALUE_KEYWORDS COMPILE_FLAGS DEFINES_FILE + REPORT_FILE ) set(BISON_TARGET_PARAM_MULTI_VALUE_KEYWORDS VERBOSE @@ -196,6 +209,15 @@ if(BISON_EXECUTABLE) # [VERBOSE [] hack: is non-multi value by usage message(SEND_ERROR "Usage") else() + if(NOT "${BISON_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "") + BISON_TARGET_option_extraopts("${BISON_TARGET_ARG_COMPILE_FLAGS}") + endif() + if(NOT "${BISON_TARGET_ARG_DEFINES_FILE}" STREQUAL "") + BISON_TARGET_option_defines("${BISON_TARGET_ARG_DEFINES_FILE}") + endif() + if(NOT "${BISON_TARGET_ARG_REPORT_FILE}" STREQUAL "") + BISON_TARGET_option_report_file("${BISON_TARGET_ARG_REPORT_FILE}") + endif() if(NOT "${BISON_TARGET_ARG_VERBOSE}" STREQUAL "") BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${BISON_TARGET_ARG_VERBOSE}") else() @@ -207,12 +229,6 @@ if(BISON_EXECUTABLE) BISON_TARGET_option_verbose(${Name} ${BisonOutput} "") endif() endif() - if(NOT "${BISON_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "") - BISON_TARGET_option_extraopts("${BISON_TARGET_ARG_COMPILE_FLAGS}") - endif() - if(NOT "${BISON_TARGET_ARG_DEFINES_FILE}" STREQUAL "") - BISON_TARGET_option_defines("${BISON_TARGET_ARG_DEFINES_FILE}") - endif() if("${BISON_TARGET_output_header}" STREQUAL "") # Header's name generated by bison (see option -d)