]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - tools/quake3/CMakeLists.txt
cmake: do not use WIN32 for console tools
[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(WebP REQUIRED)
26 include_directories(${WEBP_INCLUDE_DIR})
27
28 find_package(LibXml2 REQUIRED)
29 include_directories(${LIBXML2_INCLUDE_DIR})
30
31 find_package(ZLIB REQUIRED)
32 include_directories(${ZLIB_INCLUDE_DIRS})
33
34 find_package(Minizip REQUIRED)
35 include_directories(${Minizip_INCLUDE_DIRS})
36
37 include_directories(${CMAKE_SOURCE_DIR}/libs/crnrgba)
38
39 set(q3map2_games
40         q3map2/game_darkplaces.h
41         q3map2/game_dq.h
42         q3map2/game_ef.h
43         q3map2/game_etut.h
44         q3map2/game_ja.h
45         q3map2/game_jk2.h
46         q3map2/game_nexuiz.h
47         q3map2/game_prophecy.h
48         q3map2/game_qfusion.h
49         q3map2/game_quake3.h
50         q3map2/game_quakelive.h
51         q3map2/game_reaction.h
52         q3map2/game_smokinguns.h
53         q3map2/game_sof2.h
54         q3map2/game_tenebrae.h
55         q3map2/game_tremulous.h
56         q3map2/game_unvanquished.h
57         q3map2/game_wolf.h
58         q3map2/game_wolfet.h
59         q3map2/game_xonotic.h
60         )
61
62 radiant_tool(q3map2
63         q3map2/q3map2.rc
64
65         common/cmdlib.c common/cmdlib.h
66         common/imagelib.c common/imagelib.h
67         common/inout.c common/inout.h
68         common/jpeg.c
69         common/md4.c common/md4.h
70         common/mutex.c common/mutex.h
71         common/polylib.c common/polylib.h
72         common/polyset.h
73         common/qfiles.h
74         common/qthreads.h
75         common/scriplib.c common/scriplib.h
76         common/surfaceflags.h
77         common/threads.c
78         common/vfs.c common/vfs.h
79
80         q3map2/brush.c
81         q3map2/brush_primit.c
82         q3map2/bsp.c
83         q3map2/bsp_analyze.c
84         q3map2/bsp_info.c
85         q3map2/bsp_scale.c
86         q3map2/bspfile_abstract.c
87         q3map2/bspfile_ibsp.c
88         q3map2/bspfile_rbsp.c
89         q3map2/convert_ase.c
90         q3map2/convert_bsp.c
91         q3map2/convert_map.c
92         q3map2/convert_obj.c
93         q3map2/decals.c
94         q3map2/exportents.c
95         q3map2/facebsp.c
96         q3map2/fixaas.c
97         q3map2/fog.c
98         ${q3map2_games} q3map2/game__null.h
99         q3map2/help.c
100         q3map2/image.c
101         q3map2/leakfile.c
102         q3map2/light.c
103         q3map2/light_bounce.c
104         q3map2/light_trace.c
105         q3map2/light_ydnar.c
106         q3map2/lightmaps_ydnar.c
107         q3map2/main.c
108         q3map2/map.c
109         q3map2/mesh.c
110         q3map2/minimap.c
111         q3map2/model.c
112         q3map2/patch.c
113         q3map2/path_init.c
114         q3map2/portals.c
115         q3map2/prtfile.c
116         q3map2/q3map2.h
117         q3map2/shaders.c
118         q3map2/surface.c
119         q3map2/surface_extra.c
120         q3map2/surface_foliage.c
121         q3map2/surface_fur.c
122         q3map2/surface_meta.c
123         q3map2/tjunction.c
124         q3map2/tree.c
125         q3map2/vis.c
126         q3map2/visflow.c
127         q3map2/writebsp.c
128         )
129
130 if (BUILD_CRUNCH)
131         set(OPTIONAL_IMAGE_LIBRARIES crnrgba)
132         set(OPTIONAL_IMAGE_DEFINES BUILD_CRUNCH=1)
133 endif ()
134
135 target_compile_definitions(q3map2
136         PRIVATE
137         ${OPTIONAL_IMAGE_DEFINES}
138         )
139
140 target_link_libraries(q3map2
141         ${GLIB_LIBRARIES}
142         ${JPEG_LIBRARIES}
143         ${PNG_LIBRARIES}
144         ${WEBP_LIBRARIES}
145         ${LIBXML2_LIBRARIES}
146         ${Minizip_LIBRARIES}
147         ${ZLIB_LIBRARIES}
148         ${OPTIONAL_IMAGE_LIBRARIES}
149         ddslib
150         etclib
151         filematch
152         l_net
153         mathlib
154         picomodel
155         )
156
157 radiant_tool(q3data
158         q3data/q3data.rc
159
160         common/aselib.c common/aselib.h
161         common/bspfile.c common/bspfile.h
162         common/cmdlib.c common/cmdlib.h
163         common/imagelib.c common/imagelib.h
164         common/inout.c common/inout.h
165         common/md4.c common/md4.h
166         common/scriplib.c common/scriplib.h
167         common/trilib.c common/trilib.h
168         common/vfs.c common/vfs.h
169
170         q3data/3dslib.c q3data/3dslib.h
171         q3data/compress.c
172         q3data/images.c
173         q3data/md3lib.c q3data/md3lib.h
174         q3data/models.c
175         q3data/p3dlib.c q3data/p3dlib.h
176         q3data/polyset.c
177         q3data/q3data.c q3data/q3data.h
178         q3data/stripper.c
179         q3data/video.c
180         )
181
182 target_link_libraries(q3data
183         ${GLIB_LIBRARIES}
184         ${LIBXML2_LIBRARIES}
185         ${Minizip_LIBRARIES}
186         ${ZLIB_LIBRARIES}
187         filematch
188         etclib
189         l_net
190         mathlib
191         )
192
193 add_custom_target(quake3)
194 add_dependencies(quake3 q3map2 q3data)
195
196 if (UNIX)
197     target_link_libraries(q3map2 pthread m)
198     target_link_libraries(q3data m)
199 endif ()