]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - CMakeLists.txt
use NULL as sentinel instead of 0
[xonotic/netradiant.git] / CMakeLists.txt
index b95fd6280666f98ccadccc6278402bc3da0cffde..b2b766ea6ca8a636519f766e71669d4d64fccfde 100644 (file)
@@ -72,7 +72,8 @@ if (NOT WIN32)
 endif ()
 
 set(CMAKE_POSITION_INDEPENDENT_CODE 1)
-set(GTK_NS "GTK2" CACHE STRING "GTK variable prefix")
+set(GTK_TARGET 2 CACHE STRING "GTK target")
+add_definitions(-DGTK_TARGET=${GTK_TARGET})
 
 #-----------------------------------------------------------------------
 # Defs
@@ -89,6 +90,20 @@ if (NOT CMAKE_BUILD_TYPE MATCHES Release)
     add_definitions(-D_DEBUG=1)
 endif ()
 
+macro(disable_deprecated name gtk2only)
+    add_definitions(-D${name}_DISABLE_SINGLE_INCLUDES)
+    if ((${gtk2only} EQUAL 0) OR (GTK_TARGET EQUAL 2))
+        add_definitions(-D${name}_DISABLE_DEPRECATED)
+    endif ()
+endmacro()
+
+disable_deprecated(ATK 0)
+disable_deprecated(G 0)
+disable_deprecated(GDK 0)
+disable_deprecated(GDK_PIXBUF 0)
+disable_deprecated(GTK 1)
+disable_deprecated(PANGO 0)
+
 if (APPLE)
     option(XWINDOWS "Build against X11" ON)
     add_definitions(
@@ -115,8 +130,15 @@ endif ()
 include_directories("${PROJECT_SOURCE_DIR}/include")
 include_directories("${PROJECT_SOURCE_DIR}/libs")
 
+if (WIN32 AND NOT CMAKE_CROSSCOMPILING)
+    set(BUNDLE_LIBRARIES_DEFAULT ON)
+else ()
+    set(BUNDLE_LIBRARIES_DEFAULT OFF)
+endif ()
+option(BUNDLE_LIBRARIES "Bundle libraries" ${BUNDLE_LIBRARIES_DEFAULT})
+
 macro(copy_dlls target)
-    if (WIN32)
+    if (BUNDLE_LIBRARIES)
         add_custom_command(TARGET ${target} POST_BUILD
                 COMMAND bash
                 ARGS -c "ldd '$<TARGET_FILE:${target}>' | grep -v /c/Windows | awk '{ print $1 }' | while read dll; do cp \"$(which $dll)\" '${PROJECT_BINARY_DIR}'; done"
@@ -194,13 +216,11 @@ endif ()
 add_subdirectory(tools)
 
 file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/setup/data/tools/*")
-file(GLOB DOCS_FILES "${PROJECT_SOURCE_DIR}/docs/*")
 
 if (NOT (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR))
     # Copy data files from sources to the build directory
     message(STATUS "Copying data files")
     file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}")
-    file(COPY ${DOCS_FILES} DESTINATION "${PROJECT_BINARY_DIR}/docs")
 endif ()
 
 #-----------------------------------------------------------------------
@@ -228,20 +248,41 @@ install(
         "${PROJECT_BINARY_DIR}/RADIANT_PATCH"
         DESTINATION ${CMAKE_INSTALL_PREFIX}
 )
-file(GLOB GAME_FILES "${PROJECT_SOURCE_DIR}/games/*")
+
+install(
+        DIRECTORY
+        ${PROJECT_SOURCE_DIR}/setup/data/tools/
+        ${PROJECT_SOURCE_DIR}/docs
+        DESTINATION ${CMAKE_INSTALL_PREFIX}
+)
+
+set(GAME_FILES
+        DarkPlaces
+        Nexuiz
+        OpenArena
+        Osirion
+        Q3
+        Quake2
+        Quake
+        Quetoo
+        Tremulous
+        UFOAI
+        Unvanquished
+        Warsow
+        Xonotic
+        )
 unset(_tmp)
 foreach (it ${GAME_FILES})
-    list(APPEND _tmp "${it}/games")
-    file(GLOB GAME_DIR "${it}/*.game")
-    list(APPEND _tmp "${GAME_DIR}")
+    set(dir "${PROJECT_BINARY_DIR}/games/${it}Pack")
+    string(TOLOWER "${it}" it)
+    list(APPEND _tmp "${dir}/games")
+    list(APPEND _tmp "${dir}/${it}.game")
 endforeach ()
 set(GAME_FILES ${_tmp})
 
 install(
         DIRECTORY
-        ${PROJECT_SOURCE_DIR}/setup/data/tools/
-        ${PROJECT_SOURCE_DIR}/docs
         ${GAME_FILES}
         DESTINATION ${CMAKE_INSTALL_PREFIX}
+        OPTIONAL
 )
-