From 00d801fbfe9c5170e3a83019cc2e3f6b1ce64200 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Jan 2013 13:34:12 -0500 Subject: [PATCH] ExternalData: Remove compatibility with CMake < 2.8.5 Now that the module comes in a sufficiently new CMake it does not need to support older versions. --- Modules/ExternalData.cmake | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 84020f94d..4ab21867a 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -119,8 +119,7 @@ # Variables ExternalData_TIMEOUT_INACTIVITY and ExternalData_TIMEOUT_ABSOLUTE # set the download inactivity and absolute timeouts, in seconds. The defaults # are 60 seconds and 300 seconds, respectively. Set either timeout to 0 -# seconds to disable enforcement. The inactivity timeout is enforced only -# with CMake >= 2.8.5. +# seconds to disable enforcement. #============================================================================= # Copyright 2010-2013 Kitware, Inc. @@ -263,13 +262,7 @@ function(_ExternalData_compute_hash var_hash algo file) endfunction() function(_ExternalData_random var) - if(NOT ${CMAKE_VERSION} VERSION_LESS 2.8.5) - string(RANDOM LENGTH 6 random) - elseif(EXISTS /dev/urandom) - file(READ /dev/urandom random LIMIT 4 HEX) - else() - message(FATAL_ERROR "CMake >= 2.8.5 required in this environment") - endif() + string(RANDOM LENGTH 6 random) set("${var}" "${random}" PARENT_SCOPE) endfunction() @@ -550,14 +543,10 @@ function(_ExternalData_download_file url file err_var msg_var) set(retry 3) while(retry) math(EXPR retry "${retry} - 1") - if("${CMAKE_VERSION}" VERSION_GREATER 2.8.4.20110602) - if(ExternalData_TIMEOUT_INACTIVITY) - set(inactivity_timeout INACTIVITY_TIMEOUT ${ExternalData_TIMEOUT_INACTIVITY}) - elseif(NOT "${ExternalData_TIMEOUT_INACTIVITY}" EQUAL 0) - set(inactivity_timeout INACTIVITY_TIMEOUT 60) - else() - set(inactivity_timeout "") - endif() + if(ExternalData_TIMEOUT_INACTIVITY) + set(inactivity_timeout INACTIVITY_TIMEOUT ${ExternalData_TIMEOUT_INACTIVITY}) + elseif(NOT "${ExternalData_TIMEOUT_INACTIVITY}" EQUAL 0) + set(inactivity_timeout INACTIVITY_TIMEOUT 60) else() set(inactivity_timeout "") endif()