From 854f8ec918ae0fa14270c8dfb712160ce5c3b9eb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 18 Aug 2015 20:16:22 +0200 Subject: [PATCH] Don't re-download NSCP for every build fixes #9961 --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb9e35f37..ca7c2719f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,7 +281,15 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) include(InstallRequiredSystemLibraries) if(WIN32) - file(DOWNLOAD http://files.nsclient.org/released/NSCP-0.4.3.143-Win32.msi ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi) + set(NSCP_SHA256SUM "") + if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi) + file(SHA256 ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi NSCP_SHA256SUM) + endif() + + if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi OR NOT ${NSCP_SHA256SUM} STREQUAL "226cef0154daf1f9b93d0e168068e723e2be407548e5c4772557401d87535b48") + file(DOWNLOAD http://files.nsclient.org/released/NSCP-0.4.3.143-Win32.msi ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi SHOW_PROGRESS) + endif() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi DESTINATION ${CMAKE_INSTALL_SBINDIR}) install( -- 2.40.0