-
Notifications
You must be signed in to change notification settings - Fork 57
/
CMakeLists.txt
96 lines (82 loc) · 1.81 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
##
## CMAKE VERSION
##
cmake_minimum_required(VERSION 3.5)
##
## PROJECT NAME
##
project(SMPL++)
##
## COMPILER SETTINGS
##
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
##
## PACKAGES
##
# xtensor
find_package(xtensor REQUIRED)
# json
find_package(nlohmann_json REQUIRED)
# Torch
find_package(Torch REQUIRED)
##
## GATHER FILES
##
file(GLOB HEADER
"SMPL++/include/*.h"
"SMPL++/include/*.hpp"
"SMPL++/include/definition/*.h"
"SMPL++/include/definition/*.hpp"
"SMPL++/include/toolbox/*.h"
"SMPL++/include/toolbox/*.hpp"
"SMPL++/include/smpl/*.h"
"SMPL++/include/smpl/*.hpp"
)
file(GLOB SOURCE
"SMPL++/src/*.c"
"SMPL++/src/*.cpp"
"SMPL++/src/definition/*.c"
"SMPL++/src/definition/*.cpp"
"SMPL++/src/toolbox/*.c"
"SMPL++/src/toolbox/*.cpp"
"SMPL++/src/smpl/*.c"
"SMPL++/src/smpl/*.cpp"
)
##
## INCLUDE DIRECTORIES
##
set(SMPLXX_INCLUDE_DIRS
"SMPL++/include"
)
set(PROJECT_INCLUDE_DIRS
${SMPLXX_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${xtensor_INCLUDE_DIRS}
${TORCH_INCLUDE_DIRS}
)
# message("----- Include Paths -----")
# message("SMPL++: ${SMPLXX_INCLUDE_DIRS}")
# message("xtensor: ${xtensor_INCLUDE_DIRS}")
# message("Torch: ${TORCH_INCLUDE_DIRS}")
# message("-------------------------------")
##
## LIBRARIES
##
set(PROJECT_LIBRARIES
xtensor
${xtensor_blas_LIBRARIES}
nlohmann_json::nlohmann_json
${TORCH_LIBRARIES}
stdc++fs # std::experimental::filesystem
)
# message("----- Libraries Paths -----")
# message("Torch: ${TORCH_LIBRARIES}")
# message("-------------------------------")
##
## OUTPUTS
##
add_executable(smplpp ${HEADER} ${SOURCE})
target_include_directories(smplpp PRIVATE ${PROJECT_INCLUDE_DIRS})
target_link_libraries(smplpp ${PROJECT_LIBRARIES})