From b9c9bb264b0c9853a89493d0975ad40c47002b01 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 4 Nov 2022 10:41:49 +0100 Subject: [PATCH 1/4] remove nexus submodule and download it using cmake --- .gitmodules | 3 --- src/external/newuoa.cmake | 4 +-- src/external/nexus | 1 - src/external/nexus.cmake | 27 ++++++++++++++++--- .../filter_io_nxs/CMakeLists.txt | 4 +-- 5 files changed, 27 insertions(+), 12 deletions(-) delete mode 160000 src/external/nexus diff --git a/.gitmodules b/.gitmodules index a892ada73..90e29d2f6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,3 @@ path = src/vcglib url = https://github.com/cnr-isti-vclab/vcglib branch = devel -[submodule "src/external/nexus"] - path = src/external/nexus - url = https://github.com/cnr-isti-vclab/nexus diff --git a/src/external/newuoa.cmake b/src/external/newuoa.cmake index 73821e8fe..3f065ae7d 100644 --- a/src/external/newuoa.cmake +++ b/src/external/newuoa.cmake @@ -2,11 +2,11 @@ # Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council # SPDX-License-Identifier: BSL-1.0 -option(ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON) +option(MESHLAB_ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON) set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa) -if(ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h") +if(MESHLAB_ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h") message(STATUS "- newuoa - using bundled source") add_library(external-newuoa INTERFACE) target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include) diff --git a/src/external/nexus b/src/external/nexus deleted file mode 160000 index 9f56edab7..000000000 --- a/src/external/nexus +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f56edab7cf80d2d4a654e65be087ebd973f66bd diff --git a/src/external/nexus.cmake b/src/external/nexus.cmake index 1e1d1e69a..d8bccf0aa 100644 --- a/src/external/nexus.cmake +++ b/src/external/nexus.cmake @@ -2,12 +2,31 @@ # Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council # SPDX-License-Identifier: BSL-1.0 -option(ALLOW_BUNDLED_NEXUS "Allow use of bundled nexus source" ON) +option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS "Allow download and use of nexus source" ON) + +if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS) + # todo - make release of nexus and corto + set(NEXUS_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/nexus-master) + set(CORTO_DIR ${NEXUS_DIR}/src/corto) + + if (NOT EXISTS "${NEXUS_DIR}/CMakeLists.txt") + set(NEXUS_LINK https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip) + download_and_unzip(${NEXUS_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "nexus") + endif() + + if (NOT EXISTS "${CORTO_DIR}/CMakeLists.txt") + file(REMOVE_RECURSE ${NEXUS_DIR}/src/corto) + set(CORTO_LINK https://github.com/cnr-isti-vclab/corto/archive/refs/heads/master.zip) + download_and_unzip(${CORTO_LINK} "${NEXUS_DIR}/src/" "corto") + file(RENAME ${NEXUS_DIR}/src/corto-master ${NEXUS_DIR}/src/corto) + endif() + + message(STATUS "- nexus - using downloaded source") -if(ALLOW_BUNDLED_NEXUS AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/nexus/CMakeLists.txt") - message(STATUS "- nexus - using bundled source") set (BUILD_NXS_BUILD OFF) set (BUILD_NXS_EDIT OFF) set (BUILD_NXS_VIEW OFF) - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/nexus EXCLUDE_FROM_ALL) + add_subdirectory(${NEXUS_DIR} EXCLUDE_FROM_ALL) + add_library(external-nexus INTERFACE) + target_link_libraries(external-nexus INTERFACE nexus) endif() diff --git a/src/meshlabplugins/filter_io_nxs/CMakeLists.txt b/src/meshlabplugins/filter_io_nxs/CMakeLists.txt index bfe48051c..c6b734348 100644 --- a/src/meshlabplugins/filter_io_nxs/CMakeLists.txt +++ b/src/meshlabplugins/filter_io_nxs/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSL-1.0 # Only build if we have nexus -if (TARGET nexus) +if (TARGET external-nexus) set(SOURCES filter_io_nxs.cpp) @@ -10,7 +10,7 @@ if (TARGET nexus) add_meshlab_plugin(filter_io_nxs MODULE ${SOURCES} ${HEADERS}) - target_link_libraries(filter_io_nxs PRIVATE nexus) + target_link_libraries(filter_io_nxs PRIVATE external-nexus) else() message(STATUS "Skipping filter_io_nxs - missing nexus") From 468990d34645fa34fd79cd1b5ba46b7990549edb Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 4 Nov 2022 12:20:48 +0100 Subject: [PATCH 2/4] better management of download archives --- src/cmake/meshlab_tools.cmake | 36 +++++++---- src/external/boost.cmake | 21 +++++-- src/external/cgal.cmake | 110 ++++++++++++++++++++-------------- src/external/e57.cmake | 29 +++++---- src/external/easyexif.cmake | 21 +++++-- src/external/glew.cmake | 39 +++++++----- src/external/levmar.cmake | 40 ++++++++----- src/external/lib3ds.cmake | 106 +++++++++++++++++--------------- src/external/libigl.cmake | 21 +++++-- src/external/muparser.cmake | 36 ++++++----- src/external/nexus.cmake | 45 +++++++++----- src/external/openctm.cmake | 57 ++++++++++-------- src/external/qhull.cmake | 32 ++++++---- src/external/ssynth.cmake | 28 +++++---- src/external/tinygltf.cmake | 21 +++++-- src/external/u3d.cmake | 39 +++++++----- src/external/xerces.cmake | 43 +++++++------ 17 files changed, 448 insertions(+), 276 deletions(-) diff --git a/src/cmake/meshlab_tools.cmake b/src/cmake/meshlab_tools.cmake index a0a6972ee..9e2c0f77b 100644 --- a/src/cmake/meshlab_tools.cmake +++ b/src/cmake/meshlab_tools.cmake @@ -35,19 +35,35 @@ endfunction() # - link: download link # - dir: directory where the archive will be extracted # - name: a name used only for log -function(download_and_unzip link dir name) +function(download_and_unzip) + set(download_and_unzip_SUCCESS FALSE PARENT_SCOPE) + set(options) + set(oneValueArgs SHA NAME DIR) + set(multiValueArgs LINK) + cmake_parse_arguments(DAU + "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) + + list(LENGTH DAU_LINK NUMBER_OF_LINKS) + if(NUMBER_OF_LINKS LESS 1) + message(FATAL_ERROR "Need to specify at least a download link.") + endif() + set(ZIP ${CMAKE_CURRENT_LIST_DIR}/tmp.zip) - message(STATUS "Downloading ${name}...") + foreach(LINK ${DAU_LINK}) + message(STATUS "Downloading ${DAU_NAME} from ${LINK}") - file(DOWNLOAD ${link} ${ZIP}) - message(STATUS "${name} downloaded.") - message(STATUS "Extracting ${name} archive...") - file(ARCHIVE_EXTRACT - INPUT ${ZIP} - DESTINATION ${dir}) - message(STATUS "${name} archive extracted.") - file(REMOVE ${ZIP}) + 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) + endforeach() endfunction() # make quiet some portions of cmake diff --git a/src/external/boost.cmake b/src/external/boost.cmake index ae696746f..46ea6fa20 100644 --- a/src/external/boost.cmake +++ b/src/external/boost.cmake @@ -15,14 +15,23 @@ if(MESHLAB_ALLOW_SYSTEM_BOOST AND TARGET Boost::boost) target_link_libraries(external-boost INTERFACE Boost::thread) endif() elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_BOOST) - set(BOOST_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/boost_1_75_0) + set(BOOST_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/boost_1_75_0") + set(BOOST_CHECK "${BOOST_DIR}/boost/version.hpp") - if (NOT EXISTS "${BOOST_DIR}/boost/version.hpp") + if (NOT EXISTS ${BOOST_CHECK}) set(BOOST_LINK https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.zip) - download_and_unzip(${BOOST_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "Boost") + download_and_unzip( + LINK ${BOOST_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "Boost") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- Boost - download failed.") + endif() endif() - message(STATUS "- Boost - using downloaded source") - add_library(external-boost INTERFACE) - target_include_directories(external-boost INTERFACE "${BOOST_DIR}") + if (EXISTS ${BOOST_CHECK}) + message(STATUS "- Boost - using downloaded source") + add_library(external-boost INTERFACE) + target_include_directories(external-boost INTERFACE "${BOOST_DIR}") + endif() endif() diff --git a/src/external/cgal.cmake b/src/external/cgal.cmake index 9240796bb..ddeb7a2c0 100644 --- a/src/external/cgal.cmake +++ b/src/external/cgal.cmake @@ -14,57 +14,77 @@ if(MESHLAB_ALLOW_SYSTEM_CGAL AND TARGET CGAL::CGAL) target_link_libraries(external-cgal INTERFACE CGAL::CGAL Threads::Threads) elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL) set(CGAL_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/CGAL-5.2.1") + set(CGAL_CHECK "${CGAL_DIR}/include/CGAL/version.h") + set(CGAL_WIN_CHECK "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib") - if (NOT EXISTS "${CGAL_DIR}/include/CGAL/version.h") + set(CGAL_DOWNLOAD_SUCCESS TRUE) + + if (NOT EXISTS ${CGAL_CHECK}) set(CGAL_LINK https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip) - download_and_unzip(${CGAL_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "CGAL") + download_and_unzip( + LINK ${CGAL_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "CGAL") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- CGAL - download failed.") + set(CGAL_DOWNLOAD_SUCCESS FALSE) + endif() + endif() + + 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) + download_and_unzip( + LINK ${CGAL_AUX_LINK} + DIR ${CGAL_DIR} + NAME "CGAL auxiliary libraries") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- CGAL auxiliary libraries - download failed.") + set(CGAL_DOWNLOAD_SUCCESS FALSE) + endif() + endif() + + if (CGAL_DOWNLOAD_SUCCESS) + message(STATUS "- CGAL - using downloaded source") + add_library(external-cgal INTERFACE) + target_include_directories(external-cgal INTERFACE "${CGAL_DIR}/include/") if (WIN32) - set(CGAL_AUX_LINK https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip) - download_and_unzip(${CGAL_AUX_LINK} ${CGAL_DIR} "CGAL auxiliary libraries") + add_library(mpfr SHARED IMPORTED GLOBAL) + set_property(TARGET mpfr PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib") + set_property(TARGET mpfr PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll") + target_include_directories(mpfr INTERFACE "${CGAL_DIR}/auxiliary/gmp/include") + + add_library(gmp SHARED IMPORTED GLOBAL) + set_property(TARGET gmp PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib") + set_property(TARGET gmp PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll") + target_link_libraries(external-cgal INTERFACE gmp mpfr Threads::Threads) + else() + find_package(GMP) + target_include_directories(external-cgal SYSTEM INTERFACE ${GMP_INCLUDE_DIRS}) + target_link_libraries(external-cgal INTERFACE ${GMP_LIBRARIES} mpfr Threads::Threads) endif() - endif() - message(STATUS "- CGAL - using downloaded source") - add_library(external-cgal INTERFACE) - target_include_directories(external-cgal INTERFACE "${CGAL_DIR}/include/") - - if (WIN32) - add_library(mpfr SHARED IMPORTED GLOBAL) - set_property(TARGET mpfr PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib") - set_property(TARGET mpfr PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll") - target_include_directories(mpfr INTERFACE "${CGAL_DIR}/auxiliary/gmp/include") - - add_library(gmp SHARED IMPORTED GLOBAL) - set_property(TARGET gmp PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib") - set_property(TARGET gmp PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll") - target_link_libraries(external-cgal INTERFACE gmp mpfr Threads::Threads) - else() - find_package(GMP) - target_include_directories(external-cgal SYSTEM INTERFACE ${GMP_INCLUDE_DIRS}) - target_link_libraries(external-cgal INTERFACE ${GMP_LIBRARIES} mpfr Threads::Threads) - endif() - - if (WIN32) - if (DEFINED MESHLAB_LIB_OUTPUT_DIR) - file( - COPY - ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib - ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll - ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib - ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll - DESTINATION - ${MESHLAB_LIB_OUTPUT_DIR}) - endif() - if (DEFINED MESHLAB_LIB_INSTALL_DIR) - install( - FILES - ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib - ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll - ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib - ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll - DESTINATION - ${MESHLAB_LIB_INSTALL_DIR}) + if (WIN32) + if (DEFINED MESHLAB_LIB_OUTPUT_DIR) + file( + COPY + ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib + ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll + ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib + ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll + DESTINATION + ${MESHLAB_LIB_OUTPUT_DIR}) + endif() + if (DEFINED MESHLAB_LIB_INSTALL_DIR) + install( + FILES + ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib + ${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll + ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib + ${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll + DESTINATION + ${MESHLAB_LIB_INSTALL_DIR}) + endif() endif() endif() else() diff --git a/src/external/e57.cmake b/src/external/e57.cmake index 61968cf4b..af27fae05 100644 --- a/src/external/e57.cmake +++ b/src/external/e57.cmake @@ -6,22 +6,31 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57 "Allow download and use of libE57For if (TARGET XercesC::XercesC) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57) - set(LIBE57_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libE57Format-2.3.0) + set(LIBE57_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libE57Format-2.3.0") + set(LIBE57_CHECK "${LIBE57_DIR}/CMakeLists.txt") - if (NOT EXISTS ${LIBE57_DIR}/CMakeLists.txt) + if (NOT EXISTS ${LIBE57_CHECK}) set(LIBE57_LINK https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.zip) - download_and_unzip(${LIBE57_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "LibE57") + download_and_unzip( + LINK ${LIBE57_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "LibE57") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- LibE57 - download failed.") + endif() endif() - message(STATUS "- libE57 - using downloaded source") + if (EXISTS ${LIBE57_CHECK}) + message(STATUS "- libE57 - using downloaded source") - set(MESSAGE_QUIET ON) - add_subdirectory(${LIBE57_DIR} EXCLUDE_FROM_ALL) - unset(MESSAGE_QUIET) + set(MESSAGE_QUIET ON) + add_subdirectory(${LIBE57_DIR} EXCLUDE_FROM_ALL) + unset(MESSAGE_QUIET) - add_library(external-libE57 INTERFACE) - target_link_libraries(external-libE57 INTERFACE E57Format) - install(TARGETS E57Format DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + add_library(external-libE57 INTERFACE) + target_link_libraries(external-libE57 INTERFACE E57Format) + install(TARGETS E57Format DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + endif() endif() else() message(STATUS - "Cannot build e57 because Xerces dependence not satisfied.") diff --git a/src/external/easyexif.cmake b/src/external/easyexif.cmake index cddf15b67..ce18b8053 100644 --- a/src/external/easyexif.cmake +++ b/src/external/easyexif.cmake @@ -5,16 +5,25 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_EASYEXIF "Allow download and use of EasyExif source" ON) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_EASYEXIF) - set(EASYEXIF_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/easyexif-1.0) + set(EASYEXIF_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/easyexif-1.0") + set(EASYEXIF_CHECK "${EASYEXIF_DIR}/exif.h") - if (NOT EXISTS "${EASYEXIF_DIR}/exif.h") + if (NOT EXISTS ${EASYEXIF_CHECK}) set(EASYEXIF_LINK https://github.com/mayanklahiri/easyexif/archive/refs/tags/v1.0.zip) - download_and_unzip(${EASYEXIF_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "EasyExif") + download_and_unzip( + LINK ${EASYEXIF_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "EasyExif") + if (NOT download_and_unzip_SUCCESS) + message(FATAL_ERROR "- EasyExif - download failed.") + endif() endif() - message(STATUS "- EasyExif - using downloaded source") - add_library(external-easyexif STATIC ${EASYEXIF_DIR}/exif.h ${EASYEXIF_DIR}/exif.cpp) - target_include_directories(external-easyexif PUBLIC ${EASYEXIF_DIR}) + if (EXISTS ${EASYEXIF_CHECK}) + message(STATUS "- EasyExif - using downloaded source") + add_library(external-easyexif STATIC ${EASYEXIF_DIR}/exif.h ${EASYEXIF_DIR}/exif.cpp) + target_include_directories(external-easyexif PUBLIC ${EASYEXIF_DIR}) + endif() else() message( FATAL_ERROR diff --git a/src/external/glew.cmake b/src/external/glew.cmake index b1174370c..a304e0632 100644 --- a/src/external/glew.cmake +++ b/src/external/glew.cmake @@ -24,26 +24,35 @@ if(MESHLAB_ALLOW_SYSTEM_GLEW AND HAVE_SYSTEM_GLEW) message(FATAL_ERROR "OpenGL not found or your CMake version is too old!") endif() elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_GLEW) - set(GLEW_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/glew-2.2.0) + set(GLEW_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/glew-2.2.0") + set(GLEW_CHECK "${GLEW_DIR}/src/glew.c") - if (NOT EXISTS "${GLEW_DIR}/src/glew.c") + 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) - download_and_unzip(${GLEW_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "GLEW") + download_and_unzip( + LINK ${GLEW_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "GLEW") + if (NOT download_and_unzip_SUCCESS) + message(FATAL_ERROR "- GLEW - download failed.") + endif() endif() - message(STATUS "- GLEW - using downloaded source") - add_library(external-glew SHARED "${GLEW_DIR}/src/glew.c") - target_include_directories(external-glew SYSTEM PUBLIC ${GLEW_DIR}/include) - if(TARGET OpenGL::GL) - target_link_libraries(external-glew PUBLIC OpenGL::GL) - elseif(TARGET OpenGL::OpenGL) - target_link_libraries(external-glew PUBLIC OpenGL::OpenGL) - else() - message(FATAL_ERROR "OpenGL not found or your CMake version is too old!") - endif() + if (EXISTS ${GLEW_CHECK}) + message(STATUS "- GLEW - using downloaded source") + add_library(external-glew SHARED "${GLEW_DIR}/src/glew.c") + target_include_directories(external-glew SYSTEM PUBLIC ${GLEW_DIR}/include) + if(TARGET OpenGL::GL) + target_link_libraries(external-glew PUBLIC OpenGL::GL) + elseif(TARGET OpenGL::OpenGL) + target_link_libraries(external-glew PUBLIC OpenGL::OpenGL) + else() + message(FATAL_ERROR "OpenGL not found or your CMake version is too old!") + endif() - target_link_libraries(external-glew PRIVATE external-disable-warnings) - install(TARGETS external-glew DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + target_link_libraries(external-glew PRIVATE external-disable-warnings) + install(TARGETS external-glew DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + endif() else() message( FATAL_ERROR diff --git a/src/external/levmar.cmake b/src/external/levmar.cmake index 7b71bd2a2..57ebb8648 100644 --- a/src/external/levmar.cmake +++ b/src/external/levmar.cmake @@ -5,25 +5,33 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LEVMAR "Allow download and use of levmar source" ON) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LEVMAR) - set(LEVMAR_VER 2.6) - set(LEVMAR_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/levmar-${LEVMAR_VER}) + set(LEVMAR_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/levmar-2.6") + set(LEVMAR_CHECK "${LEVMAR_DIR}/lm.h") - if (NOT EXISTS "${LEVMAR_DIR}/lm.h") - set(LEVMAR_LINK http://users.ics.forth.gr/~lourakis/levmar/levmar-${LEVMAR_VER}.tgz) - download_and_unzip(${LEVMAR_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "Levmar") + if (NOT EXISTS ${LEVMAR_CHECK}) + set(LEVMAR_LINK http://users.ics.forth.gr/~lourakis/levmar/levmar-2.6.tgz) + download_and_unzip( + LINK ${LEVMAR_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "Levmar") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- Levmar - download failed.") + endif() endif() - message(STATUS "- levmar - using downloaded source") + if (EXISTS ${LEVMAR_CHECK}) + message(STATUS "- levmar - using downloaded source") - set(HAVE_LAPACK 0 CACHE BOOL "Do we have LAPACK/BLAS?") - set(BUILD_DEMO OFF) - set(MESSAGE_QUIET ON) - add_subdirectory(${LEVMAR_DIR}) - unset(MESSAGE_QUIET) - unset(HAVE_LAPACK) - unset(BUILD_DEMO) + set(HAVE_LAPACK 0 CACHE BOOL "Do we have LAPACK/BLAS?") + set(BUILD_DEMO OFF) + set(MESSAGE_QUIET ON) + add_subdirectory(${LEVMAR_DIR}) + unset(MESSAGE_QUIET) + unset(HAVE_LAPACK) + unset(BUILD_DEMO) - add_library(external-levmar INTERFACE) - target_link_libraries(external-levmar INTERFACE levmar) - target_include_directories(external-levmar INTERFACE ${LEVMAR_DIR}) + add_library(external-levmar INTERFACE) + target_link_libraries(external-levmar INTERFACE levmar) + target_include_directories(external-levmar INTERFACE ${LEVMAR_DIR}) + endif() endif() diff --git a/src/external/lib3ds.cmake b/src/external/lib3ds.cmake index e06ac9bb7..5c03328e5 100644 --- a/src/external/lib3ds.cmake +++ b/src/external/lib3ds.cmake @@ -13,57 +13,65 @@ if(MESHLAB_ALLOW_SYSTEM_LIB3DS AND TARGET Lib3ds::Lib3ds) add_library(external-lib3ds INTERFACE) target_link_libraries(external-lib3ds INTERFACE Lib3ds::Lib3ds) elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIB3DS) - set(LIB3DS_VER 1.3.0) - set(LIB3DS_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/lib3ds-${LIB3DS_VER}) + set(LIB3DS_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/lib3ds-1.3.0") + set(LIB3DS_CHECK "${LIB3DS_DIR}/lib3ds/types.h") - if (NOT EXISTS "${LIB3DS_DIR}/lib3ds/types.h") - set(LIB3DS_LINK http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/lib3ds/lib3ds-${LIB3DS_VER}.zip) - download_and_unzip(${LIB3DS_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "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) + download_and_unzip( + LINK ${LIB3DS_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "Lib3DS") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- Lib3DS - download failed.") + endif() endif() - message(STATUS "- lib3ds - using downloaded source") - add_library( - external-lib3ds SHARED - "${LIB3DS_DIR}/lib3ds/atmosphere.c" - "${LIB3DS_DIR}/lib3ds/atmosphere.h" - "${LIB3DS_DIR}/lib3ds/background.c" - "${LIB3DS_DIR}/lib3ds/background.h" - "${LIB3DS_DIR}/lib3ds/camera.c" - "${LIB3DS_DIR}/lib3ds/camera.h" - "${LIB3DS_DIR}/lib3ds/chunk.c" - "${LIB3DS_DIR}/lib3ds/chunk.h" - "${LIB3DS_DIR}/lib3ds/chunktable.h" - "${LIB3DS_DIR}/lib3ds/ease.c" - "${LIB3DS_DIR}/lib3ds/ease.h" - "${LIB3DS_DIR}/lib3ds/file.c" - "${LIB3DS_DIR}/lib3ds/file.h" - "${LIB3DS_DIR}/lib3ds/io.c" - "${LIB3DS_DIR}/lib3ds/io.h" - "${LIB3DS_DIR}/lib3ds/light.c" - "${LIB3DS_DIR}/lib3ds/light.h" - "${LIB3DS_DIR}/lib3ds/material.c" - "${LIB3DS_DIR}/lib3ds/material.h" - "${LIB3DS_DIR}/lib3ds/matrix.c" - "${LIB3DS_DIR}/lib3ds/matrix.h" - "${LIB3DS_DIR}/lib3ds/mesh.c" - "${LIB3DS_DIR}/lib3ds/mesh.h" - "${LIB3DS_DIR}/lib3ds/node.c" - "${LIB3DS_DIR}/lib3ds/node.h" - "${LIB3DS_DIR}/lib3ds/quat.c" - "${LIB3DS_DIR}/lib3ds/quat.h" - "${LIB3DS_DIR}/lib3ds/shadow.c" - "${LIB3DS_DIR}/lib3ds/shadow.h" - "${LIB3DS_DIR}/lib3ds/tcb.c" - "${LIB3DS_DIR}/lib3ds/tcb.h" - "${LIB3DS_DIR}/lib3ds/tracks.c" - "${LIB3DS_DIR}/lib3ds/tracks.h" - "${LIB3DS_DIR}/lib3ds/types.h" - "${LIB3DS_DIR}/lib3ds/vector.c" - "${LIB3DS_DIR}/lib3ds/vector.h" - "${LIB3DS_DIR}/lib3ds/viewport.c" - "${LIB3DS_DIR}/lib3ds/viewport.h") + if (EXISTS ${LIB3DS_CHECK}) + message(STATUS "- lib3ds - using downloaded source") + add_library( + external-lib3ds SHARED + "${LIB3DS_DIR}/lib3ds/atmosphere.c" + "${LIB3DS_DIR}/lib3ds/atmosphere.h" + "${LIB3DS_DIR}/lib3ds/background.c" + "${LIB3DS_DIR}/lib3ds/background.h" + "${LIB3DS_DIR}/lib3ds/camera.c" + "${LIB3DS_DIR}/lib3ds/camera.h" + "${LIB3DS_DIR}/lib3ds/chunk.c" + "${LIB3DS_DIR}/lib3ds/chunk.h" + "${LIB3DS_DIR}/lib3ds/chunktable.h" + "${LIB3DS_DIR}/lib3ds/ease.c" + "${LIB3DS_DIR}/lib3ds/ease.h" + "${LIB3DS_DIR}/lib3ds/file.c" + "${LIB3DS_DIR}/lib3ds/file.h" + "${LIB3DS_DIR}/lib3ds/io.c" + "${LIB3DS_DIR}/lib3ds/io.h" + "${LIB3DS_DIR}/lib3ds/light.c" + "${LIB3DS_DIR}/lib3ds/light.h" + "${LIB3DS_DIR}/lib3ds/material.c" + "${LIB3DS_DIR}/lib3ds/material.h" + "${LIB3DS_DIR}/lib3ds/matrix.c" + "${LIB3DS_DIR}/lib3ds/matrix.h" + "${LIB3DS_DIR}/lib3ds/mesh.c" + "${LIB3DS_DIR}/lib3ds/mesh.h" + "${LIB3DS_DIR}/lib3ds/node.c" + "${LIB3DS_DIR}/lib3ds/node.h" + "${LIB3DS_DIR}/lib3ds/quat.c" + "${LIB3DS_DIR}/lib3ds/quat.h" + "${LIB3DS_DIR}/lib3ds/shadow.c" + "${LIB3DS_DIR}/lib3ds/shadow.h" + "${LIB3DS_DIR}/lib3ds/tcb.c" + "${LIB3DS_DIR}/lib3ds/tcb.h" + "${LIB3DS_DIR}/lib3ds/tracks.c" + "${LIB3DS_DIR}/lib3ds/tracks.h" + "${LIB3DS_DIR}/lib3ds/types.h" + "${LIB3DS_DIR}/lib3ds/vector.c" + "${LIB3DS_DIR}/lib3ds/vector.h" + "${LIB3DS_DIR}/lib3ds/viewport.c" + "${LIB3DS_DIR}/lib3ds/viewport.h") - target_include_directories(external-lib3ds SYSTEM PUBLIC "${LIB3DS_DIR}") - target_link_libraries(external-lib3ds PRIVATE external-disable-warnings) - install(TARGETS external-lib3ds DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + target_include_directories(external-lib3ds SYSTEM PUBLIC "${LIB3DS_DIR}") + target_link_libraries(external-lib3ds PRIVATE external-disable-warnings) + install(TARGETS external-lib3ds DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + endif() endif() diff --git a/src/external/libigl.cmake b/src/external/libigl.cmake index 6c50b274e..0d9bc58ed 100644 --- a/src/external/libigl.cmake +++ b/src/external/libigl.cmake @@ -5,14 +5,23 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL "Allow download and use of LibIGL source" ON) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL) - set(LIBIGL_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-2.4.0) + set(LIBIGL_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-2.4.0") + set(LIBIGL_CHECK "${LIBIGL_DIR}/include/igl/igl_inline.h") - if (NOT EXISTS "${LIBIGL_DIR}/include/igl/igl_inline.h") + if (NOT EXISTS ${LIBIGL_CHECK}) set(LIBIGL_LINK https://github.com/libigl/libigl/archive/refs/tags/v2.4.0.zip) - download_and_unzip(${LIBIGL_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "LibIGL") + download_and_unzip( + LINK ${LIBIGL_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "LibIGL") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- LibIGL - download failed.") + endif() endif() - message(STATUS "- libigl - using downloaded source") - add_library(external-libigl INTERFACE) - target_include_directories(external-libigl INTERFACE "${LIBIGL_DIR}/include/") + if (EXISTS ${LIBIGL_CHECK}) + message(STATUS "- libigl - using downloaded source") + add_library(external-libigl INTERFACE) + target_include_directories(external-libigl INTERFACE "${LIBIGL_DIR}/include/") + endif() endif() diff --git a/src/external/muparser.cmake b/src/external/muparser.cmake index d4f945c8e..d5672b0c9 100644 --- a/src/external/muparser.cmake +++ b/src/external/muparser.cmake @@ -12,23 +12,31 @@ if(MESHLAB_ALLOW_SYSTEM_MUPARSER AND TARGET muparser::muparser) add_library(external-muparser INTERFACE) target_link_libraries(external-muparser INTERFACE muparser::muparser) elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_MUPARSER) - set(MUPARSER_VER 2.3.3-1) - set(MUPARSER_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/muparser-${MUPARSER_VER}) + set(MUPARSER_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/muparser-2.3.3-1") + set(MUPARSER_CHECK "${MUPARSER_DIR}/src/muParser.cpp") - if (NOT EXISTS "${MUPARSER_DIR}/src/muParser.cpp") - set(MUPARSER_LINK https://github.com/beltoforion/muparser/archive/refs/tags/v${MUPARSER_VER}.zip) - download_and_unzip(${MUPARSER_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "muparser") + if (NOT EXISTS ${MUPARSER_CHECK}) + set(MUPARSER_LINK https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.3-1.zip) + download_and_unzip( + LINK ${MUPARSER_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "muparser") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- muparser - download failed.") + endif() endif() - message(STATUS "- muparser - using downloaded source") + if (EXISTS ${MUPARSER_CHECK}) + message(STATUS "- muparser - using downloaded source") - set(ENABLE_SAMPLES OFF) - set(MESSAGE_QUIET ON) - add_subdirectory(${MUPARSER_DIR}) - unset(MESSAGE_QUIET) - unset(ENABLE_SAMPLES) + set(ENABLE_SAMPLES OFF) + set(MESSAGE_QUIET ON) + add_subdirectory(${MUPARSER_DIR}) + unset(MESSAGE_QUIET) + unset(ENABLE_SAMPLES) - add_library(external-muparser INTERFACE) - target_link_libraries(external-muparser INTERFACE muparser) - install(TARGETS muparser DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + add_library(external-muparser INTERFACE) + target_link_libraries(external-muparser INTERFACE muparser) + install(TARGETS muparser DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + endif() endif() diff --git a/src/external/nexus.cmake b/src/external/nexus.cmake index d8bccf0aa..baded8450 100644 --- a/src/external/nexus.cmake +++ b/src/external/nexus.cmake @@ -6,27 +6,44 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS "Allow download and use of nexus sour if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS) # todo - make release of nexus and corto - set(NEXUS_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/nexus-master) - set(CORTO_DIR ${NEXUS_DIR}/src/corto) + set(NEXUS_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/nexus-master") + set(NEXUS_CHECK "${NEXUS_DIR}/CMakeLists.txt") + set(CORTO_DIR "${NEXUS_DIR}/src/corto") + set(CORTO_CHECK "${CORTO_DIR}/CMakeLists.txt") - if (NOT EXISTS "${NEXUS_DIR}/CMakeLists.txt") + if (NOT EXISTS ${NEXUS_CHECK}) set(NEXUS_LINK https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip) - download_and_unzip(${NEXUS_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "nexus") + download_and_unzip( + LINK ${NEXUS_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "nexus") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- nexus - download failed.") + endif() endif() - if (NOT EXISTS "${CORTO_DIR}/CMakeLists.txt") + 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) - download_and_unzip(${CORTO_LINK} "${NEXUS_DIR}/src/" "corto") - file(RENAME ${NEXUS_DIR}/src/corto-master ${NEXUS_DIR}/src/corto) + download_and_unzip( + LINK ${CORTO_LINK} + DIR "${NEXUS_DIR}/src/" + NAME "corto") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- corto - download failed.") + else() + file(RENAME ${NEXUS_DIR}/src/corto-master ${NEXUS_DIR}/src/corto) + endif() endif() - message(STATUS "- nexus - using downloaded source") + if (EXISTS ${NEXUS_CHECK} AND EXISTS ${CORTO_CHECK}) + message(STATUS "- nexus - using downloaded source") - set (BUILD_NXS_BUILD OFF) - set (BUILD_NXS_EDIT OFF) - set (BUILD_NXS_VIEW OFF) - add_subdirectory(${NEXUS_DIR} EXCLUDE_FROM_ALL) - add_library(external-nexus INTERFACE) - target_link_libraries(external-nexus INTERFACE nexus) + set (BUILD_NXS_BUILD OFF) + set (BUILD_NXS_EDIT OFF) + set (BUILD_NXS_VIEW OFF) + add_subdirectory(${NEXUS_DIR} EXCLUDE_FROM_ALL) + add_library(external-nexus INTERFACE) + target_link_libraries(external-nexus INTERFACE nexus) + endif() endif() diff --git a/src/external/openctm.cmake b/src/external/openctm.cmake index 041563dae..abe51f5f2 100644 --- a/src/external/openctm.cmake +++ b/src/external/openctm.cmake @@ -12,33 +12,42 @@ if(MESHLAB_ALLOW_SYSTEM_OPENCTM AND TARGET OpenCTM::OpenCTM) add_library(external-openctm INTERFACE) target_link_libraries(external-openctm INTERFACE OpenCTM::OpenCTM) elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_OPENCTM) - set(OPENCTM_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/OpenCTM-1.0.3) + set(OPENCTM_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/OpenCTM-1.0.3") + set(OPENCTM_CHECK "${OPENCTM_DIR}/lib/openctm.c") - if (NOT EXISTS "${OPENCTM_DIR}/lib/openctm.c") + 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) - download_and_unzip(${OPENCTM_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "OpenCTM") + download_and_unzip( + LINK ${OPENCTM_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "OpenCTM") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- OpenCTM - download failed.") + endif() endif() - message(STATUS "- OpenCTM - using downloaded source") - add_library( - external-openctm STATIC - "${OPENCTM_DIR}/lib/openctm.c" - "${OPENCTM_DIR}/lib/stream.c" - "${OPENCTM_DIR}/lib/compressRAW.c" - "${OPENCTM_DIR}/lib/compressMG1.c" - "${OPENCTM_DIR}/lib/compressMG2.c" - "${OPENCTM_DIR}/lib/liblzma/Alloc.c" - "${OPENCTM_DIR}/lib/liblzma/LzFind.c" - "${OPENCTM_DIR}/lib/liblzma/LzmaDec.c" - "${OPENCTM_DIR}/lib/liblzma/LzmaEnc.c" - "${OPENCTM_DIR}/lib/liblzma/LzmaLib.c") - target_compile_definitions(external-openctm PUBLIC OPENCTM_STATIC) - target_include_directories( - external-openctm SYSTEM - PUBLIC "${OPENCTM_DIR}/lib" SYSTEM - PRIVATE "${OPENCTM_DIR}/lib/liblzma") - if(MSVC) - target_compile_definitions(external-openctm PRIVATE _CRT_SECURE_NO_WARNINGS) + if (EXISTS ${OPENCTM_CHECK}) + message(STATUS "- OpenCTM - using downloaded source") + add_library( + external-openctm STATIC + "${OPENCTM_DIR}/lib/openctm.c" + "${OPENCTM_DIR}/lib/stream.c" + "${OPENCTM_DIR}/lib/compressRAW.c" + "${OPENCTM_DIR}/lib/compressMG1.c" + "${OPENCTM_DIR}/lib/compressMG2.c" + "${OPENCTM_DIR}/lib/liblzma/Alloc.c" + "${OPENCTM_DIR}/lib/liblzma/LzFind.c" + "${OPENCTM_DIR}/lib/liblzma/LzmaDec.c" + "${OPENCTM_DIR}/lib/liblzma/LzmaEnc.c" + "${OPENCTM_DIR}/lib/liblzma/LzmaLib.c") + target_compile_definitions(external-openctm PUBLIC OPENCTM_STATIC) + target_include_directories( + external-openctm SYSTEM + PUBLIC "${OPENCTM_DIR}/lib" SYSTEM + PRIVATE "${OPENCTM_DIR}/lib/liblzma") + if(MSVC) + target_compile_definitions(external-openctm PRIVATE _CRT_SECURE_NO_WARNINGS) + endif() + target_link_libraries(external-openctm PRIVATE external-disable-warnings) endif() - target_link_libraries(external-openctm PRIVATE external-disable-warnings) endif() diff --git a/src/external/qhull.cmake b/src/external/qhull.cmake index 23a002497..2e11f8ed4 100644 --- a/src/external/qhull.cmake +++ b/src/external/qhull.cmake @@ -12,21 +12,29 @@ if(MESHLAB_ALLOW_SYSTEM_QHULL AND TARGET Qhull::qhull_r) add_library(external-qhull INTERFACE) target_link_libraries(external-qhull INTERFACE Qhull::qhull_r) elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_QHULL) - set(QHULL_VER 2020.2) - set(QHULL_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/qhull-${QHULL_VER}) + set(QHULL_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/qhull-2020.2") + set(QHULL_CHECK "${QHULL_DIR}/src/libqhull_r/libqhull_r.h") - if (NOT EXISTS "${QHULL_DIR}/src/libqhull_r/libqhull_r.h") - set(QHULL_LINK https://github.com/qhull/qhull/archive/refs/tags/${QHULL_VER}.zip) - download_and_unzip(${QHULL_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "Qhull") + if (NOT EXISTS ${QHULL_CHECK}) + set(QHULL_LINK https://github.com/qhull/qhull/archive/refs/tags/2020.2.zip) + download_and_unzip( + LINK ${QHULL_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "Qhull") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- Qhull - download failed.") + endif() endif() - message(STATUS "- qhull - using downloaded source") + if (EXISTS ${QHULL_CHECK}) + message(STATUS "- qhull - using downloaded source") - set(MESSAGE_QUIET ON) - add_subdirectory(${QHULL_DIR} EXCLUDE_FROM_ALL) - unset(MESSAGE_QUIET) + set(MESSAGE_QUIET ON) + add_subdirectory(${QHULL_DIR} EXCLUDE_FROM_ALL) + unset(MESSAGE_QUIET) - add_library(external-qhull INTERFACE) - target_link_libraries(external-qhull INTERFACE qhullstatic_r) - target_include_directories(external-qhull INTERFACE "${QHULL_DIR}/src") + add_library(external-qhull INTERFACE) + target_link_libraries(external-qhull INTERFACE qhullstatic_r) + target_include_directories(external-qhull INTERFACE "${QHULL_DIR}/src") + endif() endif() diff --git a/src/external/ssynth.cmake b/src/external/ssynth.cmake index 3c782e564..a27207f14 100644 --- a/src/external/ssynth.cmake +++ b/src/external/ssynth.cmake @@ -2,20 +2,28 @@ # Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council # SPDX-License-Identifier: BSL-1.0 -option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_STRUCTURE_SYNTH "Allow use of bundled structure-synth source" ON) +option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_STRUCTURE_SYNTH "Allow use of bundled Structure Synth source" ON) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_STRUCTURE_SYNTH) - set(SSYNTH_VER 1.5.1) - set(SSYNTH_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/StructureSynth-${SSYNTH_VER}) + set(SSYNTH_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/StructureSynth-1.5.1") + set(SSYNTH_CHECK "${SSYNTH_DIR}/StructureSynth/Model/Action.h") - if (NOT EXISTS "${SSYNTH_DIR}/StructureSynth/Model/Action.h") - set(SSYNTH_LINK "https://github.com/alemuntoni/StructureSynth/archive/refs/tags/${SSYNTH_VER}.zip") - download_and_unzip(${SSYNTH_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "Structure Synth") + if (NOT EXISTS ${SSYNTH_CHECK}) + set(SSYNTH_LINK "https://github.com/alemuntoni/StructureSynth/archive/refs/tags/1.5.1.zip") + download_and_unzip( + LINK ${SSYNTH_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "Structure Synth") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- Structure Synth - download failed.") + endif() endif() - message(STATUS "- structure-synth - using downloaded source") + if(EXISTS ${SSYNTH_CHECK}) + message(STATUS "- Structure Synth - using downloaded source") - add_subdirectory(${SSYNTH_DIR}) - add_library(external-ssynth INTERFACE) - target_link_libraries(external-ssynth INTERFACE structure-synth) + add_subdirectory(${SSYNTH_DIR}) + add_library(external-ssynth INTERFACE) + target_link_libraries(external-ssynth INTERFACE structure-synth) + endif() endif() diff --git a/src/external/tinygltf.cmake b/src/external/tinygltf.cmake index 691ca19e0..d04bc99be 100644 --- a/src/external/tinygltf.cmake +++ b/src/external/tinygltf.cmake @@ -5,14 +5,23 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_TINYGLTF "Allow download and use of tinyglTF source" ON) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_TINYGLTF) - set(TINYGLTF_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/tinygltf-2.6.3) + set(TINYGLTF_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/tinygltf-2.6.3") + set(TINYGLTF_CHECK "${TINYGLTF_DIR}/tiny_gltf.h") - if (NOT EXISTS "${TINYGLTF_DIR}/tiny_gltf.h") + if (NOT EXISTS ${TINYGLTF_CHECK}) set(TINYGLTF_LINK https://github.com/syoyo/tinygltf/archive/refs/tags/v2.6.3.zip) - download_and_unzip(${TINYGLTF_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "tinygltf") + download_and_unzip( + LINK ${TINYGLTF_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "tinygltf") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- tinygltf - download failed.") + endif() endif() - message(STATUS "- tiny glTF - using downloaded source") - add_library(external-tinygltf INTERFACE) - target_include_directories(external-tinygltf INTERFACE ${TINYGLTF_DIR}) + if(EXISTS ${TINYGLTF_CHECK}) + message(STATUS "- tiny glTF - using downloaded source") + add_library(external-tinygltf INTERFACE) + target_include_directories(external-tinygltf INTERFACE ${TINYGLTF_DIR}) + endif() endif() diff --git a/src/external/u3d.cmake b/src/external/u3d.cmake index 25beee54e..c9037d5f6 100644 --- a/src/external/u3d.cmake +++ b/src/external/u3d.cmake @@ -6,24 +6,33 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_U3D "Allow download and use of u3d source" if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_U3D) # todo - make release of u3d - set(U3D_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/u3d-master) + set(U3D_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/u3d-master") + set(U3D_CHECK "${U3D_DIR}/CMakeLists.txt") - if (NOT EXISTS ${U3D_DIR}/CMakeLists.txt) + if (NOT EXISTS ${U3D_CHECK}) set(U3D_LINK https://github.com/alemuntoni/u3d/archive/refs/heads/master.zip) - download_and_unzip(${U3D_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "u3d") + download_and_unzip( + LINK ${U3D_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "u3d") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- u3d - download failed.") + endif() endif() - message(STATUS "- u3d - using bundled source") + if (EXISTS ${U3D_CHECK}) + message(STATUS "- u3d - using bundled source") - set(MESSAGE_QUIET ON) - add_subdirectory(${U3D_DIR}) - unset(MESSAGE_QUIET) - install( - TARGETS - IFXCore - IFXExporting - IFXScheduling - IDTF-to-U3D-converter - DESTINATION - ${MESHLAB_LIB_INSTALL_DIR}) + set(MESSAGE_QUIET ON) + add_subdirectory(${U3D_DIR}) + unset(MESSAGE_QUIET) + install( + TARGETS + IFXCore + IFXExporting + IFXScheduling + IDTF-to-U3D-converter + DESTINATION + ${MESHLAB_LIB_INSTALL_DIR}) + endif() endif() diff --git a/src/external/xerces.cmake b/src/external/xerces.cmake index 59df3092a..c170d4cdf 100644 --- a/src/external/xerces.cmake +++ b/src/external/xerces.cmake @@ -7,33 +7,40 @@ option(MESHLAB_ALLOW_SYSTEM_XERCES "Allow use of system-provided Xerces-C" ON) find_package(XercesC) -# https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.4.zip - if(MESHLAB_ALLOW_SYSTEM_XERCES AND TARGET XercesC::XercesC) - message(STATUS "- XercesC - using system-provided library") + message(STATUS "- Xerces-C - using system-provided library") add_library(external-xerces INTERFACE) target_link_libraries(external-xerces INTERFACE XercesC::XercesC) elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_XERCES) set(XERCES_C_VER 3.2.4) - set(XERCES_C_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/xerces-c-${XERCES_C_VER}) + set(XERCES_C_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/xerces-c-${XERCES_C_VER}") + set(XERCES_C_CHECK "${XERCES_C_DIR}/CMakeLists.txt") - if (NOT EXISTS ${XERCES_C_DIR}/CMakeLists.txt) + if(NOT EXISTS ${XERCES_C_CHECK}) set(XERCES_C_LINK https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-${XERCES_C_VER}.zip) - download_and_unzip(${XERCES_C_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "Xerces-C") + download_and_unzip( + LINK ${XERCES_C_LINK} + DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} + NAME "Xerces-C") + if (NOT download_and_unzip_SUCCESS) + message(STATUS "- Xerces-C - download failed.") + endif() endif() - message(STATUS "- XercesC - using downloaded source") + if(EXISTS ${XERCES_C_CHECK}) + message(STATUS "- Xerces-C - using downloaded source") - set(MESSAGE_QUIET ON) - add_subdirectory(${XERCES_C_DIR} EXCLUDE_FROM_ALL) - unset(MESSAGE_QUIET) + set(MESSAGE_QUIET ON) + add_subdirectory(${XERCES_C_DIR} EXCLUDE_FROM_ALL) + unset(MESSAGE_QUIET) - add_library(external-xerces INTERFACE) - target_link_libraries(external-xerces INTERFACE xerces-c) - target_include_directories( - external-xerces INTERFACE - ${XERCES_C_DIR}/src - ${MESHLAB_EXTERNAL_BINARY_DIR}/xerces-c-${XERCES_C_VER}/src) - add_library(XercesC::XercesC ALIAS external-xerces) - install(TARGETS xerces-c DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + add_library(external-xerces INTERFACE) + target_link_libraries(external-xerces INTERFACE xerces-c) + target_include_directories( + external-xerces INTERFACE + ${XERCES_C_DIR}/src + ${MESHLAB_EXTERNAL_BINARY_DIR}/xerces-c-${XERCES_C_VER}/src) + add_library(XercesC::XercesC ALIAS external-xerces) + install(TARGETS xerces-c DESTINATION ${MESHLAB_LIB_INSTALL_DIR}) + endif() endif() From d46e466c9db715fd33cf2f366b3ef959a9812c9d Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 4 Nov 2022 15:43:43 +0100 Subject: [PATCH 3/4] using md5 when downloading external libraries --- src/cmake/meshlab_tools.cmake | 34 +++++++++++++++++++++++++--------- src/external/boost.cmake | 6 ++++-- src/external/cgal.cmake | 12 ++++++++---- src/external/e57.cmake | 6 ++++-- src/external/easyexif.cmake | 6 ++++-- src/external/glew.cmake | 6 ++++-- src/external/levmar.cmake | 6 ++++-- src/external/lib3ds.cmake | 6 ++++-- src/external/libigl.cmake | 6 ++++-- src/external/muparser.cmake | 6 ++++-- src/external/nexus.cmake | 12 ++++++++---- src/external/openctm.cmake | 6 ++++-- src/external/qhull.cmake | 6 ++++-- src/external/ssynth.cmake | 8 +++++--- src/external/tinygltf.cmake | 6 ++++-- src/external/u3d.cmake | 6 ++++-- src/external/xerces.cmake | 6 ++++-- 17 files changed, 98 insertions(+), 46 deletions(-) diff --git a/src/cmake/meshlab_tools.cmake b/src/cmake/meshlab_tools.cmake index 9e2c0f77b..626b39981 100644 --- a/src/cmake/meshlab_tools.cmake +++ b/src/cmake/meshlab_tools.cmake @@ -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() diff --git a/src/external/boost.cmake b/src/external/boost.cmake index 46ea6fa20..7187dd305 100644 --- a/src/external/boost.cmake +++ b/src/external/boost.cmake @@ -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() diff --git a/src/external/cgal.cmake b/src/external/cgal.cmake index ddeb7a2c0..3552a08ad 100644 --- a/src/external/cgal.cmake +++ b/src/external/cgal.cmake @@ -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) diff --git a/src/external/e57.cmake b/src/external/e57.cmake index af27fae05..867b26a7b 100644 --- a/src/external/e57.cmake +++ b/src/external/e57.cmake @@ -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() diff --git a/src/external/easyexif.cmake b/src/external/easyexif.cmake index ce18b8053..d6f19b9ca 100644 --- a/src/external/easyexif.cmake +++ b/src/external/easyexif.cmake @@ -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() diff --git a/src/external/glew.cmake b/src/external/glew.cmake index a304e0632..fff07871f 100644 --- a/src/external/glew.cmake +++ b/src/external/glew.cmake @@ -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() diff --git a/src/external/levmar.cmake b/src/external/levmar.cmake index 57ebb8648..fb5de25db 100644 --- a/src/external/levmar.cmake +++ b/src/external/levmar.cmake @@ -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() diff --git a/src/external/lib3ds.cmake b/src/external/lib3ds.cmake index 5c03328e5..8d15dd076 100644 --- a/src/external/lib3ds.cmake +++ b/src/external/lib3ds.cmake @@ -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() diff --git a/src/external/libigl.cmake b/src/external/libigl.cmake index 0d9bc58ed..6554993c7 100644 --- a/src/external/libigl.cmake +++ b/src/external/libigl.cmake @@ -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() diff --git a/src/external/muparser.cmake b/src/external/muparser.cmake index d5672b0c9..ce33a7c0a 100644 --- a/src/external/muparser.cmake +++ b/src/external/muparser.cmake @@ -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() diff --git a/src/external/nexus.cmake b/src/external/nexus.cmake index baded8450..9b22cdfdb 100644 --- a/src/external/nexus.cmake +++ b/src/external/nexus.cmake @@ -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() diff --git a/src/external/openctm.cmake b/src/external/openctm.cmake index abe51f5f2..b293ef51c 100644 --- a/src/external/openctm.cmake +++ b/src/external/openctm.cmake @@ -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() diff --git a/src/external/qhull.cmake b/src/external/qhull.cmake index 2e11f8ed4..790116af4 100644 --- a/src/external/qhull.cmake +++ b/src/external/qhull.cmake @@ -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() diff --git a/src/external/ssynth.cmake b/src/external/ssynth.cmake index a27207f14..bf6375310 100644 --- a/src/external/ssynth.cmake +++ b/src/external/ssynth.cmake @@ -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() diff --git a/src/external/tinygltf.cmake b/src/external/tinygltf.cmake index d04bc99be..4a53f774c 100644 --- a/src/external/tinygltf.cmake +++ b/src/external/tinygltf.cmake @@ -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() diff --git a/src/external/u3d.cmake b/src/external/u3d.cmake index c9037d5f6..80c8a8874 100644 --- a/src/external/u3d.cmake +++ b/src/external/u3d.cmake @@ -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() diff --git a/src/external/xerces.cmake b/src/external/xerces.cmake index c170d4cdf..fc94fd391 100644 --- a/src/external/xerces.cmake +++ b/src/external/xerces.cmake @@ -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() From 026074d38a259abcb86d862e6fec27a6b2556584 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 4 Nov 2022 17:00:42 +0100 Subject: [PATCH 4/4] download external libraries mirror links --- src/external/cgal.cmake | 8 ++++++-- src/external/e57.cmake | 4 +++- src/external/easyexif.cmake | 4 +++- src/external/glew.cmake | 4 +++- src/external/levmar.cmake | 4 +++- src/external/lib3ds.cmake | 4 +++- src/external/libigl.cmake | 4 +++- src/external/muparser.cmake | 4 +++- src/external/nexus.cmake | 8 ++++++-- src/external/openctm.cmake | 4 +++- src/external/qhull.cmake | 4 +++- src/external/ssynth.cmake | 4 +++- src/external/tinygltf.cmake | 4 +++- src/external/u3d.cmake | 4 +++- src/external/xerces.cmake | 4 +++- 15 files changed, 51 insertions(+), 17 deletions(-) diff --git a/src/external/cgal.cmake b/src/external/cgal.cmake index 3552a08ad..4317336c4 100644 --- a/src/external/cgal.cmake +++ b/src/external/cgal.cmake @@ -20,7 +20,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL) set(CGAL_DOWNLOAD_SUCCESS TRUE) 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_LINK + https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip + https://www.meshlab.net/data/libs/CGAL-5.2.1.zip) set(CGAL_MD5 1a999ab90ea4cf28f6aa17ea2af24876) download_and_unzip( NAME "CGAL" @@ -34,7 +36,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL) endif() 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_LINK + https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip + https://www.meshlab.net/data/libs/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip) set(CGAL_AUX_MD5 247f4dca741c6b9a9be76286414070fa) download_and_unzip( NAME "CGAL auxiliary libraries" diff --git a/src/external/e57.cmake b/src/external/e57.cmake index 867b26a7b..6347caa08 100644 --- a/src/external/e57.cmake +++ b/src/external/e57.cmake @@ -10,7 +10,9 @@ if (TARGET XercesC::XercesC) set(LIBE57_CHECK "${LIBE57_DIR}/CMakeLists.txt") if (NOT EXISTS ${LIBE57_CHECK}) - set(LIBE57_LINK https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.zip) + set(LIBE57_LINK + https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.zip + https://www.meshlab.net/data/libs/libE57Format-2.3.0.zip) set(LIBE57_MD5 958ada3883f9b60195f79bbab156f3e3) download_and_unzip( NAME "LibE57" diff --git a/src/external/easyexif.cmake b/src/external/easyexif.cmake index d6f19b9ca..575a281d3 100644 --- a/src/external/easyexif.cmake +++ b/src/external/easyexif.cmake @@ -9,7 +9,9 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_EASYEXIF) set(EASYEXIF_CHECK "${EASYEXIF_DIR}/exif.h") if (NOT EXISTS ${EASYEXIF_CHECK}) - set(EASYEXIF_LINK https://github.com/mayanklahiri/easyexif/archive/refs/tags/v1.0.zip) + set(EASYEXIF_LINK + https://github.com/mayanklahiri/easyexif/archive/refs/tags/v1.0.zip + https://www.meshlab.net/data/libs/easyexif-1.0.zip) set(EASYEXIF_MD5 d46ec21b5c8ce13cda0fe66a4477a8c3) download_and_unzip( NAME "EasyExif" diff --git a/src/external/glew.cmake b/src/external/glew.cmake index fff07871f..0d16e915f 100644 --- a/src/external/glew.cmake +++ b/src/external/glew.cmake @@ -28,7 +28,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_GLEW) set(GLEW_CHECK "${GLEW_DIR}/src/glew.c") 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_LINK + https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.zip + https://www.meshlab.net/data/libs/glew-2.2.0.zip) set(GLEW_MD5 970535b75b1b69ebd018a0fa05af63d1) download_and_unzip( NAME "GLEW" diff --git a/src/external/levmar.cmake b/src/external/levmar.cmake index fb5de25db..e5fe88c82 100644 --- a/src/external/levmar.cmake +++ b/src/external/levmar.cmake @@ -9,7 +9,9 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LEVMAR) set(LEVMAR_CHECK "${LEVMAR_DIR}/lm.h") if (NOT EXISTS ${LEVMAR_CHECK}) - set(LEVMAR_LINK http://users.ics.forth.gr/~lourakis/levmar/levmar-2.6.tgz) + set(LEVMAR_LINK + http://users.ics.forth.gr/~lourakis/levmar/levmar-2.6.tgz + https://www.meshlab.net/data/libs/levmar-2.6.tgz) set(LEVMAR_MD5 16bc34efa1617219f241eef06427f13f) download_and_unzip( NAME "Levmar" diff --git a/src/external/lib3ds.cmake b/src/external/lib3ds.cmake index 8d15dd076..0dde58b17 100644 --- a/src/external/lib3ds.cmake +++ b/src/external/lib3ds.cmake @@ -17,7 +17,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIB3DS) set(LIB3DS_CHECK "${LIB3DS_DIR}/lib3ds/types.h") 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_LINK + http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/lib3ds/lib3ds-1.3.0.zip + https://www.meshlab.net/data/libs/lib3ds-1.3.0.zip) set(LIB3DS_MD5 2572f7b0f29b591d494c1a0658b35c86) download_and_unzip( NAME "Lib3DS" diff --git a/src/external/libigl.cmake b/src/external/libigl.cmake index 6554993c7..352cc34c9 100644 --- a/src/external/libigl.cmake +++ b/src/external/libigl.cmake @@ -9,7 +9,9 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL) set(LIBIGL_CHECK "${LIBIGL_DIR}/include/igl/igl_inline.h") if (NOT EXISTS ${LIBIGL_CHECK}) - set(LIBIGL_LINK https://github.com/libigl/libigl/archive/refs/tags/v2.4.0.zip) + set(LIBIGL_LINK + https://github.com/libigl/libigl/archive/refs/tags/v2.4.0.zip + https://www.meshlab.net/data/libs/libigl-2.4.0.zip) set(LIBIGL_MD5 0b4fea5dba2117b8db85c99a39a71f83) download_and_unzip( NAME "LibIGL" diff --git a/src/external/muparser.cmake b/src/external/muparser.cmake index ce33a7c0a..d14d25722 100644 --- a/src/external/muparser.cmake +++ b/src/external/muparser.cmake @@ -16,7 +16,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_MUPARSER) set(MUPARSER_CHECK "${MUPARSER_DIR}/src/muParser.cpp") if (NOT EXISTS ${MUPARSER_CHECK}) - set(MUPARSER_LINK https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.3-1.zip) + set(MUPARSER_LINK + https://github.com/beltoforion/muparser/archive/refs/tags/v2.3.3-1.zip + https://www.meshlab.net/data/libs/muparser-2.3.3-1.zip) set(MUPARSER_MD5 8cf887ce460a405b8d8b966e0d5c94e3) download_and_unzip( NAME "muparser" diff --git a/src/external/nexus.cmake b/src/external/nexus.cmake index 9b22cdfdb..117634acc 100644 --- a/src/external/nexus.cmake +++ b/src/external/nexus.cmake @@ -12,7 +12,9 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS) set(CORTO_CHECK "${CORTO_DIR}/CMakeLists.txt") if (NOT EXISTS ${NEXUS_CHECK}) - set(NEXUS_LINK https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip) + set(NEXUS_LINK + https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip + https://www.meshlab.net/data/libs/nexus-master.zip) #set(NEXUS_MD5 3e50878dbaedd140f3e8c34d5af9a9d9) download_and_unzip( NAME "nexus" @@ -26,7 +28,9 @@ 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_LINK + https://github.com/cnr-isti-vclab/corto/archive/refs/heads/master.zip + https://www.meshlab.net/data/libs/corto-master.zip) #set(CORTO_MD5 ede1b41e369a8117d8f2f46fba89e11d) download_and_unzip( NAME "corto" diff --git a/src/external/openctm.cmake b/src/external/openctm.cmake index b293ef51c..c5dda5949 100644 --- a/src/external/openctm.cmake +++ b/src/external/openctm.cmake @@ -16,7 +16,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_OPENCTM) set(OPENCTM_CHECK "${OPENCTM_DIR}/lib/openctm.c") 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_LINK + https://sourceforge.net/projects/openctm/files/OpenCTM-1.0.3/OpenCTM-1.0.3-src.zip/download + https://www.meshlab.net/data/libs/OpenCTM-1.0.3-src.zip) set(OPENCTM_MD5 a87b6a6509ae0712b4a55f8887dc6a54) download_and_unzip( NAME "OpenCTM" diff --git a/src/external/qhull.cmake b/src/external/qhull.cmake index 790116af4..c8a1174d9 100644 --- a/src/external/qhull.cmake +++ b/src/external/qhull.cmake @@ -16,7 +16,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_QHULL) set(QHULL_CHECK "${QHULL_DIR}/src/libqhull_r/libqhull_r.h") if (NOT EXISTS ${QHULL_CHECK}) - set(QHULL_LINK https://github.com/qhull/qhull/archive/refs/tags/2020.2.zip) + set(QHULL_LINK + https://github.com/qhull/qhull/archive/refs/tags/2020.2.zip + https://www.meshlab.net/data/libs/qhull-2020.2.zip) set(QHULL_MD5 a0a9b0e69bdbd9461319b8d2ac3d2f2e) download_and_unzip( NAME "Qhull" diff --git a/src/external/ssynth.cmake b/src/external/ssynth.cmake index bf6375310..5dea45a0b 100644 --- a/src/external/ssynth.cmake +++ b/src/external/ssynth.cmake @@ -9,7 +9,9 @@ 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 + https://www.meshlab.net/data/libs/StructureSynth-1.5.1.zip) set(SSYNTH_MD5 e2122c5e6e370fb36c885bccf59562b7) download_and_unzip( NAME "Structure Synth" diff --git a/src/external/tinygltf.cmake b/src/external/tinygltf.cmake index 4a53f774c..768516f60 100644 --- a/src/external/tinygltf.cmake +++ b/src/external/tinygltf.cmake @@ -9,7 +9,9 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_TINYGLTF) set(TINYGLTF_CHECK "${TINYGLTF_DIR}/tiny_gltf.h") if (NOT EXISTS ${TINYGLTF_CHECK}) - set(TINYGLTF_LINK https://github.com/syoyo/tinygltf/archive/refs/tags/v2.6.3.zip) + set(TINYGLTF_LINK + https://github.com/syoyo/tinygltf/archive/refs/tags/v2.6.3.zip + https://www.meshlab.net/data/libs/tinygltf-2.6.3.zip) set(TINYGLTF_MD5 f63ab0fb59e5de059d9719cc14057dc8) download_and_unzip( NAME "tinygltf" diff --git a/src/external/u3d.cmake b/src/external/u3d.cmake index 80c8a8874..fb446a929 100644 --- a/src/external/u3d.cmake +++ b/src/external/u3d.cmake @@ -10,7 +10,9 @@ if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_U3D) set(U3D_CHECK "${U3D_DIR}/CMakeLists.txt") if (NOT EXISTS ${U3D_CHECK}) - set(U3D_LINK https://github.com/alemuntoni/u3d/archive/refs/heads/master.zip) + set(U3D_LINK + https://github.com/alemuntoni/u3d/archive/refs/heads/master.zip + https://www.meshlab.net/data/libs/u3d-master.zip) #set(U3D_MD5 3b15b2f75206ea24b8991333562aa9ca) download_and_unzip( NAME "u3d" diff --git a/src/external/xerces.cmake b/src/external/xerces.cmake index fc94fd391..5a5e22208 100644 --- a/src/external/xerces.cmake +++ b/src/external/xerces.cmake @@ -17,7 +17,9 @@ elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_XERCES) set(XERCES_C_CHECK "${XERCES_C_DIR}/CMakeLists.txt") 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_LINK + https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-${XERCES_C_VER}.zip + https://www.meshlab.net/data/libs/xerces-c-${XERCES_C_VER}.zip) set(XERCES_C_MD5 f84488fc2b8f62c4afca2f9943a42c00) download_and_unzip( NAME "Xerces-C"