-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
90 lines (73 loc) · 2.43 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
cmake_minimum_required(VERSION 3.14)
project(embedded_deformation)
# get polyscope
include(FetchContent)
FetchContent_Declare(
polyscope
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
GIT_TAG 56b82cd
SOURCE_DIR "${CMAKE_SOURCE_DIR}/polyscope"
)
FetchContent_GetProperties(polyscope)
if(NOT polyscope_POPULATED)
message("libGraphCpp: fetch polyscope")
FetchContent_Populate(polyscope)
add_subdirectory(polyscope)
endif()
# get utils
include(FetchContent)
FetchContent_Declare(
utils
GIT_REPOSITORY https://github.com/rFalque/utils.git
GIT_TAG 5839d17
SOURCE_DIR "${CMAKE_SOURCE_DIR}/utils"
)
FetchContent_GetProperties(utils)
if(NOT utils_POPULATED)
message("fetch utils")
FetchContent_Populate(utils)
add_subdirectory(utils)
endif()
# get libGraphCpp
FetchContent_Declare(
libGraphCpp
GIT_REPOSITORY https://github.com/rFalque/libGraphCpp.git
GIT_TAG a0369e0
SOURCE_DIR "${CMAKE_SOURCE_DIR}/libGraphCpp"
)
FetchContent_GetProperties(libGraphCpp)
if(NOT libGraphCpp_POPULATED)
message("fetch libGraphCpp")
FetchContent_Populate(libGraphCpp)
add_subdirectory(libGraphCpp)
endif()
add_subdirectory(embedded_deformation)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# specific version of eigen needed
find_package(Eigen3 REQUIRED)
# yaml-cpp if not found, run sudo apt-get install libyaml-cpp-dev
find_package(yaml-cpp REQUIRED)
find_package(Ceres REQUIRED)
file(GLOB_RECURSE my_c_list RELATIVE ${CMAKE_SOURCE_DIR} "app/*")
foreach(file_path ${my_c_list})
string( REPLACE ".cpp" "" new_name ${file_path} )
get_filename_component(filename ${new_name} NAME)
add_executable( ${filename} ${file_path})
set_target_properties(${filename} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES)
include_directories(${filename}
${EIGEN3_INCLUDE_DIR}
${YAML_CPP_INCLUDE_DIR}
${CERES_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
)
target_link_libraries(${filename}
utils
polyscope
libGraphCpp
embedded_deformation
${CERES_LIBRARIES}
yaml-cpp
${PYTHON_LIBRARIES}
)
endforeach()