-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
66 lines (53 loc) · 1.58 KB
/
Copy pathCMakeLists.txt
File metadata and controls
66 lines (53 loc) · 1.58 KB
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
cmake_minimum_required(VERSION 3.10.0)
project(fast-mass-spring)
set(Sources
ClothApp/app.cpp
ClothApp/MassSpringSolver.cpp
ClothApp/Mesh.cpp
ClothApp/Renderer.cpp
ClothApp/Shader.cpp
ClothApp/UserInteraction.cpp
)
# find OpenGL, GLUT, GLEW
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(GLEW REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS})
# add Eigen, OpenMesh, glm
include(FetchContent)
FetchContent_Declare(
openmesh
GIT_REPOSITORY https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh.git
)
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
)
FetchContent_Declare(
glm
GIT_REPOSITORY https://github.com/g-truc/glm
)
FetchContent_GetProperties(openmesh)
if(NOT openmesh_POPULATED)
FetchContent_Populate(openmesh)
add_subdirectory(${openmesh_SOURCE_DIR} ${openmesh_BINARY_DIR})
endif()
FetchContent_GetProperties(eigen)
if(NOT eigen_POPULATED)
FetchContent_Populate(eigen)
add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR})
endif()
FetchContent_GetProperties(glm)
if(NOT glm_POPULATED)
FetchContent_Populate(glm)
add_subdirectory(${glm_SOURCE_DIR} ${glm_BINARY_DIR})
endif()
# needed for OpenMesh on Windows
if(WIN32)
add_definitions(-D_USE_MATH_DEFINES)
endif()
# copy shaders to binary directory
file(INSTALL ClothApp/shaders/ DESTINATION shaders/)
# create executable
add_executable(fast-mass-spring ${Sources})
target_link_libraries(fast-mass-spring ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${GLEW_LIBRARIES} OpenMeshCore eigen glm)