summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-06 20:21:16 (GMT)
committerBrad King <brad.king@kitware.com>2016-04-06 20:49:13 (GMT)
commit4d8c988caa1f5e13821a6fb392cd72e681082e97 (patch)
tree3c2790c2aa9409e3ec5d32b91b696b94e580a923 /Modules/ExternalProject.cmake
parent23a71e4e4d5ca6bdb39e250335074a2b8ab74a02 (diff)
downloadCMake-4d8c988caa1f5e13821a6fb392cd72e681082e97.zip
CMake-4d8c988caa1f5e13821a6fb392cd72e681082e97.tar.gz
CMake-4d8c988caa1f5e13821a6fb392cd72e681082e97.tar.bz2
ExternalProject: Fix file download script with CMAKE_TLS_{VERIFY,CAINFO}
Avoid generating incorrect code such as set(CMAKE_TLS_VERIFY set(CMAKE_TLS_VERIFY 1)) when one of these variables is set in the calling project.
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 1859890..1f3dc38 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -859,12 +859,15 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
set(hash_check "")
endif()
+ set(tls_verify_code "")
+ set(tls_cainfo_code "")
+
# check for curl globals in the project
if(DEFINED CMAKE_TLS_VERIFY)
- set(tls_verify "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})")
+ set(tls_verify_code "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})")
endif()
if(DEFINED CMAKE_TLS_CAINFO)
- set(tls_cainfo "set(CMAKE_TLS_CAINFO \"${CMAKE_TLS_CAINFO}\")")
+ set(tls_cainfo_code "set(CMAKE_TLS_CAINFO \"${CMAKE_TLS_CAINFO}\")")
endif()
# now check for curl locals so that the local values
@@ -873,12 +876,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
# check for tls_verify argument
string(LENGTH "${tls_verify}" tls_verify_len)
if(tls_verify_len GREATER 0)
- set(tls_verify "set(CMAKE_TLS_VERIFY ${tls_verify})")
+ set(tls_verify_code "set(CMAKE_TLS_VERIFY ${tls_verify})")
endif()
# check for tls_cainfo argument
string(LENGTH "${tls_cainfo}" tls_cainfo_len)
if(tls_cainfo_len GREATER 0)
- set(tls_cainfo "set(CMAKE_TLS_CAINFO \"${tls_cainfo}\")")
+ set(tls_cainfo_code "set(CMAKE_TLS_CAINFO \"${tls_cainfo}\")")
endif()
file(WRITE ${script_filename}
@@ -887,8 +890,8 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
dst='${local}'
timeout='${timeout_msg}'\")
-${tls_verify}
-${tls_cainfo}
+${tls_verify_code}
+${tls_cainfo_code}
file(DOWNLOAD
\"${remote}\"