From a4e9391953b9906b085cbc1c6d6909d049e540dd Mon Sep 17 00:00:00 2001 From: Wouter Klouwen Date: Fri, 26 Oct 2018 12:44:14 +0100 Subject: 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. --- Auxiliary/vim/syntax/cmake.vim | 1 + Help/release/dev/ExternalProject-log-options.rst | 3 +++ Modules/ExternalProject.cmake | 11 +++++++++++ Tests/ExternalProjectLocal/CMakeLists.txt | 1 + 4 files changed, 16 insertions(+) diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 25384e4..d4d0edf 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -877,6 +877,7 @@ syn keyword cmakeKWExternalProject contained \ LOG_DOWNLOAD \ LOG_INSTALL \ LOG_MERGED_STDOUTERR + \ LOG_PATCH \ LOG_TEST \ LOG_UPDATE \ MAKE_EXE diff --git a/Help/release/dev/ExternalProject-log-options.rst b/Help/release/dev/ExternalProject-log-options.rst index 2fc4c4f..88bc799 100644 --- a/Help/release/dev/ExternalProject-log-options.rst +++ b/Help/release/dev/ExternalProject-log-options.rst @@ -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. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index a8c31ed..93cd74a 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -532,6 +532,9 @@ External Project Definition ``LOG_UPDATE `` When enabled, the output of the update step is logged to files. + ``LOG_PATCH `` + When enabled, the output of the patch step is logged to files. + ``LOG_CONFIGURE `` 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() diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt index 5b94163..55fd713 100644 --- a/Tests/ExternalProjectLocal/CMakeLists.txt +++ b/Tests/ExternalProjectLocal/CMakeLists.txt @@ -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") -- cgit v0.12