-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·77 lines (67 loc) · 1.98 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
cmake_minimum_required(VERSION 3.14)
project(DRMSimulationModel
VERSION 1.0
LANGUAGES CXX)
set(USE_POLYSCOPE false)
#Download external dependencies
include(FetchContent)
if(${USE_POLYSCOPE})
add_compile_definitions(POLYSCOPE_DEFINED)
##polyscope
FetchContent_Declare(polyscope
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
GIT_TAG master
)
FetchContent_MakeAvailable(polyscope)
endif()
##vcglib devel branch
FetchContent_Declare(vcglib
GIT_REPOSITORY https://gitea-s2i2s.isti.cnr.it/manolas/vcglib.git
GIT_TAG devel
)
FetchContent_MakeAvailable(vcglib)
##matplot++ lib
FetchContent_Declare(matplot
GIT_REPOSITORY https://github.com/alandefreitas/matplotplusplus
GIT_TAG master
)
FetchContent_MakeAvailable(matplot)
if(UNIX AND NOT APPLE)
set(TBB_BUILD_SHARED ON)
set(TBB_BUILD_STATIC OFF)
set(TBB_BUILD_TBBMALLOC OFF)
set(TBB_BUILD_TBBMALLOC_PROXY OFF)
set(TBB_BUILD_TESTS OFF)
set(TBB_NO_DATE OFF)
set(TBB_BUILD_PYTHON OFF)
set(TBB_SET_SOVERSION OFF)
set(TBB_BUILD_TESTS OFF)
FetchContent_Declare(tbb
GIT_REPOSITORY https://github.com/wjakob/tbb.git
GIT_TAG master
)
FetchContent_MakeAvailable(tbb)
endif()
##Eigen3
FetchContent_Declare(eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG master
)
set(EIGEN_BUILD_DOC OFF)
set(BUILD_TESTING OFF)
set(EIGEN_BUILD_PKGCONFIG OFF)
FetchContent_MakeAvailable(eigen)
find_package(Eigen3 3.4 REQUIRED)
if(MSVC)
add_compile_definitions(_HAS_STD_BYTE=0)
endif(MSVC)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
if(${PROJECT_IS_TOP_LEVEL})
set(SHOULD_BUILD_DEMO true)
else()
set(SHOULD_BUILD_DEMO false)
endif()
if(${SHOULD_BUILD_DEMO})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/demo)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests/)
endif()