From 3d13492eac641f755ad13291560b91113c2a61d9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 20 Apr 2016 13:18:56 -0400 Subject: [PATCH 1/3] FindFLEX: Fix FLEX_TARGET macro for special characters in path (#16072) Use the VERBATIM option to add_custom_command so that the command is escaped correctly. --- Modules/FindFLEX.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake index ca6649359..b50c74acd 100644 --- a/Modules/FindFLEX.cmake +++ b/Modules/FindFLEX.cmake @@ -185,8 +185,8 @@ if(FLEX_EXECUTABLE) endif() add_custom_command(OUTPUT ${FLEX_TARGET_outputs} - COMMAND ${FLEX_EXECUTABLE} - ARGS ${FLEX_EXECUTABLE_opts} -o${Output} ${Input} + COMMAND ${FLEX_EXECUTABLE} ${FLEX_EXECUTABLE_opts} -o${Output} ${Input} + VERBATIM DEPENDS ${Input} COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) From f56a0ddd289827b5daca473b6a3e46efa5c8f15b Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 20 Apr 2016 13:19:31 -0400 Subject: [PATCH 2/3] FindBISON: Fix BISON_TARGET macro for special characters in path (#16072) Use the VERBATIM option to add_custom_command so that the command is escaped correctly. --- Modules/FindBISON.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index 7d81276c8..69293f5f3 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -125,10 +125,10 @@ if(BISON_EXECUTABLE) 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} - ARGS -E copy + 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}" @@ -201,8 +201,8 @@ if(BISON_EXECUTABLE) add_custom_command(OUTPUT ${BISON_TARGET_outputs} ${BISON_TARGET_extraoutputs} - COMMAND ${BISON_EXECUTABLE} - ARGS ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput} + COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput} + VERBATIM DEPENDS ${BisonInput} COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) From fd73bb601a629ce09868d3d7068272b3bd3870c3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 20 Apr 2016 13:21:48 -0400 Subject: [PATCH 3/3] Help: Add notes for topic 'fix-bison-flex-command-escaping' --- Help/release/dev/fix-bison-flex-command-escaping.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Help/release/dev/fix-bison-flex-command-escaping.rst diff --git a/Help/release/dev/fix-bison-flex-command-escaping.rst b/Help/release/dev/fix-bison-flex-command-escaping.rst new file mode 100644 index 000000000..dc2e87b38 --- /dev/null +++ b/Help/release/dev/fix-bison-flex-command-escaping.rst @@ -0,0 +1,12 @@ +fix-bison-flex-command-escaping +------------------------------- + +* The :module:`FindBISON` module ``BISON_TARGET`` macro now supports + special characters by passing the ``VERBATIM`` option to internal + :command:`add_custom_command` calls. This may break clients that + added escaping manually to work around the bug. + +* The :module:`FindFLEX` module ``FLEX_TARGET`` macro now supports + special characters by passing the ``VERBATIM`` option to internal + :command:`add_custom_command` calls. This may break clients that + added escaping manually to work around the bug.