- added workaround for failing HTTPS protocol with older CMake versions

This commit is contained in:
Paolo Tosco
2016-02-23 08:47:52 +00:00
parent f8e6d697ba
commit 39a4eabea1

View File

@@ -20,6 +20,15 @@ if(needDownload)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf
${CMAKE_CURRENT_SOURCE_DIR}/AvalonToolkit_1.2.0.source.tar
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# CMake < 2.8.10 does not seem to support HTTPS out of the box
# and since SourceForge redirects to HTTPS, the CMake download fails
# so we try to use system curl if available, using -L to follow redirects
if (NOT EXISTS "${fileToPatch}")
execute_process(COMMAND curl -L -O "${AVALONTOOLS_URL}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf
${CMAKE_CURRENT_SOURCE_DIR}/AvalonToolkit_1.2.0.source.tar
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
# apply patch to AvalonTools
configure_file("${fileToPatch}" "${fileToPatch}.orig" COPYONLY)
file(READ "${fileToPatch}" buffer)