-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
35 lines (26 loc) · 849 Bytes
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(torch_cpp CXX)
set(TORCH_URL https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.1.2%2Bcu118.zip)
set(TORCH_URL_MD5 9a895fc9c942c63154edbc48ae700adb)
include(ExternalProject)
ExternalProject_Add(torch_archive
URL ${TORCH_URL}
URL_MD5 ${TORCH_URL_MD5}
PREFIX torch_archive
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(torch_archive SOURCE_DIR)
set(TORCH_PATH ${SOURCE_DIR})
# manually install header, libraries and config files
install(DIRECTORY ${TORCH_PATH}/include/
DESTINATION include
FILES_MATCHING PATTERN "*.h*"
)
install(DIRECTORY ${TORCH_PATH}/lib/
DESTINATION lib
)
install(DIRECTORY ${TORCH_PATH}/share/
DESTINATION share
)