diff options
author | Brad King <brad.king@kitware.com> | 2018-10-09 13:01:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-09 13:01:21 (GMT) |
commit | f6193d92fd6c99db81126bd8ff812797ed629be9 (patch) | |
tree | fc6c5dc9514cb5054cea91bd468f2fd12edbba4e | |
parent | 54f0ae5414632043ede652797d6c200e6c57dc26 (diff) | |
parent | c64797fa94de29ef3f5f9c940273036c9ebf64ee (diff) | |
download | CMake-f6193d92fd6c99db81126bd8ff812797ed629be9.zip CMake-f6193d92fd6c99db81126bd8ff812797ed629be9.tar.gz CMake-f6193d92fd6c99db81126bd8ff812797ed629be9.tar.bz2 |
Merge branch 'FindBISON-fix-verbose-file' into release-3.13
Merge-request: !2467
-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} |