cmake: build quake2 and heretic2 tools to be on par with legacy Makefile
[xonotic/netradiant.git] / tools / quake2 / CMakeLists.txt
1 include_directories(BEFORE common)
2
3 find_package(LibXml2 REQUIRED)
4 include_directories(${LIBXML2_INCLUDE_DIR})
5
6 radiant_tool(q2map
7     WIN32 q2map/q2map.rc
8
9     common/bspfile.c common/bspfile.h
10     common/cmdlib.c common/cmdlib.h
11     common/inout.c common/inout.h
12     common/l3dslib.c common/l3dslib.h
13     common/lbmlib.c common/lbmlib.h
14     common/mathlib.c common/mathlib.h
15     common/md4.c common/md4.h
16     common/path_init.c
17     common/qfiles.h
18     common/polylib.c common/polylib.h
19     common/scriplib.c common/scriplib.h
20     common/threads.c common/q2_threads.h
21     common/trilib.c common/trilib.h
22     
23     q2map/brushbsp.c
24     q2map/csg.c
25     q2map/faces.c
26     q2map/flow.c
27 #   q2map/gldraw.c
28     q2map/glfile.c
29     q2map/leakfile.c
30     q2map/lightmap.c
31     q2map/main.c q2map/q2map.h
32     q2map/map.c
33     q2map/nodraw.c
34     q2map/patches.c
35     q2map/portals.c
36     q2map/prtfile.c
37     q2map/qbsp.c
38     q2map/qbsp.h
39     q2map/qrad.c
40     q2map/qrad.h
41     q2map/qvis.c
42     q2map/qvis.h
43     q2map/textures.c
44     q2map/trace.c
45     q2map/tree.c
46     q2map/writebsp.c
47 )
48
49 target_compile_definitions(q2map
50     PRIVATE
51 )
52
53 target_link_libraries(q2map
54     ${LIBXML2_LIBRARIES}
55     l_net
56 )
57
58 radiant_tool(qdata3
59     WIN32 qdata/qdata.rc
60
61     common/bspfile.c common/bspfile.h
62     common/cmdlib.c common/cmdlib.h
63     common/inout.c common/inout.h
64     common/l3dslib.c common/l3dslib.h
65     common/lbmlib.c common/lbmlib.h
66     common/mathlib.c common/mathlib.h
67     common/md4.c common/md4.h
68     common/path_init.c
69     common/qfiles.h
70     common/polylib.c common/polylib.h
71     common/scriplib.c common/scriplib.h
72     common/threads.c common/q2_threads.h
73     common/trilib.c common/trilib.h
74
75     qdata/anorms.h
76     qdata/images.c
77     qdata/models.c
78     qdata/qdata.c qdata/qdata.h
79     qdata/sprites.c
80     qdata/tables.c
81     qdata/video.c
82 )
83
84 target_compile_definitions(qdata3
85     PRIVATE
86 )
87
88 target_link_libraries(qdata3
89     ${LIBXML2_LIBRARIES}
90     l_net
91 )
92
93 add_custom_target(quake2)
94 add_dependencies(quake2 q2map qdata3)
95
96 if (UNIX)
97     target_link_libraries(q2map pthread m)
98     target_link_libraries(qdata3 pthread m)
99 endif ()