]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - radiant/CMakeLists.txt
Merge branch 'NateEag-master-patch-12920' into 'master'
[xonotic/netradiant.git] / radiant / CMakeLists.txt
1 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
2
3 find_package(OpenGL REQUIRED)
4
5 string(SUBSTRING ${CMAKE_SHARED_MODULE_SUFFIX} 1 -1 _clibext)
6 add_definitions(-DCMAKE_SHARED_MODULE_SUFFIX="${_clibext}")
7 unset(_clibext)
8
9 set(RADIANTLIST
10     autosave.cpp autosave.h
11     brush.cpp brush.h
12     brush_primit.cpp brush_primit.h
13     brushmanip.cpp brushmanip.h
14     brushmodule.cpp brushmodule.h
15     brushnode.cpp brushnode.h
16     brushtokens.cpp brushtokens.h
17     brushxml.cpp brushxml.h
18     build.cpp build.h
19     camwindow.cpp camwindow.h
20     clippertool.cpp clippertool.h
21     commands.cpp commands.h
22     console.cpp console.h
23     csg.cpp csg.h
24     dialog.cpp dialog.h
25     eclass.cpp eclass.h
26     eclass_def.cpp eclass_def.h
27     eclass_doom3.cpp eclass_doom3.h
28     eclass_fgd.cpp eclass_fgd.h
29     eclass_xml.cpp eclass_xml.h
30     entity.cpp entity.h
31     entityinspector.cpp entityinspector.h
32     entitylist.cpp entitylist.h
33     environment.cpp environment.h
34     error.cpp error.h
35     feedback.cpp feedback.h
36     filetypes.cpp filetypes.h
37     filters.cpp filters.h
38     findtexturedialog.cpp findtexturedialog.h
39     grid.cpp grid.h
40     groupdialog.cpp groupdialog.h
41     gtkdlgs.cpp gtkdlgs.h
42     gtkmisc.cpp gtkmisc.h
43     help.cpp help.h
44     image.cpp image.h
45     main.cpp main.h
46     mainframe.cpp mainframe.h
47     map.cpp map.h
48     mru.cpp mru.h
49     nullmodel.cpp nullmodel.h
50     parse.cpp parse.h
51     patch.cpp patch.h
52     patchdialog.cpp patchdialog.h
53     patchmanip.cpp patchmanip.h
54     patchmodule.cpp patchmodule.h
55     plugin.cpp plugin.h
56     pluginapi.cpp pluginapi.h
57     pluginmanager.cpp pluginmanager.h
58     pluginmenu.cpp pluginmenu.h
59     plugintoolbar.cpp plugintoolbar.h
60     points.cpp points.h
61     preferencedictionary.cpp preferencedictionary.h
62     preferences.cpp preferences.h
63     qe3.cpp qe3.h
64     qgl.cpp qgl.h
65     referencecache.cpp referencecache.h
66     renderer.cpp renderer.h
67     renderstate.cpp renderstate.h
68     resource.h
69     scenegraph.cpp scenegraph.h
70     select.cpp select.h
71     selection.cpp selection.h
72     server.cpp server.h
73     shaders.cpp shaders.h
74     sockets.cpp sockets.h
75     stacktrace.cpp stacktrace.h
76     surfacedialog.cpp surfacedialog.h
77     texmanip.cpp texmanip.h
78     textureentry.cpp textureentry.h
79     textures.cpp textures.h
80     texwindow.cpp texwindow.h
81     timer.cpp timer.h
82     treemodel.cpp treemodel.h
83     undo.cpp undo.h
84     url.cpp url.h
85     view.cpp view.h
86     watchbsp.cpp watchbsp.h
87     winding.cpp winding.h
88     windowobservers.cpp windowobservers.h
89     xmlstuff.cpp xmlstuff.h
90     xywindow.cpp xywindow.h
91 )
92
93 if (WIN32)
94     list(APPEND RADIANTLIST multimon.cpp multimon.h)
95 endif ()
96
97 radiant_tool(${RADIANT_BASENAME} WIN32 radiant.rc ${RADIANTLIST})
98 add_dependencies(${RADIANT_BASENAME} modules)
99 target_link_libraries(${RADIANT_BASENAME}
100     ${CMAKE_DL_LIBS}
101     ${LIBXML2_LIBRARIES}
102     ${OPENGL_gl_LIBRARY}
103     ${GTK${GTK_TARGET}_LIBRARIES}
104     ${GTKGL_LIBRARIES}
105     includes
106     cmdlib
107     container
108     ddslib
109     debugging
110     etclib
111     filematch
112     generic
113     l_net
114     math
115     mathlib
116     memory
117     modulesystem
118     os
119     picomodel
120     profile
121     script
122     signal
123     splines
124     stream
125     string
126     transformpath
127     uilib
128     xmllib
129 )
130
131 if (X11_LIBRARIES)
132     target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES})
133 endif ()
134
135 # PIE executables were wrongly recognized as shared libraries on Linux
136 # because of a mistake in the mime-type library.
137 # Because of that it was not possible to launch such executables from
138 # the file browser.
139 #
140 # While the problem is fixed upstream, most distributions still ship
141 # with a faulty mime-type library and may do for a long time.
142 #
143 # See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11
144 #
145 # It may produce such warning though at strip time:
146 #   warning: allocated section `.dynstr' not in segment
147 # and produce an unusable binary, better not strip when using this hack.
148 #
149 # This hack is only wanted for release build and
150 # when NetRadiant is not installed system-wide.
151 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"
152     AND "${CMAKE_BUILD_TYPE}" STREQUAL "Release"
153     AND NOT FHS_INSTALL)
154     target_link_libraries(${RADIANT_BASENAME} -no-pie)
155 endif()
156
157 copy_dlls(${RADIANT_BASENAME})