]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/CMakeLists.txt
Merge commit 'ff48e71434a414958e6e56628ccf04284d030784' into master-merge
[xonotic/netradiant.git] / radiant / CMakeLists.txt
index 1edced736eade534b52a073ac430bd96d805b16d..ae33bcea7dd884f5b0babe17e55691a6b323517b 100644 (file)
@@ -37,11 +37,11 @@ set(RADIANTLIST
     filterbar.cpp filterbar.h
     filters.cpp filters.h
     findtexturedialog.cpp findtexturedialog.h
-    glwidget.cpp glwidget.h
     grid.cpp grid.h
     groupdialog.cpp groupdialog.h
     gtkdlgs.cpp gtkdlgs.h
     gtkmisc.cpp gtkmisc.h
+       gtktheme.cpp gtktheme.h
     help.cpp help.h
     image.cpp image.h
     main.cpp main.h
@@ -91,13 +91,14 @@ set(RADIANTLIST
     xmlstuff.cpp xmlstuff.h
     xywindow.cpp xywindow.h
 )
+
 if (WIN32)
     list(APPEND RADIANTLIST multimon.cpp multimon.h)
-endif()
+endif ()
 
-radiant_tool(radiant WIN32 radiant.rc ${RADIANTLIST})
-add_dependencies(radiant modules)
-target_link_libraries(radiant
+radiant_tool(${RADIANT_BASENAME} WIN32 radiant.rc ${RADIANTLIST})
+add_dependencies(${RADIANT_BASENAME} modules)
+target_link_libraries(${RADIANT_BASENAME}
     ${CMAKE_DL_LIBS}
     ${LIBXML2_LIBRARIES}
     ${OPENGL_gl_LIBRARY}
@@ -124,11 +125,35 @@ target_link_libraries(radiant
     splines
     stream
     string
+    transformpath
     uilib
     xmllib
 )
+
 if (X11_LIBRARIES)
-    target_link_libraries(radiant ${X11_LIBRARIES})
+    target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES})
 endif ()
 
-copy_dlls(radiant)
+# PIE executables were wrongly recognized as shared libraries on Linux
+# because of a mistake in the mime-type library.
+# Because of that it was not possible to launch such executables from
+# the file browser.
+#
+# While the problem is fixed upstream, most distributions still ship
+# with a faulty mime-type library and may do for a long time.
+#
+# See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11
+#
+# It may produce such warning though at strip time:
+#   warning: allocated section `.dynstr' not in segment
+# and produce an unusable binary, better not strip when using this hack.
+#
+# This hack is only wanted for release build and
+# when NetRadiant is not installed system-wide.
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"
+    AND "${CMAKE_BUILD_TYPE}" STREQUAL "Release"
+    AND NOT FHS_INSTALL)
+    target_link_libraries(${RADIANT_BASENAME} -no-pie)
+endif()
+
+copy_dlls(${RADIANT_BASENAME})