-
Notifications
You must be signed in to change notification settings - Fork 817
/
libigl.cmake
33 lines (28 loc) · 1.12 KB
/
libigl.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright 2019, 2021, Collabora, Ltd.
# Copyright 2019, 2021, Visual Computing Lab, ISTI - Italian National Research Council
# SPDX-License-Identifier: BSL-1.0
option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL "Allow download and use of LibIGL source" ON)
set(LIBIGL_VER 2.4.0)
if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL)
set(LIBIGL_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-${LIBIGL_VER}")
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/v${LIBIGL_VER}.zip
https://www.meshlab.net/data/libs/libigl-${LIBIGL_VER}.zip)
set(LIBIGL_MD5 0b4fea5dba2117b8db85c99a39a71f83)
download_and_unzip(
NAME "LibIGL"
LINK ${LIBIGL_LINK}
MD5 ${LIBIGL_MD5}
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
if (NOT download_and_unzip_SUCCESS)
message(STATUS "- LibIGL - download failed.")
endif()
endif()
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()