[Cmake-commits] CMake branch, next, updated. v3.6.0-888-ge9aeb8a
Brad King
brad.king at kitware.com
Mon Jul 18 09:10:05 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via e9aeb8a4f8358253bce52f0aee64ccac792d5c58 (commit)
via ab8d5d0fdb28966d8a2fe68ee97c3816544ffb4e (commit)
via c42e63a97eab73c5125e4619df58779e6c28659e (commit)
via ad2497aa054e40afa88b5288a59f2e6ad3a765c0 (commit)
from a2cf135c9bf7d10e941c96ada22414a9b76a3e92 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9aeb8a4f8358253bce52f0aee64ccac792d5c58
commit e9aeb8a4f8358253bce52f0aee64ccac792d5c58
Merge: a2cf135 ab8d5d0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jul 18 09:10:04 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 18 09:10:04 2016 -0400
Merge topic 'FindBISON-report-file' into next
ab8d5d0f FindBISON: Refactor public and inner macro routines
c42e63a9 FindBISON: Add REPORT_FILE option to pass --report-file=FILE
ad2497aa FindBISON: Change usage of [VERBOSE <file>] to [VERBOSE [<file>]]
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab8d5d0fdb28966d8a2fe68ee97c3816544ffb4e
commit ab8d5d0fdb28966d8a2fe68ee97c3816544ffb4e
Author: Eon Jeong <eonikupy at gmail.com>
AuthorDate: Sat Jul 16 03:09:09 2016 +0900
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 18 09:06:36 2016 -0400
FindBISON: Refactor public and inner macro routines
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index bb1b577..6b1c7bd 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -126,14 +126,47 @@ if(BISON_EXECUTABLE)
endif()
# internal macro
- macro(BISON_TARGET_set_verbose_file BisonOutput)
- get_filename_component(BISON_TARGET_output_path "${BisonOutput}" PATH)
- get_filename_component(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
- set(BISON_TARGET_verbose_file
- "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
+ # sets BISON_TARGET_cmdopt
+ macro(BISON_TARGET_option_extraopts Options)
+ set(BISON_TARGET_cmdopt "")
+ set(BISON_TARGET_extraopts "${Options}")
+ separate_arguments(BISON_TARGET_extraopts)
+ list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
endmacro()
# internal macro
+ # sets BISON_TARGET_output_header and BISON_TARGET_cmdopt
+ macro(BISON_TARGET_option_defines BisonOutput Header)
+ if("${Header}" STREQUAL "")
+ # default header path generated by bison (see option -d)
+ string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${BisonOutput}")
+ string(REPLACE "c" "h" _fileext ${_fileext})
+ string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
+ BISON_TARGET_output_header "${BisonOutput}")
+ list(APPEND BISON_TARGET_cmdopt "-d")
+ else()
+ set(BISON_TARGET_output_header "${Header}")
+ list(APPEND BISON_TARGET_cmdopt "--defines=${BISON_TARGET_output_header}")
+ endif()
+ endmacro()
+
+ # internal macro
+ # sets BISON_TARGET_verbose_file and BISON_TARGET_cmdopt
+ macro(BISON_TARGET_option_report_file BisonOutput ReportFile)
+ if("${ReportFile}" STREQUAL "")
+ get_filename_component(BISON_TARGET_output_path "${BisonOutput}" PATH)
+ get_filename_component(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
+ set(BISON_TARGET_verbose_file
+ "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
+ else()
+ set(BISON_TARGET_verbose_file "${ReportFile}")
+ list(APPEND BISON_TARGET_cmdopt "--report-file=${BISON_TARGET_verbose_file}")
+ endif()
+ endmacro()
+
+ # internal macro
+ # adds a custom command and sets
+ # BISON_TARGET_cmdopt, BISON_TARGET_verbose_file, BISON_TARGET_extraoutputs
macro(BISON_TARGET_option_verbose Name BisonOutput filename)
list(APPEND BISON_TARGET_cmdopt "--verbose")
list(APPEND BISON_TARGET_extraoutputs
@@ -154,35 +187,13 @@ if(BISON_EXECUTABLE)
endif()
endmacro()
- # internal macro
- macro(BISON_TARGET_option_extraopts Options)
- set(BISON_TARGET_extraopts "${Options}")
- separate_arguments(BISON_TARGET_extraopts)
- list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
- endmacro()
-
- # internal macro
- macro(BISON_TARGET_option_defines Header)
- set(BISON_TARGET_output_header "${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()
-
#============================================================
# BISON_TARGET (public macro)
#============================================================
#
macro(BISON_TARGET Name BisonInput BisonOutput)
- set(BISON_TARGET_output_header "")
- set(BISON_TARGET_cmdopt "")
set(BISON_TARGET_outputs "${BisonOutput}")
set(BISON_TARGET_extraoutputs "")
- BISON_TARGET_set_verbose_file("${BisonOutput}")
# Parsing parameters
set(BISON_TARGET_PARAM_OPTIONS
@@ -209,15 +220,10 @@ 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()
+
+ BISON_TARGET_option_extraopts("${BISON_TARGET_ARG_COMPILE_FLAGS}")
+ BISON_TARGET_option_defines("${BisonOutput}" "${BISON_TARGET_ARG_DEFINES_FILE}")
+ BISON_TARGET_option_report_file("${BisonOutput}" "${BISON_TARGET_ARG_REPORT_FILE}")
if(NOT "${BISON_TARGET_ARG_VERBOSE}" STREQUAL "")
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${BISON_TARGET_ARG_VERBOSE}")
else()
@@ -230,14 +236,6 @@ if(BISON_EXECUTABLE)
endif()
endif()
- if("${BISON_TARGET_output_header}" STREQUAL "")
- # Header's name generated by bison (see option -d)
- list(APPEND BISON_TARGET_cmdopt "-d")
- string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${BisonOutput}")
- string(REPLACE "c" "h" _fileext ${_fileext})
- string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
- BISON_TARGET_output_header "${BisonOutput}")
- endif()
list(APPEND BISON_TARGET_outputs "${BISON_TARGET_output_header}")
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c42e63a97eab73c5125e4619df58779e6c28659e
commit c42e63a97eab73c5125e4619df58779e6c28659e
Author: Eon Jeong <eonikupy at gmail.com>
AuthorDate: Sat Jul 16 02:46:54 2016 +0900
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 18 09:06:31 2016 -0400
FindBISON: Add REPORT_FILE option to pass --report-file=FILE
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)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad2497aa054e40afa88b5288a59f2e6ad3a765c0
commit ad2497aa054e40afa88b5288a59f2e6ad3a765c0
Author: Eon Jeong <eonikupy at gmail.com>
AuthorDate: Sat Jul 16 00:54:56 2016 +0900
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 18 09:06:16 2016 -0400
FindBISON: Change usage of [VERBOSE <file>] to [VERBOSE [<file>]]
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 69293f5..f1df16d 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -23,7 +23,7 @@
# BISON_TARGET(<Name> <YaccInput> <CodeOutput>
# [COMPILE_FLAGS <flags>]
# [DEFINES_FILE <file>]
-# [VERBOSE <file>]
+# [VERBOSE [<file>]]
# )
#
# which will create a custom rule to generate a parser. ``<YaccInput>`` is
@@ -39,9 +39,9 @@
# ``DEFINES_FILE <file>``
# Specify a non-default header ``<file>`` to be generated by ``bison``.
#
-# ``VERBOSE <file>``
-# Tell ``bison`` to write verbose descriptions of the grammar and
-# parser to the given ``<file>``.
+# ``VERBOSE [<file>]``
+# Tell ``bison`` to write a report file of the grammar and parser.
+# If given, the report file is copied to ``<file>``.
#
# The macro defines the following variables:
#
@@ -58,7 +58,7 @@
# The header file generated by bison
#
# ``BISON_<Name>_OUTPUTS``
-# The sources files generated by bison
+# All files generated by bison including the source, the header and the report
#
# ``BISON_<Name>_COMPILE_FLAGS``
# Options used in the ``bison`` command line
@@ -120,25 +120,35 @@ if(BISON_EXECUTABLE)
endif()
# internal macro
- macro(BISON_TARGET_option_verbose Name BisonOutput filename)
- list(APPEND BISON_TARGET_cmdopt "--verbose")
+ macro(BISON_TARGET_set_verbose_file BisonOutput)
get_filename_component(BISON_TARGET_output_path "${BisonOutput}" PATH)
get_filename_component(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
- add_custom_command(OUTPUT ${filename}
- COMMAND ${CMAKE_COMMAND} -E copy
- "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
- "${filename}"
- VERBATIM
- DEPENDS
- "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
- COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- set(BISON_${Name}_VERBOSE_FILE ${filename})
- list(APPEND BISON_TARGET_extraoutputs
+ set(BISON_TARGET_verbose_file
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
endmacro()
# internal macro
+ macro(BISON_TARGET_option_verbose Name BisonOutput filename)
+ list(APPEND BISON_TARGET_cmdopt "--verbose")
+ list(APPEND BISON_TARGET_extraoutputs
+ "${BISON_TARGET_verbose_file}")
+ if (NOT "${filename}" STREQUAL "")
+ add_custom_command(OUTPUT ${filename}
+ COMMAND ${CMAKE_COMMAND} -E copy
+ "${BISON_TARGET_verbose_file}"
+ "${filename}"
+ VERBATIM
+ DEPENDS
+ "${BISON_TARGET_verbose_file}"
+ COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ set(BISON_${Name}_VERBOSE_FILE ${filename})
+ list(APPEND BISON_TARGET_extraoutputs
+ "${filename}")
+ endif()
+ endmacro()
+
+ # internal macro
macro(BISON_TARGET_option_extraopts Options)
set(BISON_TARGET_extraopts "${Options}")
separate_arguments(BISON_TARGET_extraopts)
@@ -159,15 +169,19 @@ if(BISON_EXECUTABLE)
set(BISON_TARGET_output_header "")
set(BISON_TARGET_cmdopt "")
set(BISON_TARGET_outputs "${BisonOutput}")
+ set(BISON_TARGET_extraoutputs "")
+ BISON_TARGET_set_verbose_file("${BisonOutput}")
# Parsing parameters
- set(BISON_TARGET_PARAM_OPTIONS)
+ set(BISON_TARGET_PARAM_OPTIONS
+ )
set(BISON_TARGET_PARAM_ONE_VALUE_KEYWORDS
- VERBOSE
COMPILE_FLAGS
DEFINES_FILE
)
- set(BISON_TARGET_PARAM_MULTI_VALUE_KEYWORDS)
+ set(BISON_TARGET_PARAM_MULTI_VALUE_KEYWORDS
+ VERBOSE
+ )
cmake_parse_arguments(
BISON_TARGET_ARG
"${BISON_TARGET_PARAM_OPTIONS}"
@@ -178,9 +192,20 @@ if(BISON_EXECUTABLE)
if(NOT "${BISON_TARGET_ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
message(SEND_ERROR "Usage")
+ elseif("${BISON_TARGET_ARG_VERBOSE}" MATCHES ";")
+ # [VERBOSE [<file>] hack: <file> is non-multi value by usage
+ message(SEND_ERROR "Usage")
else()
if(NOT "${BISON_TARGET_ARG_VERBOSE}" STREQUAL "")
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${BISON_TARGET_ARG_VERBOSE}")
+ else()
+ # [VERBOSE [<file>]] is used with no argument or is not used
+ set(BISON_TARGET_args "${ARGN}")
+ list(FIND BISON_TARGET_args "VERBOSE" BISON_TARGET_args_indexof_verbose)
+ if(${BISON_TARGET_args_indexof_verbose} GREATER -1)
+ # VERBOSE is used without <file>
+ 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}")
@@ -200,7 +225,7 @@ if(BISON_EXECUTABLE)
list(APPEND BISON_TARGET_outputs "${BISON_TARGET_output_header}")
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
- ${BISON_TARGET_extraoutputs}
+ ${BISON_TARGET_verbose_file}
COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput}
VERBATIM
DEPENDS ${BisonInput}
@@ -210,7 +235,7 @@ if(BISON_EXECUTABLE)
# define target variables
set(BISON_${Name}_DEFINED TRUE)
set(BISON_${Name}_INPUT ${BisonInput})
- set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
+ set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs} ${BISON_TARGET_extraoutputs})
set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
set(BISON_${Name}_OUTPUT_HEADER "${BISON_TARGET_output_header}")
-----------------------------------------------------------------------
Summary of changes:
Modules/FindBISON.cmake | 135 ++++++++++++++++++++++++++++++-----------------
1 file changed, 87 insertions(+), 48 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list