cmake: OBJC is not passed to gtkglext build tools
[xonotic/netradiant.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
2
3 project(NetRadiant C CXX)
4
5 #-----------------------------------------------------------------------
6 # Builtins: configuration
7 #-----------------------------------------------------------------------
8
9 set(BUILTINS_INSTALL_DIR "${CMAKE_BINARY_DIR}/builtins")
10 set(BUILTINS_INCLUDE_DIR "${BUILTINS_INSTALL_DIR}/include")
11 set(BUILTINS_LIB_DIR "${BUILTINS_INSTALL_DIR}/lib")
12 set(BUILTINS_PKGCONFIG_DIR "${BUILTINS_INSTALL_DIR}/lib/pkgconfig")
13
14 option(BUILTIN_GTKGLEXT "Builtin GtkGLExt" OFF)
15 option(BUILTIN_GTKTHEME_MOJAVE "Builtin Mojave GTK theme" OFF)
16
17 if (APPLE)
18     set(BUILTIN_GTKGLEXT ON)
19     set(BUILTIN_GTKTHEME_MOJAVE ON)
20 endif ()
21
22 set(BUILTIN_GTKGLEXT_BUILT OFF CACHE INTERNAL "...")
23 if (EXISTS "${BUILTINS_INSTALL_DIR}/lib/pkgconfig/gtkglext-1.0.pc")
24     set(BUILTIN_GTKGLEXT_BUILT ON)
25 endif ()
26
27 if (EXISTS "${BUILTINS_INCLUDE_DIR}")
28     include_directories("${BUILTINS_INCLUDE_DIR}")
29 endif ()
30
31 if (EXISTS "${BUILTINS_LIB_DIR}")
32     set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${BUILTINS_LIB_DIR}")
33     link_directories("${BUILTINS_LIB_DIR}")
34 endif ()
35
36 if (EXISTS "${BUILTINS_PKGCONFIG_DIR}")
37     set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${BUILTINS_PKGCONFIG_DIR}")
38 endif ()
39
40 #-----------------------------------------------------------------------
41 # CMake modules
42 #-----------------------------------------------------------------------
43
44 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
45
46 #-----------------------------------------------------------------------
47 # Submodules
48 #-----------------------------------------------------------------------
49
50 if (EXISTS "${PROJECT_SOURCE_DIR}/libs/crunch/inc/crn_decomp.h")
51     set(DEFAULT_BUILD_CRUNCH ON CACHE INTERNAL "...")
52 else ()
53     set(DEFAULT_BUILD_CRUNCH OFF CACHE INTERNAL "...")
54 endif ()
55
56 if (EXISTS "${PROJECT_SOURCE_DIR}/tools/unvanquished/daemonmap/tools/quake3/q3map2/main.c")
57     set(DEFAULT_BUILD_DAEMONMAP ON CACHE INTERNAL "...")
58 else ()
59     set(DEFAULT_BUILD_DAEMONMAP OFF CACHE INTERNAL "...")
60 endif ()
61
62 #-----------------------------------------------------------------------
63 # Build options
64 #-----------------------------------------------------------------------
65
66 option(BUILD_RADIANT "Build the GUI" ON)
67 option(BUILD_TOOLS "Build the tools" ON)
68 option(BUILD_CRUNCH "Build Crunch image support" ${DEFAULT_BUILD_CRUNCH})
69 option(BUILD_DAEMONMAP "Build daemonmap navigation mesh generator" ${DEFAULT_BUILD_DAEMONMAP})
70 option(DOWNLOAD_GAMEPACKS "Download game packs" ON)
71 option(USE_WERROR "Build with -Werror -pedantic-errors" OFF)
72 option(FHS_INSTALL "Install according to Filesystem Hierarchy Standard" OFF)
73
74 set(BUILD_BINARIES OFF CACHE INTERNAL "...")
75 if (BUILD_RADIANT OR BUILD_TOOLS)
76     set(BUILD_BINARIES ON)
77 endif ()
78
79 if (BUILD_BINARIES)
80     if (WIN32 OR APPLE
81         OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"
82         OR "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD" )
83         set(BUNDLING_SUPPORTED ON)
84     endif()
85
86     if (BUNDLING_SUPPORTED)
87         if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
88             set(BUNDLE_LIBRARIES_DEFAULT ON)
89         else ()
90             set(BUNDLE_LIBRARIES_DEFAULT OFF)
91         endif ()
92
93         option(BUNDLE_LIBRARIES "Bundle libraries" ${BUNDLE_LIBRARIES_DEFAULT})
94     endif ()
95
96     if (BUNDLE_LIBRARIES AND BUNDLING_SUPPORTED)
97         set(FHS_INSTALL OFF CACHE PATH "Disabled because of BUNDLE_LIBRARIES" FORCE)
98     endif ()
99 endif ()
100
101 #-----------------------------------------------------------------------
102 # Paths
103 #-----------------------------------------------------------------------
104
105 if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
106     set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/install" CACHE PATH "..." FORCE)
107 endif ()
108
109 if (APPLE)
110     set(APPLE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/NetRadiant.app)
111     set(FINAL_INSTALL_PREFIX ${APPLE_INSTALL_PREFIX}/Contents/Prefix)
112 else ()
113     set(FINAL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
114 endif ()
115
116 set(RADIANT_NAME "NetRadiant" CACHE INTERNAL "...")
117 add_definitions(-DRADIANT_NAME="${RADIANT_NAME}")
118 set(RADIANT_BASENAME "netradiant" CACHE INTERNAL "...")
119 add_definitions(-DRADIANT_BASENAME="${RADIANT_BASENAME}")
120
121 set(RADIANT_BIN_DIR ${FINAL_INSTALL_PREFIX} CACHE INTERNAL "...")
122 set(RADIANT_LIB_DIR ${FINAL_INSTALL_PREFIX}/lib CACHE INTERNAL "...")
123 set(RADIANT_ADDONS_DIR ${FINAL_INSTALL_PREFIX} CACHE INTERNAL "...")
124 set(RADIANT_ETC_DIR ${FINAL_INSTALL_PREFIX}/etc CACHE INTERNAL "...")
125 set(RADIANT_SHARE_DIR ${FINAL_INSTALL_PREFIX}/share CACHE INTERNAL "...")
126 set(RADIANT_DATA_DIR ${FINAL_INSTALL_PREFIX} CACHE INTERNAL "...")
127
128 if (FHS_INSTALL AND NOT BUNDLE_LIBRARIES)
129     set(RADIANT_BIN_DIR ${FINAL_INSTALL_PREFIX}/bin)
130     set(RADIANT_LIB_DIR ${FINAL_INSTALL_PREFIX}/lib)
131     set(RADIANT_ADDONS_DIR ${RADIANT_LIB_DIR}/${RADIANT_BASENAME})
132     set(RADIANT_ETC_DIR ${FINAL_INSTALL_PREFIX}/etc)
133     set(RADIANT_SHARE_DIR ${FINAL_INSTALL_PREFIX}/share)
134     set(RADIANT_DATA_DIR ${RADIANT_SHARE_DIR}/${RADIANT_BASENAME})
135 endif ()
136
137 set(GAMEPACKS_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/download CACHE PATH "Where to store downloaded game packs")
138
139 #-----------------------------------------------------------------------
140 # Version
141 #-----------------------------------------------------------------------
142
143 # CMake 3.0+ would allow this in project()
144 set(RADIANT_VERSION_MAJOR 1)
145 set(RADIANT_VERSION_MINOR 5)
146 set(RADIANT_VERSION_PATCH 0)
147 set(RADIANT_VERSION "${RADIANT_VERSION_MAJOR}.${RADIANT_VERSION_MINOR}.${RADIANT_VERSION_PATCH}")
148
149 set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
150
151 find_package(Git REQUIRED)
152
153 execute_process(
154      COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
155      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
156      OUTPUT_VARIABLE GIT_VERSION
157      OUTPUT_STRIP_TRAILING_WHITESPACE
158 )
159
160 set(RADIANT_VERSION_STRING "${RADIANT_VERSION}n")
161
162 if (GIT_VERSION)
163     set(RADIANT_VERSION_STRING "${RADIANT_VERSION_STRING}-git-${GIT_VERSION}")
164 endif ()
165
166 message(STATUS "Building ${PROJECT_NAME} ${RADIANT_VERSION_STRING} ${RADIANT_ABOUTMSG}")
167
168 #-----------------------------------------------------------------------
169 # Language standard
170 #-----------------------------------------------------------------------
171
172 if (BUILD_BINARIES)
173     set(CMAKE_CXX_STANDARD 11)
174     set(CMAKE_CXX_STANDARD_REQUIRED ON)
175     set(CMAKE_CXX_EXTENSIONS OFF)
176
177     if (CMAKE_VERSION VERSION_LESS "3.1")
178         if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
179             include(CheckCXXCompilerFlag)
180             check_cxx_compiler_flag(--std=c++${CMAKE_CXX_STANDARD} STD_CXX)
181             if (STD_CXX)
182                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++${CMAKE_CXX_STANDARD}")
183             else ()
184                 message(SEND_ERROR "Requires C++${CMAKE_CXX_STANDARD} or better")
185             endif ()
186         else ()
187             message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}, make sure it supports C++${CMAKE_CXX_STANDARD}")
188         endif ()
189     endif ()
190 endif ()
191
192 #-----------------------------------------------------------------------
193 # Flags
194 #-----------------------------------------------------------------------
195
196 if (BUILD_BINARIES)
197     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
198
199     macro (addflags_c args)
200         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${args}")
201     endmacro ()
202
203     macro (addflags_cxx args)
204         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${args}")
205     endmacro ()
206
207     macro (addflags args)
208         addflags_c("${args}")
209         addflags_cxx("${args}")
210     endmacro ()
211
212     addflags("-fno-strict-aliasing")
213     if (NOT WIN32)
214         addflags("-fvisibility=hidden")
215     endif ()
216
217     if (USE_WERROR)
218         addflags("-Werror")
219         addflags("-pedantic-errors")
220     endif ()
221
222     addflags("-Wall")
223     addflags("-Wextra")
224     addflags("-pedantic")
225
226     addflags_c("-Wno-deprecated-declarations") # vfs.c: g_strdown
227
228     addflags("-Wno-unused-function")
229     addflags("-Wno-unused-variable")
230     addflags("-Wno-unused-parameter")
231
232     if (APPLE)
233         add_definitions(-DGL_SILENCE_DEPRECATION=1)
234     endif()
235
236     set(CMAKE_POSITION_INDEPENDENT_CODE 1)
237 endif ()
238
239 if (BUILD_RADIANT)
240     set(GTK_TARGET 2 CACHE STRING "GTK target")
241     add_definitions(-DGTK_TARGET=${GTK_TARGET})
242
243     if (WIN32)
244         add_definitions(-DWORKAROUND_WINDOWS_FLOATING_WINDOW=1)
245
246         if (GTK_TARGET EQUAL 2)
247             add_definitions(-DWORKAROUND_WINDOWS_GTK2_GLWIDGET=1)
248         endif ()
249     endif ()
250
251     if (APPLE)
252         if (GTK_TARGET EQUAL 2)
253             add_definitions(-DWORKAROUND_MACOS_GTK2_DESTROY=1)
254             add_definitions(-DWORKAROUND_MACOS_GTK2_GLWIDGET=1)
255             add_definitions(-DWORKAROUND_MACOS_GTK2_LAGGYPOINTER=1)
256         endif ()
257     endif ()
258 endif ()
259
260 #-----------------------------------------------------------------------
261 # Defs
262 #-----------------------------------------------------------------------
263
264 if (BUILD_BINARIES)
265     add_definitions(-DRADIANT_VERSION="${RADIANT_VERSION}")
266     add_definitions(-DRADIANT_VERSION_STRING="${RADIANT_VERSION_STRING}")
267
268     if (NOT CMAKE_BUILD_TYPE MATCHES Release)
269         add_definitions(-D_DEBUG=1)
270     endif ()
271 endif ()
272
273 if (BUILD_RADIANT)
274     add_definitions(-DRADIANT_ABOUTMSG="${RADIANT_ABOUTMSG}")
275
276     macro (disable_deprecated name gtk2only)
277         add_definitions(-D${name}_DISABLE_SINGLE_INCLUDES)
278         if ((${gtk2only} EQUAL 0) OR (GTK_TARGET EQUAL 2))
279             add_definitions(-D${name}_DISABLE_DEPRECATED)
280         endif ()
281     endmacro ()
282
283     disable_deprecated(ATK 0)
284     disable_deprecated(G 0)
285     disable_deprecated(GDK 0)
286     disable_deprecated(GDK_PIXBUF 0)
287     disable_deprecated(GTK 1)
288     disable_deprecated(PANGO 0)
289 endif ()
290
291 if (BUILD_BINARIES)
292     add_custom_target(binaries ALL)
293
294     if(APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
295         link_directories(
296             /usr/local/lib
297         )
298     endif ()
299
300     if (WIN32)
301         add_definitions(
302             -DWIN32=1
303             -D_WIN32=1
304         )
305     else ()
306         add_definitions(
307             -DPOSIX=1
308         )
309     endif ()
310 endif ()
311
312 if (BUILD_RADIANT AND NOT APPLE AND NOT WIN32)
313     set(XWINDOWS ON)
314     find_package(X11 REQUIRED)
315     include_directories(${X11_INCLUDE_DIR})
316     add_definitions(-DXWINDOWS=1)
317 endif ()
318
319 if (BUILD_BINARIES)
320     include_directories("${PROJECT_SOURCE_DIR}/include")
321     include_directories("${PROJECT_SOURCE_DIR}/libs")
322
323     macro (copy_dlls target)
324         if (BUNDLE_LIBRARIES AND BUNDLING_SUPPORTED)
325             add_custom_command(TARGET ${target} POST_BUILD
326                 COMMAND "${PROJECT_SOURCE_DIR}/library-bundler"
327                 "register" "${PROJECT_BINARY_DIR}" "$<TARGET_FILE:${target}>"
328                 VERBATIM
329             )
330             add_dependencies(bundle ${target})
331         endif ()
332     endmacro ()
333 endif ()
334
335 #-----------------------------------------------------------------------
336 # Bundle
337 #-----------------------------------------------------------------------
338
339 if (BUILD_BINARIES)
340     if (BUNDLE_LIBRARIES AND BUNDLING_SUPPORTED)
341         add_subdirectory(bundle)
342     endif ()
343 endif ()
344
345 #-----------------------------------------------------------------------
346 # Builtins: targets
347 #-----------------------------------------------------------------------
348
349 add_custom_target(builtins)
350
351 if (BUILTIN_GTKGLEXT OR BUILTIN_GTKTHEME_MOJAVE)
352     include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
353 endif ()
354
355 if (BUILTIN_GTKGLEXT)
356     set(GTKGLEXT_PKGNAMES "gdk-2.0 gtk+-2.0 glib-2.0")
357
358     if (NOT APPLE)
359         set(GTKGLEXT_PKGNAMES "${GTKGLEXT_PKGNAMES} gl")
360     endif ()
361
362     execute_process(COMMAND pkg-config --libs ${GTKGLEXT_PKGNAMES}
363         OUTPUT_VARIABLE GTKGLEXT_LDFLAGS
364         OUTPUT_STRIP_TRAILING_WHITESPACE
365     )
366
367     set(GTKGLEXT_LDFLAGS "$ENV{LDFLAGS} -lm ${GTKGLEXT_LDFLAGS}")
368
369     execute_process(COMMAND pkg-config --cflags ${GTKGLEXT_PKGNAMES}
370         OUTPUT_VARIABLE GTKGLEXT_CFLAGS
371         OUTPUT_STRIP_TRAILING_WHITESPACE
372     )
373
374     set(GTKGLEXT_CFLAGS "$ENV{CFLAGS} ${GTKGLEXT_CFLAGS}")
375
376     if (NOT CMAKE_BUILD_TYPE MATCHES Release)
377         set(GTKGLEXT_CFLAGS "${GTKGLEXT_CFLAGS} -g")
378     endif ()
379
380     set(CONFIGURE_OPTIONS --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf)
381
382     if (APPLE)
383         set(GTKGLEXT_GIT_TAG macos)
384     else ()
385         set(GTKGLEXT_GIT_TAG fixes)
386     endif ()
387
388     if (APPLE)
389         set(GTKGLEXT_CFLAGS "${GTKGLEXT_CFLAGS} -DGL_SILENCE_DEPRECATION=1")
390         # FIXME: OpenGL deprecation warnings are not silenced
391         # in Objective C code.
392     endif ()
393
394     ExternalProject_Add(gtkglext
395         GIT_REPOSITORY https://gitlab.gnome.org/illwieckz/gtkglext.git
396         GIT_TAG ${GTKGLEXT_GIT_TAG}
397         BUILD_IN_SOURCE ON
398         CONFIGURE_COMMAND export CC=${CMAKE_C_COMPILER}
399         CONFIGURE_COMMAND && export CFLAGS=${GTKGLEXT_LDFLAGS}
400         CONFIGURE_COMMAND && export LDFLAGS=${GTKGLEXT_CFLAGS}
401         CONFIGURE_COMMAND && export NOCONFIGURE=1
402         CONFIGURE_COMMAND && ./autogen.sh
403         CONFIGURE_COMMAND && ./configure --prefix "${BUILTINS_INSTALL_DIR}" ${CONFIGURE_OPTIONS}
404         BUILD_COMMAND $(MAKE)
405         BUILD_COMMAND CC=${CMAKE_C_COMPILER}
406         BUILD_COMMAND CFLAGS=${GTKGLEXT_CFLAGS}
407         BUILD_COMMAND LDFLAGS=${GTKGLEXT_LDFLAGS}
408         INSTALL_COMMAND $(MAKE) install
409     )
410
411     include_directories("${BUILTINS_INSTALL_DIR}/lib/gtkglext-1.0/include")
412     include_directories("${BUILTINS_INSTALL_DIR}/include/gtkglext-1.0")
413
414     add_dependencies(builtins gtkglext)
415     set_target_properties(gtkglext PROPERTIES EXCLUDE_FROM_ALL ON)
416 endif ()
417
418 if (BUNDLE_LIBRARIES)
419     # It was required to tell cmake to not patch rpath on macos builtins.
420     # It was also required to tell cmake to not patch rpath on freebsd binaries.
421     # Patching rpath is done in library_bundler instead so we can skip this
422     # step entirely when bundling.
423     set(CMAKE_SKIP_RPATH ON)
424 endif()
425
426 if (BUILTIN_GTKTHEME_MOJAVE)
427     ExternalProject_Add(gtktheme-mojave
428         GIT_REPOSITORY https://github.com/vinceliuice/Mojave-gtk-theme.git
429         GIT_TAG master
430         BUILD_IN_SOURCE ON
431         CONFIGURE_COMMAND echo
432         BUILD_COMMAND echo
433         INSTALL_COMMAND ./install.sh -o standard -a standard -s standard -i standard -d "${PROJECT_BINARY_DIR}/themes"
434     )
435     add_dependencies(builtins gtktheme-mojave)
436     set_target_properties(gtktheme-mojave PROPERTIES EXCLUDE_FROM_ALL ON)
437 endif ()
438
439 #-----------------------------------------------------------------------
440 # Libraries
441 #-----------------------------------------------------------------------
442
443 if (BUILD_BINARIES)
444     add_subdirectory(libs)
445 endif ()
446
447 if (BUILD_RADIANT)
448     add_subdirectory(include)
449 endif ()
450
451 #-----------------------------------------------------------------------
452 # Plugins
453 #-----------------------------------------------------------------------
454
455 if (BUILD_RADIANT)
456     add_subdirectory(contrib)
457 endif ()
458
459 #-----------------------------------------------------------------------
460 # Modules
461 #-----------------------------------------------------------------------
462
463 if (BUILD_RADIANT)
464     add_subdirectory(plugins)
465 endif ()
466
467 #-----------------------------------------------------------------------
468 # Radiant
469 #-----------------------------------------------------------------------
470
471 if (BUILD_BINARIES)
472     macro (radiant_tool name)
473         add_dependencies(binaries ${name})
474
475         if (WIN32)
476             add_executable(${name} ${ARGN} ${PROJECT_SOURCE_DIR}/include/lib.rc)
477         else ()
478             add_executable(${name} ${ARGN})
479         endif()
480
481         copy_dlls(${name})
482
483         install(
484             TARGETS ${name}
485             RUNTIME DESTINATION ${RADIANT_BIN_DIR}
486         )
487     endmacro ()
488
489     if (BUILD_RADIANT)
490         add_subdirectory(radiant)
491     endif ()
492 endif ()
493
494 #-----------------------------------------------------------------------
495 # Tools
496 #-----------------------------------------------------------------------
497
498 if (BUILD_TOOLS)
499     add_subdirectory(tools)
500
501     file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/setup/data/tools/*")
502
503     if (NOT (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR))
504         # Copy data files from sources to the build directory
505         message(STATUS "Copying data files")
506         file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}")
507     endif ()
508 endif ()
509
510 #-----------------------------------------------------------------------
511 # Game packs
512 #-----------------------------------------------------------------------
513
514 set(GAMEPACKS_LICENSE_LIST free CACHE STRING "Download game packs by license")
515 set(GAMEPACKS_NAME_LIST none CACHE STRING "Download game packs by name")
516
517 if (DOWNLOAD_GAMEPACKS)
518     add_custom_target(gamepacks ALL
519        COMMAND "${PROJECT_SOURCE_DIR}/gamepack-manager" --license ${GAMEPACKS_LICENSE_LIST} --name ${GAMEPACKS_NAME_LIST} --download-dir "${GAMEPACKS_DOWNLOAD_DIR}" --install-dir "${PROJECT_BINARY_DIR}/gamepacks" --download --install
520        COMMENT "Downloading game packs"
521     )
522 endif ()
523
524 #-----------------------------------------------------------------------
525 # Install
526 #-----------------------------------------------------------------------
527
528 if (BUILD_BINARIES)
529     install(DIRECTORY
530         setup/data/tools/base
531         setup/data/tools/bitmaps
532         setup/data/tools/gl
533         setup/data/tools/plugins
534         docs
535         DESTINATION ${RADIANT_DATA_DIR}
536     )
537
538     install(FILES
539         setup/data/tools/global.xlink
540         DESTINATION ${RADIANT_DATA_DIR}
541     )
542 endif ()
543
544 if (DOWNLOAD_GAMEPACKS)
545     install(DIRECTORY
546         ${PROJECT_BINARY_DIR}/gamepacks
547         DESTINATION ${RADIANT_DATA_DIR}
548     )
549 endif ()
550
551 if (BUILD_BINARIES AND FHS_INSTALL AND NOT WIN32 AND NOT APPLE)
552     install(FILES
553         icons/netradiant.png
554         DESTINATION ${RADIANT_SHARE_DIR}/pixmaps
555     )
556     install(FILES
557         icons/netradiant.desktop
558         DESTINATION ${RADIANT_SHARE_DIR}/applications
559     )
560     install(FILES
561         icons/mime/map.xml
562         DESTINATION ${RADIANT_SHARE_DIR}/mime/model
563     )
564 endif ()
565
566 if (APPLE)
567     install(DIRECTORY
568         setup/macos/Contents
569         DESTINATION ${APPLE_INSTALL_PREFIX}
570     )
571     install(DIRECTORY
572     ${PROJECT_BINARY_DIR}/themes
573         DESTINATION ${APPLE_INSTALL_PREFIX}/Contents/Prefix/share
574     )
575     install(PROGRAMS
576         setup/macos/NetRadiant
577         DESTINATION ${APPLE_INSTALL_PREFIX}/Contents/MacOS
578     )
579 endif ()
580
581 include(cmake/scripts/package.cmake)