mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 00:07:24 +00:00
using md5 when downloading external libraries
This commit is contained in:
parent
468990d346
commit
d46e466c9d
@ -38,7 +38,7 @@ endfunction()
|
||||
function(download_and_unzip)
|
||||
set(download_and_unzip_SUCCESS FALSE PARENT_SCOPE)
|
||||
set(options)
|
||||
set(oneValueArgs SHA NAME DIR)
|
||||
set(oneValueArgs MD5 NAME DIR)
|
||||
set(multiValueArgs LINK)
|
||||
cmake_parse_arguments(DAU
|
||||
"${options}" "${oneValueArgs}"
|
||||
@ -55,14 +55,30 @@ function(download_and_unzip)
|
||||
message(STATUS "Downloading ${DAU_NAME} from ${LINK}")
|
||||
|
||||
file(DOWNLOAD ${LINK} ${ZIP})
|
||||
message(STATUS "${DAU_NAME} downloaded.")
|
||||
message(STATUS "Extracting ${DAU_NAME} archive...")
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${ZIP}
|
||||
DESTINATION ${DAU_DIR})
|
||||
message(STATUS "${DAU_NAME} archive extracted.")
|
||||
file(REMOVE ${ZIP})
|
||||
set(download_and_unzip_SUCCESS TRUE PARENT_SCOPE)
|
||||
|
||||
file(MD5 ${ZIP} MD5SUM)
|
||||
|
||||
# no md5 argument given, no checksum needed...
|
||||
if (NOT DEFINED DAU_MD5)
|
||||
set(DAU_MD5 ${MD5SUM})
|
||||
endif()
|
||||
|
||||
# manual md5 check, avoid to fail when a download fails
|
||||
if(MD5SUM STREQUAL ${DAU_MD5}) # download successful
|
||||
message(STATUS "${DAU_NAME} downloaded.")
|
||||
message(STATUS "Extracting ${DAU_NAME} archive...")
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${ZIP}
|
||||
DESTINATION ${DAU_DIR})
|
||||
message(STATUS "${DAU_NAME} archive extracted.")
|
||||
file(REMOVE ${ZIP})
|
||||
set(download_and_unzip_SUCCESS TRUE PARENT_SCOPE)
|
||||
break() # done
|
||||
else()
|
||||
file(REMOVE ${ZIP})
|
||||
message(STATUS "${DAU_NAME} download failed...")
|
||||
# next link in DAU_LINK list...
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
6
src/external/boost.cmake
vendored
6
src/external/boost.cmake
vendored
@ -20,10 +20,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_BOOST)
|
||||
|
||||
if (NOT EXISTS ${BOOST_CHECK})
|
||||
set(BOOST_LINK https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.zip)
|
||||
set(BOOST_MD5 d3b276f6d22246171f93282910a1d583)
|
||||
download_and_unzip(
|
||||
NAME "Boost"
|
||||
MD5 ${BOOST_MD5}
|
||||
LINK ${BOOST_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "Boost")
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- Boost - download failed.")
|
||||
endif()
|
||||
|
||||
12
src/external/cgal.cmake
vendored
12
src/external/cgal.cmake
vendored
@ -21,10 +21,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL)
|
||||
|
||||
if (NOT EXISTS ${CGAL_CHECK})
|
||||
set(CGAL_LINK https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip)
|
||||
set(CGAL_MD5 1a999ab90ea4cf28f6aa17ea2af24876)
|
||||
download_and_unzip(
|
||||
NAME "CGAL"
|
||||
LINK ${CGAL_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "CGAL")
|
||||
MD5 ${CGAL_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- CGAL - download failed.")
|
||||
set(CGAL_DOWNLOAD_SUCCESS FALSE)
|
||||
@ -33,10 +35,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL)
|
||||
|
||||
if (WIN32 AND NOT EXISTS ${CGAL_WIN_CHECK})
|
||||
set(CGAL_AUX_LINK https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip)
|
||||
set(CGAL_AUX_MD5 247f4dca741c6b9a9be76286414070fa)
|
||||
download_and_unzip(
|
||||
NAME "CGAL auxiliary libraries"
|
||||
LINK ${CGAL_AUX_LINK}
|
||||
DIR ${CGAL_DIR}
|
||||
NAME "CGAL auxiliary libraries")
|
||||
MD5 ${CGAL_AUX_MD5}
|
||||
DIR ${CGAL_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- CGAL auxiliary libraries - download failed.")
|
||||
set(CGAL_DOWNLOAD_SUCCESS FALSE)
|
||||
|
||||
6
src/external/e57.cmake
vendored
6
src/external/e57.cmake
vendored
@ -11,10 +11,12 @@ if (TARGET XercesC::XercesC)
|
||||
|
||||
if (NOT EXISTS ${LIBE57_CHECK})
|
||||
set(LIBE57_LINK https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.zip)
|
||||
set(LIBE57_MD5 958ada3883f9b60195f79bbab156f3e3)
|
||||
download_and_unzip(
|
||||
NAME "LibE57"
|
||||
MD5 ${LIBE57_MD5}
|
||||
LINK ${LIBE57_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "LibE57")
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- LibE57 - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/easyexif.cmake
vendored
6
src/external/easyexif.cmake
vendored
@ -10,10 +10,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_EASYEXIF)
|
||||
|
||||
if (NOT EXISTS ${EASYEXIF_CHECK})
|
||||
set(EASYEXIF_LINK https://github.com/mayanklahiri/easyexif/archive/refs/tags/v1.0.zip)
|
||||
set(EASYEXIF_MD5 d46ec21b5c8ce13cda0fe66a4477a8c3)
|
||||
download_and_unzip(
|
||||
NAME "EasyExif"
|
||||
LINK ${EASYEXIF_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "EasyExif")
|
||||
MD5 ${EASYEXIF_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(FATAL_ERROR "- EasyExif - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/glew.cmake
vendored
6
src/external/glew.cmake
vendored
@ -29,10 +29,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_GLEW)
|
||||
|
||||
if (NOT EXISTS ${GLEW_CHECK})
|
||||
set(GLEW_LINK https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.zip)
|
||||
set(GLEW_MD5 970535b75b1b69ebd018a0fa05af63d1)
|
||||
download_and_unzip(
|
||||
NAME "GLEW"
|
||||
LINK ${GLEW_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "GLEW")
|
||||
MD5 ${GLEW_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(FATAL_ERROR "- GLEW - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/levmar.cmake
vendored
6
src/external/levmar.cmake
vendored
@ -10,10 +10,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LEVMAR)
|
||||
|
||||
if (NOT EXISTS ${LEVMAR_CHECK})
|
||||
set(LEVMAR_LINK http://users.ics.forth.gr/~lourakis/levmar/levmar-2.6.tgz)
|
||||
set(LEVMAR_MD5 16bc34efa1617219f241eef06427f13f)
|
||||
download_and_unzip(
|
||||
NAME "Levmar"
|
||||
LINK ${LEVMAR_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "Levmar")
|
||||
MD5 ${LEVMAR_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- Levmar - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/lib3ds.cmake
vendored
6
src/external/lib3ds.cmake
vendored
@ -18,10 +18,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIB3DS)
|
||||
|
||||
if (NOT EXISTS ${LIB3DS_CHECK})
|
||||
set(LIB3DS_LINK http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/lib3ds/lib3ds-1.3.0.zip)
|
||||
set(LIB3DS_MD5 2572f7b0f29b591d494c1a0658b35c86)
|
||||
download_and_unzip(
|
||||
NAME "Lib3DS"
|
||||
LINK ${LIB3DS_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "Lib3DS")
|
||||
MD5 ${LIB3DS_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- Lib3DS - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/libigl.cmake
vendored
6
src/external/libigl.cmake
vendored
@ -10,10 +10,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL)
|
||||
|
||||
if (NOT EXISTS ${LIBIGL_CHECK})
|
||||
set(LIBIGL_LINK https://github.com/libigl/libigl/archive/refs/tags/v2.4.0.zip)
|
||||
set(LIBIGL_MD5 0b4fea5dba2117b8db85c99a39a71f83)
|
||||
download_and_unzip(
|
||||
NAME "LibIGL"
|
||||
LINK ${LIBIGL_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "LibIGL")
|
||||
MD5 ${LIBIGL_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- LibIGL - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/muparser.cmake
vendored
6
src/external/muparser.cmake
vendored
@ -17,10 +17,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_MUPARSER)
|
||||
|
||||
if (NOT EXISTS ${MUPARSER_CHECK})
|
||||
set(MUPARSER_LINK https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.3-1.zip)
|
||||
set(MUPARSER_MD5 8cf887ce460a405b8d8b966e0d5c94e3)
|
||||
download_and_unzip(
|
||||
NAME "muparser"
|
||||
LINK ${MUPARSER_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "muparser")
|
||||
MD5 ${MUPARSER_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- muparser - download failed.")
|
||||
endif()
|
||||
|
||||
12
src/external/nexus.cmake
vendored
12
src/external/nexus.cmake
vendored
@ -13,10 +13,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS)
|
||||
|
||||
if (NOT EXISTS ${NEXUS_CHECK})
|
||||
set(NEXUS_LINK https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip)
|
||||
#set(NEXUS_MD5 3e50878dbaedd140f3e8c34d5af9a9d9)
|
||||
download_and_unzip(
|
||||
NAME "nexus"
|
||||
LINK ${NEXUS_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "nexus")
|
||||
#MD5 ${NEXUS_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- nexus - download failed.")
|
||||
endif()
|
||||
@ -25,10 +27,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS)
|
||||
if (NOT EXISTS ${CORTO_CHECK})
|
||||
file(REMOVE_RECURSE ${NEXUS_DIR}/src/corto)
|
||||
set(CORTO_LINK https://github.com/cnr-isti-vclab/corto/archive/refs/heads/master.zip)
|
||||
#set(CORTO_MD5 ede1b41e369a8117d8f2f46fba89e11d)
|
||||
download_and_unzip(
|
||||
NAME "corto"
|
||||
LINK ${CORTO_LINK}
|
||||
DIR "${NEXUS_DIR}/src/"
|
||||
NAME "corto")
|
||||
#MD5 ${CORTO_MD5}
|
||||
DIR "${NEXUS_DIR}/src/")
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- corto - download failed.")
|
||||
else()
|
||||
|
||||
6
src/external/openctm.cmake
vendored
6
src/external/openctm.cmake
vendored
@ -17,10 +17,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_OPENCTM)
|
||||
|
||||
if (NOT EXISTS ${OPENCTM_CHECK})
|
||||
set(OPENCTM_LINK https://sourceforge.net/projects/openctm/files/OpenCTM-1.0.3/OpenCTM-1.0.3-src.zip/download)
|
||||
set(OPENCTM_MD5 a87b6a6509ae0712b4a55f8887dc6a54)
|
||||
download_and_unzip(
|
||||
NAME "OpenCTM"
|
||||
LINK ${OPENCTM_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "OpenCTM")
|
||||
MD5 ${OPENCTM_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- OpenCTM - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/qhull.cmake
vendored
6
src/external/qhull.cmake
vendored
@ -17,10 +17,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_QHULL)
|
||||
|
||||
if (NOT EXISTS ${QHULL_CHECK})
|
||||
set(QHULL_LINK https://github.com/qhull/qhull/archive/refs/tags/2020.2.zip)
|
||||
set(QHULL_MD5 a0a9b0e69bdbd9461319b8d2ac3d2f2e)
|
||||
download_and_unzip(
|
||||
NAME "Qhull"
|
||||
LINK ${QHULL_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "Qhull")
|
||||
MD5 ${QHULL_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- Qhull - download failed.")
|
||||
endif()
|
||||
|
||||
8
src/external/ssynth.cmake
vendored
8
src/external/ssynth.cmake
vendored
@ -9,11 +9,13 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_STRUCTURE_SYNTH)
|
||||
set(SSYNTH_CHECK "${SSYNTH_DIR}/StructureSynth/Model/Action.h")
|
||||
|
||||
if (NOT EXISTS ${SSYNTH_CHECK})
|
||||
set(SSYNTH_LINK "https://github.com/alemuntoni/StructureSynth/archive/refs/tags/1.5.1.zip")
|
||||
set(SSYNTH_LINK https://github.com/alemuntoni/StructureSynth/archive/refs/tags/1.5.1.zip)
|
||||
set(SSYNTH_MD5 e2122c5e6e370fb36c885bccf59562b7)
|
||||
download_and_unzip(
|
||||
NAME "Structure Synth"
|
||||
LINK ${SSYNTH_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "Structure Synth")
|
||||
MD5 ${SSYNTH_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- Structure Synth - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/tinygltf.cmake
vendored
6
src/external/tinygltf.cmake
vendored
@ -10,10 +10,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_TINYGLTF)
|
||||
|
||||
if (NOT EXISTS ${TINYGLTF_CHECK})
|
||||
set(TINYGLTF_LINK https://github.com/syoyo/tinygltf/archive/refs/tags/v2.6.3.zip)
|
||||
set(TINYGLTF_MD5 f63ab0fb59e5de059d9719cc14057dc8)
|
||||
download_and_unzip(
|
||||
NAME "tinygltf"
|
||||
LINK ${TINYGLTF_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "tinygltf")
|
||||
MD5 ${TINYGLTF_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- tinygltf - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/u3d.cmake
vendored
6
src/external/u3d.cmake
vendored
@ -11,10 +11,12 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_U3D)
|
||||
|
||||
if (NOT EXISTS ${U3D_CHECK})
|
||||
set(U3D_LINK https://github.com/alemuntoni/u3d/archive/refs/heads/master.zip)
|
||||
#set(U3D_MD5 3b15b2f75206ea24b8991333562aa9ca)
|
||||
download_and_unzip(
|
||||
NAME "u3d"
|
||||
LINK ${U3D_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "u3d")
|
||||
#MD5 ${U3D_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- u3d - download failed.")
|
||||
endif()
|
||||
|
||||
6
src/external/xerces.cmake
vendored
6
src/external/xerces.cmake
vendored
@ -18,10 +18,12 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_XERCES)
|
||||
|
||||
if(NOT EXISTS ${XERCES_C_CHECK})
|
||||
set(XERCES_C_LINK https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-${XERCES_C_VER}.zip)
|
||||
set(XERCES_C_MD5 f84488fc2b8f62c4afca2f9943a42c00)
|
||||
download_and_unzip(
|
||||
NAME "Xerces-C"
|
||||
LINK ${XERCES_C_LINK}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}
|
||||
NAME "Xerces-C")
|
||||
MD5 ${XERCES_C_MD5}
|
||||
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
|
||||
if (NOT download_and_unzip_SUCCESS)
|
||||
message(STATUS "- Xerces-C - download failed.")
|
||||
endif()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user