ExternalProject: add LOG_PATCH option to log the patch command

Most steps support the logging into a file but the patch command is a
notable exception. This commit adds the LOG_PATCH options that acts as
the other LOG_* options.
This commit is contained in:
Wouter Klouwen
2018-10-26 12:44:14 +01:00
parent 2a8c05ddc7
commit a4e9391953
4 changed files with 16 additions and 0 deletions

View File

@@ -877,6 +877,7 @@ syn keyword cmakeKWExternalProject contained
\ LOG_DOWNLOAD
\ LOG_INSTALL
\ LOG_MERGED_STDOUTERR
\ LOG_PATCH
\ LOG_TEST
\ LOG_UPDATE
\ MAKE_EXE

View File

@@ -3,3 +3,6 @@ ExternalProject-log-options
* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
gained ``LOG_PATCH`` to optionally log the patch step.

View File

@@ -532,6 +532,9 @@ External Project Definition
``LOG_UPDATE <bool>``
When enabled, the output of the update step is logged to files.
``LOG_PATCH <bool>``
When enabled, the output of the patch step is logged to files.
``LOG_CONFIGURE <bool>``
When enabled, the output of the configure step is logged to files.
@@ -2760,10 +2763,18 @@ function(_ep_add_patch_command name)
set(work_dir ${source_dir})
endif()
get_property(log TARGET ${name} PROPERTY _EP_LOG_PATCH)
if(log)
set(log LOG 1)
else()
set(log "")
endif()
ExternalProject_Add_Step(${name} patch
COMMAND ${cmd}
WORKING_DIRECTORY ${work_dir}
DEPENDEES download
${log}
)
endfunction()

View File

@@ -100,6 +100,7 @@ ExternalProject_Add(${proj}
-DTEST_LIST:STRING=A::B::C
INSTALL_COMMAND ""
LOG_CONFIGURE 1
LOG_PATCH 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR")