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