diff options
author | Brad King <brad.king@kitware.com> | 2018-10-09 13:03:04 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-10-09 13:03:10 (GMT) |
commit | afd5d17bace86149e2b99dca3cd1a51691318b34 (patch) | |
tree | c1e292c22192ba8cca762d9a920b1a2623adbdc7 /Modules | |
parent | 577a9a88ad832c35982814b7c485cbebc89fffb9 (diff) | |
parent | c64797fa94de29ef3f5f9c940273036c9ebf64ee (diff) | |
download | CMake-afd5d17bace86149e2b99dca3cd1a51691318b34.zip CMake-afd5d17bace86149e2b99dca3cd1a51691318b34.tar.gz CMake-afd5d17bace86149e2b99dca3cd1a51691318b34.tar.bz2 |
Merge topic 'FindBISON-fix-verbose-file'
c64797fa94 FindBISON: Fix "multiple rules generate" error on VERBOSE output
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2467
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindBISON.cmake | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index d684ccd..2000f7f 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -149,17 +149,25 @@ if(BISON_EXECUTABLE) set(BISON_TARGET_verbose_file "${ReportFile}") list(APPEND BISON_TARGET_cmdopt "--report-file=${BISON_TARGET_verbose_file}") endif() + if(NOT IS_ABSOLUTE "${BISON_TARGET_verbose_file}") + set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_SOURCE_DIR}/${BISON_TARGET_verbose_file}") + endif() endmacro() # internal macro # adds a custom command and sets - # BISON_TARGET_cmdopt, BISON_TARGET_verbose_file, BISON_TARGET_extraoutputs + # BISON_TARGET_cmdopt, BISON_TARGET_extraoutputs macro(BISON_TARGET_option_verbose Name BisonOutput filename) list(APPEND BISON_TARGET_cmdopt "--verbose") - list(APPEND BISON_TARGET_extraoutputs + list(APPEND BISON_TARGET_outputs "${BISON_TARGET_verbose_file}") if (NOT "${filename}" STREQUAL "") - add_custom_command(OUTPUT ${filename} + if(IS_ABSOLUTE "${filename}") + set(BISON_TARGET_verbose_extra_file "${filename}") + else() + set(BISON_TARGET_verbose_extra_file "${CMAKE_CURRENT_SOURCE_DIR}/${filename}") + endif() + add_custom_command(OUTPUT ${BISON_TARGET_verbose_extra_file} COMMAND ${CMAKE_COMMAND} -E copy "${BISON_TARGET_verbose_file}" "${filename}" @@ -167,10 +175,10 @@ if(BISON_EXECUTABLE) 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}) + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) list(APPEND BISON_TARGET_extraoutputs - "${filename}") + "${BISON_TARGET_verbose_extra_file}") + unset(BISON_TARGET_verbose_extra_file) endif() endmacro() @@ -226,7 +234,6 @@ if(BISON_EXECUTABLE) list(APPEND BISON_TARGET_outputs "${BISON_TARGET_output_header}") add_custom_command(OUTPUT ${BISON_TARGET_outputs} - ${BISON_TARGET_extraoutputs} COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput} VERBATIM DEPENDS ${BisonInput} |