]> git.xonotic.org Git - xonotic/netradiant.git/blob - tools/quake3/CMakeLists.txt
make crunch a submodule
[xonotic/netradiant.git] / tools / quake3 / CMakeLists.txt
1 include_directories(BEFORE common)
2
3 set(Q3MAP_VERSION 2.5.17n)
4 find_package(Git REQUIRED)
5 execute_process(
6         COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
7         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
8         OUTPUT_VARIABLE GIT_VERSION
9         OUTPUT_STRIP_TRAILING_WHITESPACE
10 )
11 if (GIT_VERSION)
12     set(Q3MAP_VERSION "${Q3MAP_VERSION}-git-${GIT_VERSION}")
13 endif ()
14 add_definitions(-DQ3MAP_VERSION="${Q3MAP_VERSION}")
15
16 find_package(GLIB REQUIRED)
17 include_directories(${GLIB_INCLUDE_DIRS})
18
19 find_package(JPEG REQUIRED)
20 include_directories(${JPEG_INCLUDE_DIR})
21
22 find_package(PNG REQUIRED)
23 include_directories(${PNG_INCLUDE_DIR})
24
25 find_package(LibXml2 REQUIRED)
26 include_directories(${LIBXML2_INCLUDE_DIR})
27
28 find_package(ZLIB REQUIRED)
29 include_directories(${ZLIB_INCLUDE_DIRS})
30
31 find_package(Minizip REQUIRED)
32 include_directories(${Minizip_INCLUDE_DIRS})
33
34 include_directories(${CMAKE_SOURCE_DIR}/libs/crnrgba)
35
36 set(q3map2_games
37         q3map2/game_darkplaces.h
38         q3map2/game_dq.h
39         q3map2/game_ef.h
40         q3map2/game_etut.h
41         q3map2/game_ja.h
42         q3map2/game_jk2.h
43         q3map2/game_nexuiz.h
44         q3map2/game_prophecy.h
45         q3map2/game_qfusion.h
46         q3map2/game_quake3.h
47         q3map2/game_quakelive.h
48         q3map2/game_reaction.h
49         q3map2/game_sof2.h
50         q3map2/game_tenebrae.h
51         q3map2/game_tremulous.h
52         q3map2/game_unvanquished.h
53         q3map2/game_wolf.h
54         q3map2/game_wolfet.h
55         q3map2/game_xonotic.h
56         )
57
58 radiant_tool(q3map2
59         common/cmdlib.c common/cmdlib.h
60         common/imagelib.c common/imagelib.h
61         common/inout.c common/inout.h
62         common/jpeg.c
63         common/md4.c common/md4.h
64         common/mutex.c common/mutex.h
65         common/polylib.c common/polylib.h
66         common/polyset.h
67         common/qfiles.h
68         common/qthreads.h
69         common/scriplib.c common/scriplib.h
70         common/surfaceflags.h
71         common/threads.c
72         common/vfs.c common/vfs.h
73
74         q3map2/brush.c
75         q3map2/brush_primit.c
76         q3map2/bsp.c
77         q3map2/bsp_analyze.c
78         q3map2/bsp_info.c
79         q3map2/bsp_scale.c
80         q3map2/bspfile_abstract.c
81         q3map2/bspfile_ibsp.c
82         q3map2/bspfile_rbsp.c
83         q3map2/convert_ase.c
84         q3map2/convert_bsp.c
85         q3map2/convert_map.c
86         q3map2/convert_obj.c
87         q3map2/decals.c
88         q3map2/exportents.c
89         q3map2/facebsp.c
90         q3map2/fixaas.c
91         q3map2/fog.c
92         ${q3map2_games} q3map2/game__null.h
93         q3map2/help.c
94         q3map2/image.c
95         q3map2/leakfile.c
96         q3map2/light.c
97         q3map2/light_bounce.c
98         q3map2/light_trace.c
99         q3map2/light_ydnar.c
100         q3map2/lightmaps_ydnar.c
101         q3map2/main.c
102         q3map2/map.c
103         q3map2/mesh.c
104         q3map2/minimap.c
105         q3map2/model.c
106         q3map2/patch.c
107         q3map2/path_init.c
108         q3map2/portals.c
109         q3map2/prtfile.c
110         q3map2/q3map2.h
111         q3map2/shaders.c
112         q3map2/surface.c
113         q3map2/surface_extra.c
114         q3map2/surface_foliage.c
115         q3map2/surface_fur.c
116         q3map2/surface_meta.c
117         q3map2/tjunction.c
118         q3map2/tree.c
119         q3map2/vis.c
120         q3map2/visflow.c
121         q3map2/writebsp.c
122         )
123
124 target_link_libraries(q3map2
125         ${GLIB_LIBRARIES}
126         ${JPEG_LIBRARIES}
127         ${PNG_LIBRARIES}
128         ${LIBXML2_LIBRARIES}
129         ${Minizip_LIBRARIES}
130         ${ZLIB_LIBRARIES}
131         crnrgba
132         ddslib
133         etclib
134         filematch
135         l_net
136         mathlib
137         picomodel
138         )
139
140 radiant_tool(q3data
141         common/aselib.c common/aselib.h
142         common/bspfile.c common/bspfile.h
143         common/cmdlib.c common/cmdlib.h
144         common/imagelib.c common/imagelib.h
145         common/inout.c common/inout.h
146         common/md4.c common/md4.h
147         common/scriplib.c common/scriplib.h
148         common/trilib.c common/trilib.h
149         common/vfs.c common/vfs.h
150
151         q3data/3dslib.c q3data/3dslib.h
152         q3data/compress.c
153         q3data/images.c
154         q3data/md3lib.c q3data/md3lib.h
155         q3data/models.c
156         q3data/p3dlib.c q3data/p3dlib.h
157         q3data/polyset.c
158         q3data/q3data.c q3data/q3data.h
159         q3data/stripper.c
160         q3data/video.c
161         )
162
163 target_link_libraries(q3data
164         ${GLIB_LIBRARIES}
165         ${LIBXML2_LIBRARIES}
166         ${Minizip_LIBRARIES}
167         ${ZLIB_LIBRARIES}
168         filematch
169         etclib
170         l_net
171         mathlib
172         )
173
174 add_custom_target(quake3)
175 add_dependencies(quake3 q3map2 q3data)
176
177 if (UNIX)
178     target_link_libraries(q3map2 pthread m)
179     target_link_libraries(q3data m)
180 endif ()