diff options
author | Eon Jeong <eonikupy@gmail.com> | 2016-07-15 17:46:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-07-18 13:06:31 (GMT) |
commit | c42e63a97eab73c5125e4619df58779e6c28659e (patch) | |
tree | 554005726c4df8412e00394783bc024d0b2a2738 /Modules | |
parent | ad2497aa054e40afa88b5288a59f2e6ad3a765c0 (diff) | |
download | CMake-c42e63a97eab73c5125e4619df58779e6c28659e.zip CMake-c42e63a97eab73c5125e4619df58779e6c28659e.tar.gz CMake-c42e63a97eab73c5125e4619df58779e6c28659e.tar.bz2 |
FindBISON: Add REPORT_FILE option to pass --report-file=FILE
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindBISON.cmake | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index f1df16d..bb1b577 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -24,6 +24,7 @@ # [COMPILE_FLAGS <flags>] # [DEFINES_FILE <file>] # [VERBOSE [<file>]] +# [REPORT_FILE <file>] # ) # # which will create a custom rule to generate a parser. ``<YaccInput>`` is @@ -41,7 +42,12 @@ # # ``VERBOSE [<file>]`` # Tell ``bison`` to write a report file of the grammar and parser. -# If given, the report file is copied to ``<file>``. +# If ``<file>`` is given, it specifies path the report file is copied to. +# ``[<file>]`` is left for backward compatibility of this module. +# Use ``VERBOSE REPORT_FILE <file>``. +# +# ``REPORT_FILE <file>`` +# Specify a non-default report ``<file>``, 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 [<file>] hack: <file> 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) |