[vcpkg-scripts] Remove double expansions

This commit is contained in:
Robert Schumacher 2017-10-12 08:22:50 -07:00
parent d2c728e0bc
commit 5c66f301b9
3 changed files with 9 additions and 6 deletions

View File

@ -26,7 +26,7 @@ function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT)
set(download_success 1)
endif()
if (NOT ${download_success})
if (NOT download_success)
message(FATAL_ERROR
"\n"
" Failed to download file.\n"

View File

@ -78,7 +78,7 @@ function(vcpkg_download_distfile VAR)
endif()
endforeach(url)
if (NOT ${download_success})
if (NOT download_success)
message(FATAL_ERROR
"\n"
" Failed to download file.\n"

View File

@ -34,7 +34,8 @@
## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
function(vcpkg_find_acquire_program VAR)
if(${VAR} AND NOT ${VAR} MATCHES "-NOTFOUND")
set(EXPANDED_VAR ${${VAR}})
if(EXPANDED_VAR)
return()
endif()
@ -153,7 +154,8 @@ function(vcpkg_find_acquire_program VAR)
macro(do_find)
if(NOT DEFINED REQUIRED_INTERPRETER)
find_program(${VAR} ${PROGNAME} PATHS ${PATHS})
find_program(FOUND_PROG ${PROGNAME} PATHS ${PATHS})
set(${VAR} ${FOUND_PROG})
else()
vcpkg_find_acquire_program(${REQUIRED_INTERPRETER})
find_file(SCRIPT ${SCRIPTNAME} PATHS ${PATHS})
@ -162,7 +164,8 @@ function(vcpkg_find_acquire_program VAR)
endmacro()
do_find()
if(${VAR} MATCHES "-NOTFOUND")
set(FOUND_PROG ${${VAR}})
if(FOUND_PROG MATCHES "-NOTFOUND")
file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE}
EXPECTED_HASH SHA512=${HASH}
SHOW_PROGRESS
@ -173,7 +176,7 @@ function(vcpkg_find_acquire_program VAR)
else()
get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT)
string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION)
if(${ARCHIVE_EXTENSION} STREQUAL ".msi")
if(ARCHIVE_EXTENSION STREQUAL ".msi")
file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH)
file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH)
execute_process(