summaryrefslogtreecommitdiff
path: root/src/samples/CMakeLists.txt
blob: 3ac7771eadf50b3e6c6169c601fa1665eba42c13 (plain)
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
include_directories (
	${mesademos_SOURCE_DIR}/src/util
	${OPENGL_INCLUDE_PATH}
	${GLUT_INCLUDE_DIR}
	${GLEW_INCLUDE_DIR}
)

link_directories (
	${mesademos_SOURCE_DIR}/src/util
)

link_libraries (
	util
	${OPENGL_gl_LIBRARY}
	${OPENGL_glu_LIBRARY}
	${GLUT_glut_LIBRARY}
	${GLEW_glew_LIBRARY}
)

set (subdir samples)

set (targets
	accum
	bitmap1
	bitmap2
	blendeq
	blendxor
	copy
	cursor
	depth
	eval
	fog
	font
	line
	logo
	nurb
	olympic
	overlay
	point
	prim
	quad
	rgbtoppm
	select
	shape
	sphere
	star
	stencil
	stretch
	texture
	tri
	wave
)

foreach (target ${targets})
	add_executable (${subdir}_${target} ${target}.c)
	set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
	install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)

if (X11_FOUND)
	include_directories (
		${X11_INCLUDE_DIR}
	)

	link_libraries (
		${X11_Xext_LIB}
		${X11_X11_LIB}
	)

	set (xtargets
		oglinfo
	)

	foreach (xtarget ${xtargets})
		add_executable (${xtarget} ${xtarget}.c)
	endforeach (xtarget)

	install (TARGETS ${xtargets} DESTINATION ${subdir})
endif (X11_FOUND)