diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index 6d0ace7aad..fca054dd7d 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -9,30 +9,34 @@ Find ``bison`` executable and provide a macro to generate custom build rules. The module defines the following variables: +``BISON_FOUND`` + True if the program was found. + ``BISON_EXECUTABLE`` - path to the ``bison`` program + The path to the ``bison`` program. ``BISON_VERSION`` - version of ``bison`` - -``BISON_FOUND`` - "True" if the program was found + The version of ``bison``. The minimum required version of ``bison`` can be specified using the -standard CMake syntax, e.g. :command:`find_package(BISON 2.1.3)`. +standard CMake syntax, e.g. :command:`find_package(BISON 2.1.3)`. -If ``bison`` is found, the module defines the macro:: +If ``bison`` is found, the module defines the macro: - BISON_TARGET( - [COMPILE_FLAGS ] - [DEFINES_FILE ] - [VERBOSE []] - [REPORT_FILE ] - ) +.. command:: bison_target + + .. code-block:: cmake + + bison_target( + [COMPILE_FLAGS ] + [DEFINES_FILE ] + [VERBOSE []] + [REPORT_FILE ] + ) which will create a custom rule to generate a parser. ```` is the path to a yacc file. ```` is the name of the source file -generated by bison. A header file is also be generated, and contains +generated by bison. A header file can also be generated, and contains the token list. .. versionchanged:: 3.14 @@ -41,8 +45,9 @@ the token list. The options are: -``COMPILE_FLAGS `` - Specify flags to be added to the ``bison`` command line. +``COMPILE_FLAGS `` + Space-separated bison options added to the ``bison`` command line. + A :ref:`;-list ` will not work. ``DEFINES_FILE `` .. versionadded:: 3.4 @@ -65,29 +70,31 @@ The options are: The macro defines the following variables: ``BISON__DEFINED`` - ``True`` is the macro ran successfully + True if the macro ran successfully. ``BISON__INPUT`` - The input source file, an alias for + The input source file, an alias for ````. ``BISON__OUTPUT_SOURCE`` - The source file generated by bison + The source file generated by ``bison``. ``BISON__OUTPUT_HEADER`` - The header file generated by bison + The header file generated by ``bison``. ``BISON__OUTPUTS`` - All files generated by bison including the source, the header and the report + All files generated by ``bison`` including the source, the header and the + report. ``BISON__COMPILE_FLAGS`` - Options used in the ``bison`` command line + Options used in the ``bison`` command line. -Example usage: +Examples +^^^^^^^^ .. code-block:: cmake find_package(BISON) - BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp + bison_target(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h) add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS}) #]=======================================================================]