]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - radiant/CMakeLists.txt
Merge commit 'ff48e71434a414958e6e56628ccf04284d030784' into master-merge
[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     filterbar.cpp filterbar.h
38     filters.cpp filters.h
39     findtexturedialog.cpp findtexturedialog.h
40     grid.cpp grid.h
41     groupdialog.cpp groupdialog.h
42     gtkdlgs.cpp gtkdlgs.h
43     gtkmisc.cpp gtkmisc.h
44         gtktheme.cpp gtktheme.h
45     help.cpp help.h
46     image.cpp image.h
47     main.cpp main.h
48     mainframe.cpp mainframe.h
49     map.cpp map.h
50     mru.cpp mru.h
51     nullmodel.cpp nullmodel.h
52     parse.cpp parse.h
53     patch.cpp patch.h
54     patchdialog.cpp patchdialog.h
55     patchmanip.cpp patchmanip.h
56     patchmodule.cpp patchmodule.h
57     plugin.cpp plugin.h
58     pluginapi.cpp pluginapi.h
59     pluginmanager.cpp pluginmanager.h
60     pluginmenu.cpp pluginmenu.h
61     plugintoolbar.cpp plugintoolbar.h
62     points.cpp points.h
63     preferencedictionary.cpp preferencedictionary.h
64     preferences.cpp preferences.h
65     qe3.cpp qe3.h
66     qgl.cpp qgl.h
67     referencecache.cpp referencecache.h
68     renderer.cpp renderer.h
69     renderstate.cpp renderstate.h
70     resource.h
71     scenegraph.cpp scenegraph.h
72     select.cpp select.h
73     selection.cpp selection.h
74     server.cpp server.h
75     shaders.cpp shaders.h
76     sockets.cpp sockets.h
77     stacktrace.cpp stacktrace.h
78     surfacedialog.cpp surfacedialog.h
79     texmanip.cpp texmanip.h
80     textureentry.cpp textureentry.h
81     textures.cpp textures.h
82     texwindow.cpp texwindow.h
83     timer.cpp timer.h
84     treemodel.cpp treemodel.h
85     undo.cpp undo.h
86     url.cpp url.h
87     view.cpp view.h
88     watchbsp.cpp watchbsp.h
89     winding.cpp winding.h
90     windowobservers.cpp windowobservers.h
91     xmlstuff.cpp xmlstuff.h
92     xywindow.cpp xywindow.h
93 )
94
95 if (WIN32)
96     list(APPEND RADIANTLIST multimon.cpp multimon.h)
97 endif ()
98
99 radiant_tool(${RADIANT_BASENAME} WIN32 radiant.rc ${RADIANTLIST})
100 add_dependencies(${RADIANT_BASENAME} modules)
101 target_link_libraries(${RADIANT_BASENAME}
102     ${CMAKE_DL_LIBS}
103     ${LIBXML2_LIBRARIES}
104     ${OPENGL_gl_LIBRARY}
105     ${GTK${GTK_TARGET}_LIBRARIES}
106     ${GTKGL_LIBRARIES}
107     includes
108     cmdlib
109     container
110     ddslib
111     debugging
112     etclib
113     filematch
114     generic
115     l_net
116     math
117     mathlib
118     memory
119     modulesystem
120     os
121     picomodel
122     profile
123     script
124     signal
125     splines
126     stream
127     string
128     transformpath
129     uilib
130     xmllib
131 )
132
133 if (X11_LIBRARIES)
134     target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES})
135 endif ()
136
137 # PIE executables were wrongly recognized as shared libraries on Linux
138 # because of a mistake in the mime-type library.
139 # Because of that it was not possible to launch such executables from
140 # the file browser.
141 #
142 # While the problem is fixed upstream, most distributions still ship
143 # with a faulty mime-type library and may do for a long time.
144 #
145 # See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11
146 #
147 # It may produce such warning though at strip time:
148 #   warning: allocated section `.dynstr' not in segment
149 # and produce an unusable binary, better not strip when using this hack.
150 #
151 # This hack is only wanted for release build and
152 # when NetRadiant is not installed system-wide.
153 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"
154     AND "${CMAKE_BUILD_TYPE}" STREQUAL "Release"
155     AND NOT FHS_INSTALL)
156     target_link_libraries(${RADIANT_BASENAME} -no-pie)
157 endif()
158
159 copy_dlls(${RADIANT_BASENAME})