-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
83 lines (65 loc) · 1.83 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
cmake_minimum_required(VERSION 2.8)
project(tristripper)
set(MAJOR_VERSION "1")
set(MINOR_VERSION "10")
option(TRISTRIPPER_BUILD_TEST "Build test program (not fully tested on all platforms)." "0")
option(TRISTRIPPER_BUILD_SHARED_LIB "Build tristripper as a shared library (overrides BUILD_SHARED_LIBS)." "0")
if(UNIX)
add_definitions("-DUNIX")
endif()
###############################################
# library settings
###############################################
include_directories("include")
if(TRISTRIPPER_BUILD_SHARED_LIB)
set(BUILD_SHARED_LIBS ${TRISTRIPPER_BUILD_SHARED_LIB})
endif()
add_library(tristripper
src/connectivity_graph.cpp
src/policy.cpp
src/tri_stripper.cpp
)
set_target_properties(tristripper
PROPERTIES
SOVERSION "${MAJOR_VERSION}"
VERSION "${MAJOR_VERSION}.${MINOR_VERSION}"
)
install(TARGETS tristripper DESTINATION lib LIBRARY)
install(FILES
include/public_types.h
include/tri_stripper.h
DESTINATION include)
install(FILES
include/detail/cache_simulator.h
include/detail/connectivity_graph.h
include/detail/graph_array.h
include/detail/heap_array.h
include/detail/policy.h
include/detail/types.h
DESTINATION include/detail
)
###############################################
# test program settings
###############################################
if(TRISTRIPPER_BUILD_TEST)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/test/models" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
include_directories(
"test"
${OPENGL_INCLUDE_DIR}
${GLUT_INCLUDE_DIR})
add_executable(test
test/gl_mesh.cpp
test/gl_model.cpp
test/gl_renderer.cpp
test/high_res_timer.cpp
test/main.cpp
test/varrays_normalizer.cpp
)
target_link_libraries(test
tristripper
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)
endif()