-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
146 lines (115 loc) · 4.18 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#=============================================================================
# CMake configuration file for ImplicitBeamsGPU
#=============================================================================
# Minimum version of CMake required.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# Set the name of your project
PROJECT(DanVI)
# Include macros from the SBEL utils library
INCLUDE(SBELUtils.cmake)
# ------------------------------------------------------------------------------
# Specify output locations for libraries and executables
# ------------------------------------------------------------------------------
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
IF (MSVC OR XCODE_VERSION)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
ENDIF()
# ----------------------------------------------------------------------------
# Require CUSP (headers-only library)
SET(CUSP_INC_DIR "" CACHE PATH "Where is the CUSP include directory?")
INCLUDE_DIRECTORIES(${CUSP_INC_DIR})
# ----------------------------------------------------------------------------
# Require SPIKE (headers-only library)
SET(SPIKE_INC_DIR "" CACHE PATH "Where is the SPIKE include directory?")
INCLUDE_DIRECTORIES(${SPIKE_INC_DIR})
# ----------------------------------------------------------------------------
# Require OpenMP (?)
enable_openmp_support()
# ----------------------------------------------------------------------------
# If the CUDA_SDK_ROOT_DIR is defined
IF (CUDA_SDK_ROOT_DIR)
INCLUDE_DIRECTORIES(${CUDA_SDK_ROOT_DIR}/common/inc)
INCLUDE_DIRECTORIES(${CUDA_SDK_ROOT_DIR}/../shared/inc)
ADD_DEFINITIONS(-DWITH_CUDA_SDK)
ENDIF()
# ----------------------------------------------------------------------------
# Include OpenGL support
#freeglut is not found properly on windows
IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
SET(FREEGLUT_LIB_PATH "" CACHE PATH "Where is freeglut located?")
SET(FREEGLUT_INC_PATH "" CACHE PATH "Where are the freeglut headers located" )
FIND_LIBRARY( FREEGLUT_LIB NAMES glut glut32 freeglut PATHS ${FREEGLUT_LIB_PATH})
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(FREEGLUT_LIB_PATH "/opt/X11/lib/")
SET(FREEGLUT_INC_PATH "/opt/X11/include/")
FIND_LIBRARY( FREEGLUT_LIB NAMES glut glut32 freeglut PATHS ${FREEGLUT_LIB_PATH})
ELSE()
FIND_PACKAGE("GLUT")
FIND_PACKAGE("OpenGL")
ENDIF()
#MARK_AS_ADVANCED(FORCE FREEGLUT_LIB)
# If GLUT was found, define the macro WITH_GLUT
IF (FREEGLUT_LIB)
INCLUDE_DIRECTORIES(${FREEGLUT_INC_PATH})
ADD_DEFINITIONS(-DWITH_GLUT)
ENDIF()
IF (${GLUT_FOUND})
ADD_DEFINITIONS(-DWITH_GLUT)
ENDIF()
# ----------------------------------------------------------------------------
# Enable CUDA support
enable_cuda_support()
# ----------------------------------------------------------------------------
# List the files that make up the ImplicitBeamsGPU library
SET(IBEAMS_SOURCES
src/DanVIApi.h
src/include.cuh
src/System.cuh
src/System.cu
src/SystemElastic.cu
src/PhysicsItem.cuh
src/Body.cuh
src/Beam.cuh
src/Beam.cu
src/Plate.cuh
src/Plate.cu
src/Body2D.cuh
src/Body2D.cu
src/CollisionDetector.cuh
src/CollisionDetector.cu
src/Solver.cuh
src/APGD.cuh
src/APGD.cu
src/PDIP.cuh
src/PDIP.cu
src/TPAS.cuh
src/TPAS.cu
src/JKIP.cuh
src/JKIP.cu
src/PJKIP.cuh
src/PJKIP.cu
src/PGJ.cuh
src/PGJ.cu
src/PGS.cuh
src/PGS.cu
)
SOURCE_GROUP(src FILES ${IBEAMS_SOURCES})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
# ----------------------------------------------------------------------------
# Add the ImplicitBeamsGPU library
CUDA_ADD_LIBRARY(ImplicitBeamsGPU STATIC ${IBEAMS_SOURCES})
TARGET_LINK_LIBRARIES(ImplicitBeamsGPU
${GLUT_LIBRARIES}
${FREEGLUT_LIB}
${OPENGL_LIBRARIES}
)
SET_TARGET_PROPERTIES(ImplicitBeamsGPU PROPERTIES COMPILE_DEFINITIONS "IBEAMS_COMPILE_LIBRARY")
INSTALL(TARGETS ImplicitBeamsGPU
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
# ----------------------------------------------------------------------------
# Add the models
ADD_SUBDIRECTORY(models)