-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
79 lines (69 loc) · 1.48 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
# vim: set noexpandtab:
set(GRAIL_FILES
action_text.cc
actor.cc
animation.cc
area.cc
audio.cc
blit_cached.cc
debug.cc
dialog_line.cc
dialog_frontend.cc
dialog_frontend_subtitle.cc
event.cc
font.cc
game.cc
ground.cc
line.cc
mainloop.cc
polygon.cc
polygon_impl.cc
resource_manager.cc
scene.cc
sdlutils.cc
sound_task.cc
shortcuts.cc
sprite.cc
surface.cc
task.cc
text.cc
unittest.cc
user_interface.cc
user_interface_element.cc
utils.cc
vector2d.cc
viewport.cc
wait_task.cc
)
# Library
add_library(grail SHARED ${GRAIL_FILES})
# Unit tests for library
include_directories(${SDLTTF_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ${BOOST_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}
/usr/local/include/AL # till FindAlure exists
)
add_executable(run_unittests run_unittests.cc vector2d_impl.cc)
set(LIBS
grail
${Boost_LIBRARIES}
${SDLGFX_LIBRARY} ${SDLTTF_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDL_LIBRARY}
${PNG_LIBRARIES}
${LUA_LIBRARIES}
${OPENAL_LIBRARY}
alure #till FindAlure exists
)
if(OPENGL_FOUND)
set(LIBS ${LIBS} ${OPENGL_LIBRARIES})
message("OpenGL found")
message(" Include dir: ${OPENGL_INCLUDE_DIR}")
message(" Libraries: ${OPENGL_LIBRARIES}")
else(OPENGL_FOUND)
message("OpenGL not found, building without!")
endif(OPENGL_FOUND)
target_link_libraries(run_unittests ${LIBS})
execute_process(COMMAND run_unittests)
#enable_testing()
#add_test(
# NAME unittests
# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
# COMMAND run_unittests
#)