summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-29 13:57:10 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-10-29 13:57:17 (GMT)
commitd6b7c037b2e360c7b3f3e6952ddc108746274b05 (patch)
tree65a441ecfb3408220238e841306c76a6b710a807
parentbcd61da3503be85d247657827e5fb08db3ecf07d (diff)
parenta4e9391953b9906b085cbc1c6d6909d049e540dd (diff)
downloadCMake-d6b7c037b2e360c7b3f3e6952ddc108746274b05.zip
CMake-d6b7c037b2e360c7b3f3e6952ddc108746274b05.tar.gz
CMake-d6b7c037b2e360c7b3f3e6952ddc108746274b05.tar.bz2
Merge topic 'ExternalProject-log-patch'
a4e9391953 ExternalProject: add LOG_PATCH option to log the patch command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2534
-rw-r--r--Auxiliary/vim/syntax/cmake.vim1
-rw-r--r--Help/release/dev/ExternalProject-log-options.rst3
-rw-r--r--Modules/ExternalProject.cmake11
-rw-r--r--Tests/ExternalProjectLocal/CMakeLists.txt1
4 files changed, 16 insertions, 0 deletions
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 <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()
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")