-
Notifications
You must be signed in to change notification settings - Fork 638
/
Copy pathhclust-cpp.cmake
47 lines (40 loc) · 1.62 KB
/
hclust-cpp.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function(download_hclust_cpp)
include(FetchContent)
# The latest commit as of 2024.09.29
set(hclust_cpp_URL "https://github.com/csukuangfj/hclust-cpp/archive/refs/tags/2024-09-29.tar.gz")
set(hclust_cpp_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/hclust-cpp-2024-09-29.tar.gz")
set(hclust_cpp_HASH "SHA256=abab51448a3cb54272aae07522970306e0b2cc6479d59d7b19e7aee4d6cedd33")
# If you don't have access to the Internet,
# please pre-download hclust-cpp
set(possible_file_locations
$ENV{HOME}/Downloads/hclust-cpp-2024-09-29.tar.gz
${CMAKE_SOURCE_DIR}/hclust-cpp-2024-09-29.tar.gz
${CMAKE_BINARY_DIR}/hclust-cpp-2024-09-29.tar.gz
/tmp/hclust-cpp-2024-09-29.tar.gz
/star-fj/fangjun/download/github/hclust-cpp-2024-09-29.tar.gz
)
foreach(f IN LISTS possible_file_locations)
if(EXISTS ${f})
set(hclust_cpp_URL "${f}")
file(TO_CMAKE_PATH "${hclust_cpp_URL}" hclust_cpp_URL)
message(STATUS "Found local downloaded hclust_cpp: ${hclust_cpp_URL}")
set(hclust_cpp_URL2)
break()
endif()
endforeach()
FetchContent_Declare(hclust_cpp
URL
${hclust_cpp_URL}
${hclust_cpp_URL2}
URL_HASH ${hclust_cpp_HASH}
)
FetchContent_GetProperties(hclust_cpp)
if(NOT hclust_cpp_POPULATED)
message(STATUS "Downloading hclust_cpp from ${hclust_cpp_URL}")
FetchContent_Populate(hclust_cpp)
endif()
message(STATUS "hclust_cpp is downloaded to ${hclust_cpp_SOURCE_DIR}")
message(STATUS "hclust_cpp's binary dir is ${hclust_cpp_BINARY_DIR}")
include_directories(${hclust_cpp_SOURCE_DIR})
endfunction()
download_hclust_cpp()