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