From 2c4bb705e842db66904df5014a5755b57ac51b72 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 2 Apr 2020 08:49:21 -0400 Subject: ExternalProject: allow `DOWNLOAD_NO_EXTRACT OFF` Fixes: #20531 --- Modules/ExternalProject.cmake | 2 +- Tests/ExternalProject/CMakeLists.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 5bac0d8..a9448e5 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2595,7 +2595,7 @@ function(_ep_add_download_command name) set(cmd ${CMAKE_COMMAND} -E rm -rf ${source_dir} COMMAND ${CMAKE_COMMAND} -E copy_directory ${abs_dir} ${source_dir}) else() - get_property(no_extract TARGET "${name}" PROPERTY _EP_DOWNLOAD_NO_EXTRACT SET) + get_property(no_extract TARGET "${name}" PROPERTY _EP_DOWNLOAD_NO_EXTRACT) if("${url}" MATCHES "^[a-z]+://") # TODO: Should download and extraction be different steps? if("x${fname}" STREQUAL "x") diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 450e7e5..c8850ea 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -100,6 +100,15 @@ ExternalProject_Add(${proj} INSTALL_COMMAND "" ) +set(proj NoExtractBool) +ExternalProject_Add(${proj} + URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz + DOWNLOAD_NO_EXTRACT 0 + LOG_DOWNLOAD 1 + BUILD_COMMAND "" + CONFIGURE_COMMAND "" + INSTALL_COMMAND "" +) # CVS-based tests: # -- cgit v0.12