From fec7e300053b6fb9f82210acf1b45c4f2169615d Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 14 Apr 2016 10:48:56 +1000 Subject: [PATCH] Add CMakeLists.txt --- .gitignore | 7 +- .travis.yml | 32 +++++ CMakeLists.txt | 181 +++++++++++++++++++++++++++++ README.md | 86 ++++++++++++++ appveyor.yml | 27 +++++ cmake/FindGLIB.cmake | 5 + cmake/FindGtkGLExt.cmake | 12 ++ contrib/CMakeLists.txt | 15 +++ contrib/bobtoolz/CMakeLists.txt | 37 ++++++ contrib/bobtoolz/DPatch.cpp | 2 +- contrib/brushexport/CMakeLists.txt | 10 ++ contrib/prtview/CMakeLists.txt | 13 +++ contrib/shaderplug/CMakeLists.txt | 9 ++ contrib/sunplug/CMakeLists.txt | 6 + contrib/ufoaiplug/CMakeLists.txt | 9 ++ download-gamepacks.sh | 14 +-- include/CMakeLists.txt | 47 ++++++++ include/ipatch.h | 1 + install-gamepacks.sh | 9 +- libs/CMakeLists.txt | 61 ++++++++++ libs/cmdlib/.cvswrappers | 3 - libs/cmdlib/CMakeLists.txt | 3 + libs/container/CMakeLists.txt | 8 ++ libs/container/container.h | 1 + libs/ddslib/CMakeLists.txt | 3 + libs/debugging/CMakeLists.txt | 3 + libs/etclib/CMakeLists.txt | 3 + libs/filematch/CMakeLists.txt | 3 + libs/generic/CMakeLists.txt | 14 +++ libs/gtkutil/CMakeLists.txt | 35 ++++++ libs/l_net/CMakeLists.txt | 14 +++ libs/math/CMakeLists.txt | 11 ++ libs/mathlib/CMakeLists.txt | 7 ++ libs/memory/CMakeLists.txt | 3 + libs/modulesystem/CMakeLists.txt | 5 + libs/os/CMakeLists.txt | 9 ++ libs/picomodel/CMakeLists.txt | 26 +++++ libs/profile/CMakeLists.txt | 4 + libs/script/CMakeLists.txt | 4 + libs/signal/CMakeLists.txt | 5 + libs/splines/CMakeLists.txt | 11 ++ libs/stream/CMakeLists.txt | 7 ++ libs/string/CMakeLists.txt | 5 + libs/uilib/CMakeLists.txt | 10 ++ libs/uilib/uilib.cpp | 0 libs/xml/CMakeLists.txt | 15 +++ plugins/CMakeLists.txt | 23 ++++ plugins/archivepak/CMakeLists.txt | 5 + plugins/archivewad/CMakeLists.txt | 5 + plugins/archivezip/CMakeLists.txt | 10 ++ plugins/entity/CMakeLists.txt | 25 ++++ plugins/image/CMakeLists.txt | 13 +++ plugins/imagehl/CMakeLists.txt | 6 + plugins/imagepng/CMakeLists.txt | 7 ++ plugins/imageq2/CMakeLists.txt | 5 + plugins/mapq3/CMakeLists.txt | 5 + plugins/mapxml/CMakeLists.txt | 8 ++ plugins/md3model/CMakeLists.txt | 14 +++ plugins/model/CMakeLists.txt | 7 ++ plugins/sample/CMakeLists.txt | 3 + plugins/shaders/CMakeLists.txt | 8 ++ plugins/textool/.cvswrappers | 2 - plugins/textool/Doc/.cvswrappers | 1 - plugins/vfspk3/CMakeLists.txt | 12 ++ radiant/CMakeLists.txt | 129 ++++++++++++++++++++ radiant/mainframe.cpp | 4 +- radiant/qgl.cpp | 19 +++ tools/CMakeLists.txt | 13 +++ tools/quake3/CMakeLists.txt | 165 ++++++++++++++++++++++++++ tools/quake3/q3data/.cvswrappers | 2 - tools/quake3/q3map2/game_t.h | 33 ------ 71 files changed, 1262 insertions(+), 57 deletions(-) create mode 100644 .travis.yml create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 appveyor.yml create mode 100644 cmake/FindGLIB.cmake create mode 100644 cmake/FindGtkGLExt.cmake create mode 100644 contrib/CMakeLists.txt create mode 100644 contrib/bobtoolz/CMakeLists.txt create mode 100644 contrib/brushexport/CMakeLists.txt create mode 100644 contrib/prtview/CMakeLists.txt create mode 100644 contrib/shaderplug/CMakeLists.txt create mode 100644 contrib/sunplug/CMakeLists.txt create mode 100644 contrib/ufoaiplug/CMakeLists.txt create mode 100644 include/CMakeLists.txt create mode 100644 libs/CMakeLists.txt delete mode 100644 libs/cmdlib/.cvswrappers create mode 100644 libs/cmdlib/CMakeLists.txt create mode 100644 libs/container/CMakeLists.txt create mode 100644 libs/ddslib/CMakeLists.txt create mode 100644 libs/debugging/CMakeLists.txt create mode 100644 libs/etclib/CMakeLists.txt create mode 100644 libs/filematch/CMakeLists.txt create mode 100644 libs/generic/CMakeLists.txt create mode 100644 libs/gtkutil/CMakeLists.txt create mode 100644 libs/l_net/CMakeLists.txt create mode 100644 libs/math/CMakeLists.txt create mode 100644 libs/mathlib/CMakeLists.txt create mode 100644 libs/memory/CMakeLists.txt create mode 100644 libs/modulesystem/CMakeLists.txt create mode 100644 libs/os/CMakeLists.txt create mode 100644 libs/picomodel/CMakeLists.txt create mode 100644 libs/profile/CMakeLists.txt create mode 100644 libs/script/CMakeLists.txt create mode 100644 libs/signal/CMakeLists.txt create mode 100644 libs/splines/CMakeLists.txt create mode 100644 libs/stream/CMakeLists.txt create mode 100644 libs/string/CMakeLists.txt create mode 100644 libs/uilib/CMakeLists.txt create mode 100644 libs/uilib/uilib.cpp create mode 100644 libs/xml/CMakeLists.txt create mode 100644 plugins/CMakeLists.txt create mode 100644 plugins/archivepak/CMakeLists.txt create mode 100644 plugins/archivewad/CMakeLists.txt create mode 100644 plugins/archivezip/CMakeLists.txt create mode 100644 plugins/entity/CMakeLists.txt create mode 100644 plugins/image/CMakeLists.txt create mode 100644 plugins/imagehl/CMakeLists.txt create mode 100644 plugins/imagepng/CMakeLists.txt create mode 100644 plugins/imageq2/CMakeLists.txt create mode 100644 plugins/mapq3/CMakeLists.txt create mode 100644 plugins/mapxml/CMakeLists.txt create mode 100644 plugins/md3model/CMakeLists.txt create mode 100644 plugins/model/CMakeLists.txt create mode 100644 plugins/sample/CMakeLists.txt create mode 100644 plugins/shaders/CMakeLists.txt delete mode 100644 plugins/textool/.cvswrappers delete mode 100644 plugins/textool/Doc/.cvswrappers create mode 100644 plugins/vfspk3/CMakeLists.txt create mode 100644 radiant/CMakeLists.txt create mode 100644 tools/CMakeLists.txt create mode 100644 tools/quake3/CMakeLists.txt delete mode 100644 tools/quake3/q3data/.cvswrappers delete mode 100644 tools/quake3/q3map2/game_t.h diff --git a/.gitignore b/.gitignore index 25031518..32e1dbf1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.[oda] +.idea/ .settings -games -install -games +build/ +games/ +install/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..79f2123d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +language: c++ + +sudo: required + +services: + - docker + +os: + - linux + - osx + +compiler: + - clang + - gcc + +before_script: + - cmake --version + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then + sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" && + sudo apt-get -qq update && + sudo apt-get -qq -f install && + sudo apt-get -qq install libgtk2.0-dev libgtkglext1-dev; + fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then + brew update && + brew install gtkglext && + brew link --force gettext; + fi + +script: + - cmake -H. -Bbuild + - cmake --build build -- -j4 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..742fd059 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,181 @@ +cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +# Enable Debug by default, can be changed with -DCMAKE_BUILD_TYPE=Release +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) +endif () + +project(NetRadiant C CXX) +option(BUILD_RADIANT "Build the gui" ON) + +#----------------------------------------------------------------------- +# Version +#----------------------------------------------------------------------- + +# CMake 3.0+ would allow this in project() +set(NetRadiant_VERSION_MAJOR 1) +set(NetRadiant_VERSION_MINOR 5) +set(NetRadiant_VERSION_PATCH 0) +set(NetRadiant_VERSION "${NetRadiant_VERSION_MAJOR}.${NetRadiant_VERSION_MINOR}.${NetRadiant_VERSION_PATCH}") + +file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_MAJOR" ${NetRadiant_VERSION_MAJOR}) +file(WRITE "${PROJECT_BINARY_DIR}/RADIANT_MINOR" ${NetRadiant_VERSION_MINOR}) + +set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message") + +find_package(Git REQUIRED) +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) +set(RADIANT_VERSION_STRING "${NetRadiant_VERSION}n") +if (GIT_VERSION) + set(RADIANT_VERSION_STRING "${RADIANT_VERSION_STRING}-git-${GIT_VERSION}") +endif () + +message(STATUS "Building ${PROJECT_NAME} ${RADIANT_VERSION_STRING} ${RADIANT_ABOUTMSG}") + +#----------------------------------------------------------------------- +# Language standard +#----------------------------------------------------------------------- + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +# For some reason the above flags don't really work... +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX) + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag(--std=c++${CMAKE_CXX_STANDARD} STD_CXX) + if (STD_CXX) + list(APPEND CMAKE_CXX_FLAGS --std=c++${CMAKE_CXX_STANDARD}) + else () + message(SEND_ERROR "Requires C++${CMAKE_CXX_STANDARD} or better") + endif () +else () + message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}, make sure it supports C++${CMAKE_CXX_STANDARD}") +endif () + +#----------------------------------------------------------------------- +# Flags +#----------------------------------------------------------------------- + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-exceptions -fno-rtti") +set(CMAKE_POSITION_INDEPENDENT_CODE 1) + +#----------------------------------------------------------------------- +# Defs +#----------------------------------------------------------------------- + +add_definitions(-DRADIANT_VERSION="${NetRadiant_VERSION}") +add_definitions(-DRADIANT_MAJOR_VERSION="${NetRadiant_VERSION_MAJOR}") +add_definitions(-DRADIANT_MINOR_VERSION="${NetRadiant_VERSION_MINOR}") + +add_definitions(-DRADIANT_ABOUTMSG="${NetRadiant_ABOUT}") + +if (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions(-D_DEBUG=1) +endif () + +if (APPLE) + option(XWINDOWS "Build against X11" ON) + add_definitions( + -DPOSIX=1 + ) +elseif (WIN32) + add_definitions( + -DWIN32=1 + -D_WIN32=1 + ) +else () + set(XWINDOWS ON) + add_definitions( + -DPOSIX=1 + ) +endif () + +if (XWINDOWS) + find_package(X11 REQUIRED) + include_directories(${X11_INCLUDE_DIR}) + add_definitions(-DXWINDOWS=1) +endif () + +include_directories("${PROJECT_SOURCE_DIR}/include") +include_directories("${PROJECT_SOURCE_DIR}/libs") + +#----------------------------------------------------------------------- +# Libraries +#----------------------------------------------------------------------- + +add_subdirectory(libs) +add_subdirectory(include) + +#----------------------------------------------------------------------- +# Plugins +#----------------------------------------------------------------------- + +if (BUILD_RADIANT) + add_subdirectory(contrib) +endif () + +#----------------------------------------------------------------------- +# Modules +#----------------------------------------------------------------------- + +if (BUILD_RADIANT) + add_subdirectory(plugins) +endif () + +#----------------------------------------------------------------------- +# Radiant +#----------------------------------------------------------------------- + +if (BUILD_RADIANT) + add_subdirectory(radiant build) +endif () + +if (CMAKE_EXECUTABLE_SUFFIX) + set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX}) +else () + execute_process( + COMMAND uname -m + OUTPUT_VARIABLE RADIANT_EXECUTABLE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif () + +if (BUILD_RADIANT) + set_target_properties(radiant PROPERTIES + COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}" + ) +endif () + +#----------------------------------------------------------------------- +# Tools +#----------------------------------------------------------------------- + +add_subdirectory(tools) + +if (NOT (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)) + # Copy data files from sources to the build directory + message(STATUS "Copying data files") + file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/setup/data/tools/*") + file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}") + file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/docs/*") + file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}/docs") +endif () + +#----------------------------------------------------------------------- +# Game packs +#----------------------------------------------------------------------- + +option(DOWNLOAD_GAMEPACKS "Download game packs" ON) +add_custom_target(game_packs + COMMAND ${CMAKE_COMMAND} -E make_directory games + COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}" + COMMENT "Downloading game packs" + ) +if (DOWNLOAD_GAMEPACKS) + add_custom_target(game_packs_all ALL DEPENDS game_packs) +endif () diff --git a/README.md b/README.md new file mode 100644 index 00000000..8bd40e27 --- /dev/null +++ b/README.md @@ -0,0 +1,86 @@ +NetRadiant +========== + +The open source, cross platform level editor for idtech games (Radiant fork) + +# Getting the Sources + +The latest source is available from the git repository: +https://gitlab.com/xonotic/netradiant.git + +The git client can be obtained from the Git website: +http://git-scm.org + +To get a copy of the source using the commandline git client: +``` +git clone https://gitlab.com/xonotic/netradiant.git +cd netradiant +``` + +See also https://gitlab.com/xonotic/netradiant/ for a source browser, issues and more. + +# Dependencies + + * OpenGL + * LibXml2 + * GTK2 + * GtkGLExt + * LibJpeg + * LibPng + * ZLib + +# Compiling + +This project uses the usual CMake workflow: + +`cmake -H. -Bbuild && cmake --build build -- -j$(nproc)`` + +## linux + +``` +cmake -H. -Bbuild -G "Unix Makefiles" +``` + +## msys2 + +`pacman -S --needed base-devel` + +### 32 bit: + +``` +pacman -S --needed mingw-w64-i686-{toolchain,cmake,gtk2,gtkglext} +cmake -H. -Bbuild -G "MSYS Makefiles" -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw32/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw32/lib/gtk-2.0/include +``` + +### 64 bit: + +``` +pacman -S mingw-w64-x86_64-{toolchain,cmake,gtk2,gtkglext} +cmake -H. -Bbuild -G "MSYS Makefiles" -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw64/lib/gtk-2.0/include +``` + +## OS X: + +``` +brew install gtkglext +brew install Caskroom/cask/xquartz +brew link --force gettext +``` + +More Compilation Details +------------------------ + +options: + * `DOWNLOAD_GAMEPACKS=ON` + Automatically download the gamepack data during the first compilation + * `RADIANT_ABOUTMSG="Custom build"` + A message shown in the about dialog + +targets: + * `radiant` Compiles the radiant core binary + * `modules` Compiles all modules (each module has its own target as well) + * `plugins` Compiles all plugins (each plugin has its own target as well) + * `game_packs` Downloads the game pack data + * `quake3` Compiles all the Quake3 tools + - `q3map2` Quake3 map compiler + - `q3data` diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..d98cc731 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,27 @@ +platform: x64 + +shallow_clone: true + +install: + - set "PATH=C:\msys64\usr\bin;%PATH%" + - bash -lc "pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel" + - ps: >- + bash -lc @" + exec 0&1 + pacman --noconfirm -Su + pacman --noconfirm --needed -S base-devel mingw-w64-x86_64-{toolchain,clang,cmake,gtk2,gtkglext} + "@ + +build_script: + - set HOME=. + - set MSYSTEM=MINGW64 + - ps: >- + bash -lc @" + set -e + exec 0&1 + # export CC=clang + # export CXX=clang++ + cmake --version + cmake -H. -Bbuild -G 'MSYS Makefiles' -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw64/lib/gtk-2.0/include + cmake --build build + "@ diff --git a/cmake/FindGLIB.cmake b/cmake/FindGLIB.cmake new file mode 100644 index 00000000..8e231e9c --- /dev/null +++ b/cmake/FindGLIB.cmake @@ -0,0 +1,5 @@ +include(FindPkgConfig OPTIONAL) +if (PKG_CONFIG_FOUND) + include(FindPkgConfig) + pkg_check_modules(GLIB glib-2.0) +endif () diff --git a/cmake/FindGtkGLExt.cmake b/cmake/FindGtkGLExt.cmake new file mode 100644 index 00000000..5b50f41f --- /dev/null +++ b/cmake/FindGtkGLExt.cmake @@ -0,0 +1,12 @@ +include(FindPkgConfig OPTIONAL) +if (PKG_CONFIG_FOUND) + include(FindPkgConfig) + pkg_check_modules(GTK gtk+-2.0) + if (XWINDOWS) + pkg_check_modules(GTKGL gtkglext-x11-1.0) + elseif (WIN32) + pkg_check_modules(GTKGL gtkglext-win32-1.0) + else () + pkg_check_modules(GTKGL gtkglext-quartz-1.0) + endif () +endif () diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt new file mode 100644 index 00000000..7899526f --- /dev/null +++ b/contrib/CMakeLists.txt @@ -0,0 +1,15 @@ +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/plugins") + +add_custom_target(plugins) +macro(radiant_plugin name) + message(STATUS "Found Plugin ${name}") + add_library(${name} MODULE ${ARGN}) + add_dependencies(plugins ${name}) +endmacro() + +add_subdirectory(bobtoolz) +add_subdirectory(brushexport) +add_subdirectory(prtview) +add_subdirectory(shaderplug) +add_subdirectory(sunplug) +add_subdirectory(ufoaiplug) diff --git a/contrib/bobtoolz/CMakeLists.txt b/contrib/bobtoolz/CMakeLists.txt new file mode 100644 index 00000000..fb6f7fb0 --- /dev/null +++ b/contrib/bobtoolz/CMakeLists.txt @@ -0,0 +1,37 @@ +radiant_plugin(bobtoolz + dialogs/dialogs-gtk.cpp dialogs/dialogs-gtk.h + + bobToolz.h + bobToolz-GTK.cpp + bsploader.cpp bsploader.h + cportals.cpp CPortals.h + ctfresource_gtk.h + DBobView.cpp DBobView.h + DBrush.cpp DBrush.h + DEntity.cpp DEntity.h + DEPair.cpp DEPair.h + DMap.cpp DMap.h + DPatch.cpp DPatch.h + DPlane.cpp DPlane.h + DPoint.cpp DPoint.h + DShape.cpp DShape.h + DTrainDrawer.cpp DTrainDrawer.h + DTreePlanter.cpp DTreePlanter.h + DVisDrawer.cpp DVisDrawer.h + DWinding.cpp DWinding.h + funchandlers-GTK.cpp + lists.cpp lists.h + misc.cpp misc.h + resource.h + resource-gtk.h + ScriptParser.cpp ScriptParser.h + shapes.cpp shapes.h + StdAfx.cpp StdAfx.h + visfind.cpp visfind.h + ) + +target_include_directories(bobtoolz PRIVATE uilib) +target_link_libraries(bobtoolz PRIVATE uilib) + +target_include_directories(bobtoolz PRIVATE mathlib) +target_link_libraries(bobtoolz PRIVATE mathlib) diff --git a/contrib/bobtoolz/DPatch.cpp b/contrib/bobtoolz/DPatch.cpp index 2228b23b..5916d7e0 100644 --- a/contrib/bobtoolz/DPatch.cpp +++ b/contrib/bobtoolz/DPatch.cpp @@ -302,7 +302,7 @@ DPatch* DPatch::MergePatches( patch_merge_t merge_info, DPatch *p1, DPatch *p2 ) int newHeight = p1->height + p2->height - 1; if ( newHeight > MAX_PATCH_HEIGHT ) { - return false; + return nullptr; } DPatch* newPatch = new DPatch(); diff --git a/contrib/brushexport/CMakeLists.txt b/contrib/brushexport/CMakeLists.txt new file mode 100644 index 00000000..578588d4 --- /dev/null +++ b/contrib/brushexport/CMakeLists.txt @@ -0,0 +1,10 @@ +radiant_plugin(brushexport + callbacks.cpp callbacks.h + export.cpp export.h + interface.cpp + plugin.cpp plugin.h + support.cpp support.h + ) + +target_include_directories(brushexport PRIVATE uilib) +target_link_libraries(brushexport PRIVATE uilib) diff --git a/contrib/prtview/CMakeLists.txt b/contrib/prtview/CMakeLists.txt new file mode 100644 index 00000000..f08707f1 --- /dev/null +++ b/contrib/prtview/CMakeLists.txt @@ -0,0 +1,13 @@ +radiant_plugin(prtview + AboutDialog.cpp AboutDialog.h + ConfigDialog.cpp ConfigDialog.h + LoadPortalFileDialog.cpp LoadPortalFileDialog.h + portals.cpp portals.h + prtview.cpp prtview.h + ) + +target_include_directories(prtview PRIVATE uilib) +target_link_libraries(prtview PRIVATE uilib) + +target_include_directories(prtview PRIVATE profile) +target_link_libraries(prtview PRIVATE profile) diff --git a/contrib/shaderplug/CMakeLists.txt b/contrib/shaderplug/CMakeLists.txt new file mode 100644 index 00000000..5e2ff0ad --- /dev/null +++ b/contrib/shaderplug/CMakeLists.txt @@ -0,0 +1,9 @@ +radiant_plugin(shaderplug + shaderplug.cpp shaderplug.h + ) + +target_include_directories(shaderplug PRIVATE uilib) +target_link_libraries(shaderplug PRIVATE uilib) + +target_include_directories(shaderplug PRIVATE xmllib) +target_link_libraries(shaderplug PRIVATE xmllib) diff --git a/contrib/sunplug/CMakeLists.txt b/contrib/sunplug/CMakeLists.txt new file mode 100644 index 00000000..9def1819 --- /dev/null +++ b/contrib/sunplug/CMakeLists.txt @@ -0,0 +1,6 @@ +radiant_plugin(sunplug + sunplug.cpp sunplug.h + ) + +target_include_directories(sunplug PRIVATE uilib) +target_link_libraries(sunplug PRIVATE uilib) diff --git a/contrib/ufoaiplug/CMakeLists.txt b/contrib/ufoaiplug/CMakeLists.txt new file mode 100644 index 00000000..88389cbe --- /dev/null +++ b/contrib/ufoaiplug/CMakeLists.txt @@ -0,0 +1,9 @@ +radiant_plugin(ufoaiplug + ufoai.cpp ufoai.h + ufoai_filters.cpp ufoai_filters.h + ufoai_gtk.cpp ufoai_gtk.h + ufoai_level.cpp ufoai_level.h + ) + +target_include_directories(ufoaiplug PRIVATE uilib) +target_link_libraries(ufoaiplug PRIVATE uilib) diff --git a/download-gamepacks.sh b/download-gamepacks.sh index 269d8c8a..b6827260 100755 --- a/download-gamepacks.sh +++ b/download-gamepacks.sh @@ -149,15 +149,15 @@ pack() mkdir -p games pack DarkPlacesPack GPL svn svn://svn.icculus.org/gtkradiant-gamepacks/DarkPlacesPack/branches/1.5/ pack NexuizPack GPL gitdir git://git.icculus.org/divverent/nexuiz.git misc/netradiant-NexuizPack master -pack OpenArenaPack unknown zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/OpenArenaPack.zip -pack OsirionPack GPL zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/OsirionPack.zip +pack OpenArenaPack unknown zip1 http://ingar.satgnu.net/files/netradiant/gamepacks/OpenArenaPack.zip +pack OsirionPack GPL zip1 http://ingar.satgnu.net/files/netradiant/gamepacks/OsirionPack.zip pack Q3Pack proprietary svn svn://svn.icculus.org/gtkradiant-gamepacks/Q3Pack/trunk/ -r29 -pack Quake2Pack proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/Quake2Pack.zip -pack QuakePack GPL zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/Quake1Pack.zip +pack Quake2Pack proprietary zip1 http://ingar.satgnu.net/files/netradiant/gamepacks/Quake2Pack.zip +pack QuakePack GPL zip1 http://ingar.satgnu.net/files/netradiant/gamepacks/Quake1Pack.zip pack QuetooPack GPL svn svn://svn.icculus.org/gtkradiant-gamepacks/QuetooPack/branches/1.5/ -pack TremulousPack proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/TremulousPack.zip +pack TremulousPack proprietary zip1 http://ingar.satgnu.net/files/netradiant/gamepacks/TremulousPack.zip pack UFOAIPack proprietary svn svn://svn.icculus.org/gtkradiant-gamepacks/UFOAIPack/branches/1.5/ #pack WarsowPack GPL svn https://svn.bountysource.com/wswpack/trunk/netradiant/games/WarsowPack/ -#pack WarsowPack GPL zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/WarsowPack.zip +#pack WarsowPack GPL zip1 http://ingar.satgnu.net/files/netradiant/gamepacks/WarsowPack.zip pack WarsowPack GPL git https://github.com/Warsow/NetRadiantPack.git -pack XonoticPack GPL git http://git.xonotic.org/xonotic/netradiant-xonoticpack.git +pack XonoticPack GPL git https://gitlab.com/xonotic/netradiant-xonoticpack.git diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000..02d7923b --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,47 @@ +add_library(includes + aboutmsg.h + cullable.cpp cullable.h + editable.cpp editable.h + iarchive.cpp iarchive.h + ibrush.cpp ibrush.h + icamera.cpp icamera.h + idatastream.cpp idatastream.h + ieclass.cpp ieclass.h + ientity.cpp ientity.h + ifilesystem.cpp ifilesystem.h + ifiletypes.cpp ifiletypes.h + ifilter.cpp ifilter.h + igl.cpp igl.h + iglrender.cpp iglrender.h + igtkgl.cpp igtkgl.h + iimage.cpp iimage.h + imap.cpp imap.h + imodel.cpp imodel.h + ipatch.cpp ipatch.h + iplugin.cpp iplugin.h + ireference.cpp ireference.h + irender.cpp irender.h + iscenegraph.cpp iscenegraph.h + iscriplib.cpp iscriplib.h + iselection.cpp iselection.h + ishaders.cpp ishaders.h + itexdef.cpp itexdef.h + itextstream.cpp itextstream.h + itextures.cpp itextures.h + itoolbar.cpp itoolbar.h + iundo.cpp iundo.h + mapfile.cpp mapfile.h + modelskin.cpp modelskin.h + moduleobserver.cpp moduleobserver.h + modulesystem.cpp modulesystem.h + nameable.cpp nameable.h + namespace.cpp namespace.h + preferencesystem.cpp preferencesystem.h + qerplugin.cpp qerplugin.h + renderable.cpp renderable.h + selectable.cpp selectable.h + stream_version.h + version.h + warnings.h + windowobserver.cpp windowobserver.h + ) diff --git a/include/ipatch.h b/include/ipatch.h index e9bee3d7..81cba69a 100644 --- a/include/ipatch.h +++ b/include/ipatch.h @@ -22,6 +22,7 @@ #if !defined( INCLUDED_IPATCH_H ) #define INCLUDED_IPATCH_H +#include "debugging/debugging.h" #include "generic/constant.h" #include "generic/vector.h" diff --git a/install-gamepacks.sh b/install-gamepacks.sh index f4ae8428..2e3723da 100755 --- a/install-gamepacks.sh +++ b/install-gamepacks.sh @@ -4,15 +4,16 @@ : ${SH:=sh} : ${CP:=cp} : ${CP_R:=cp -r} +: ${SOURCE_DIR:=.} dest=$1 case "$DOWNLOAD_GAMEPACKS" in yes) - LICENSEFILTER=GPL BATCH=1 $SH download-gamepacks.sh + LICENSEFILTER=GPL BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh" ;; all) - BATCH=1 $SH download-gamepacks.sh + BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh" ;; *) ;; @@ -22,9 +23,9 @@ set -e for GAME in games/*; do if [ "$GAME" = "games/*" ]; then $ECHO "Game packs not found, please run" - $ECHO " ./download-gamepacks.sh" + $ECHO " $SOURCE_DIR/download-gamepacks.sh" $ECHO "and then try again!" else - $SH install-gamepack.sh "$GAME" "$dest" + $SH "$SOURCE_DIR/install-gamepack.sh" "$GAME" "$dest" fi done diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt new file mode 100644 index 00000000..05055be5 --- /dev/null +++ b/libs/CMakeLists.txt @@ -0,0 +1,61 @@ +add_subdirectory(cmdlib) +add_subdirectory(container) +add_subdirectory(ddslib) +add_subdirectory(debugging) +add_subdirectory(etclib) +add_subdirectory(filematch) +add_subdirectory(generic) +if (BUILD_RADIANT) + add_subdirectory(gtkutil) +endif () +add_subdirectory(l_net) +add_subdirectory(math) +add_subdirectory(mathlib) +add_subdirectory(memory) +add_subdirectory(modulesystem) +add_subdirectory(os) +add_subdirectory(picomodel) +add_subdirectory(profile) +add_subdirectory(script) +add_subdirectory(signal) +add_subdirectory(splines) +add_subdirectory(stream) +add_subdirectory(string) +add_subdirectory(uilib) +add_subdirectory(xml) + +add_library(libs + archivelib.cpp archivelib.h + bytebool.cpp bytebool.h + bytestreamutils.cpp bytestreamutils.h + character.cpp character.h + convert.cpp convert.h + dragplanes.cpp dragplanes.h + eclasslib.cpp eclasslib.h + entitylib.cpp entitylib.h + entityxml.cpp entityxml.h + fs_filesystem.cpp fs_filesystem.h + fs_path.cpp fs_path.h + imagelib.cpp imagelib.h + instancelib.cpp instancelib.h + maplib.cpp maplib.h + moduleobservers.cpp moduleobservers.h + pivot.cpp pivot.h + render.cpp render.h + scenelib.cpp scenelib.h + selectionlib.cpp selectionlib.h + shaderlib.cpp shaderlib.h + str.cpp str.h + stringio.cpp stringio.h + texturelib.cpp texturelib.h + transformlib.cpp transformlib.h + traverselib.cpp traverselib.h + typesystem.cpp typesystem.h + undolib.cpp undolib.h + uniquenames.cpp uniquenames.h + versionlib.cpp versionlib.h + ) + +find_package(GLIB REQUIRED) +target_include_directories(libs PRIVATE ${GLIB_INCLUDE_DIRS}) +target_link_libraries(libs PRIVATE ${GLIB_LIBRARIES}) diff --git a/libs/cmdlib/.cvswrappers b/libs/cmdlib/.cvswrappers deleted file mode 100644 index ed97d402..00000000 --- a/libs/cmdlib/.cvswrappers +++ /dev/null @@ -1,3 +0,0 @@ -*.dsp -m 'COPY' -k 'b' -*.dsw -m 'COPY' -k 'b' -*.scc -m 'COPY' -k 'b' diff --git a/libs/cmdlib/CMakeLists.txt b/libs/cmdlib/CMakeLists.txt new file mode 100644 index 00000000..5d25ce82 --- /dev/null +++ b/libs/cmdlib/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(cmdlib + cmdlib.cpp ../cmdlib.h + ) diff --git a/libs/container/CMakeLists.txt b/libs/container/CMakeLists.txt new file mode 100644 index 00000000..bd3c8ce2 --- /dev/null +++ b/libs/container/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(container + array.cpp array.h + cache.cpp cache.h + container.cpp container.h + hashfunc.cpp hashfunc.h + hashtable.cpp hashtable.h + stack.cpp stack.h + ) diff --git a/libs/container/container.h b/libs/container/container.h index 47f823e6..a2d1fec9 100644 --- a/libs/container/container.h +++ b/libs/container/container.h @@ -22,6 +22,7 @@ #if !defined( INCLUDED_CONTAINER_CONTAINER_H ) #define INCLUDED_CONTAINER_CONTAINER_H +#include #include #include diff --git a/libs/ddslib/CMakeLists.txt b/libs/ddslib/CMakeLists.txt new file mode 100644 index 00000000..d4de1a7c --- /dev/null +++ b/libs/ddslib/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(ddslib + ddslib.c ../ddslib.h + ) diff --git a/libs/debugging/CMakeLists.txt b/libs/debugging/CMakeLists.txt new file mode 100644 index 00000000..e5880de3 --- /dev/null +++ b/libs/debugging/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(debugging + debugging.cpp debugging.h + ) diff --git a/libs/etclib/CMakeLists.txt b/libs/etclib/CMakeLists.txt new file mode 100644 index 00000000..8d8fb23a --- /dev/null +++ b/libs/etclib/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(etclib + ../etclib.c ../etclib.h + ) diff --git a/libs/filematch/CMakeLists.txt b/libs/filematch/CMakeLists.txt new file mode 100644 index 00000000..c7d8a9ed --- /dev/null +++ b/libs/filematch/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(filematch + ../filematch.c ../filematch.h + ) diff --git a/libs/generic/CMakeLists.txt b/libs/generic/CMakeLists.txt new file mode 100644 index 00000000..38004238 --- /dev/null +++ b/libs/generic/CMakeLists.txt @@ -0,0 +1,14 @@ +add_library(generic + arrayrange.cpp arrayrange.h + bitfield.cpp bitfield.h + callback.cpp callback.h + callbackfwd.cpp callbackfwd.h + constant.cpp constant.h + enumeration.cpp enumeration.h + functional.cpp functional.h + object.cpp object.h + reference.cpp reference.h + referencecounted.cpp referencecounted.h + static.cpp static.h + vector.cpp vector.h + ) diff --git a/libs/gtkutil/CMakeLists.txt b/libs/gtkutil/CMakeLists.txt new file mode 100644 index 00000000..fea03d80 --- /dev/null +++ b/libs/gtkutil/CMakeLists.txt @@ -0,0 +1,35 @@ +add_library(gtkutil + accelerator.cpp accelerator.h + button.cpp button.h + clipboard.cpp clipboard.h + closure.cpp closure.h + container.cpp container.h + cursor.cpp cursor.h + dialog.cpp dialog.h + entry.cpp entry.h + filechooser.cpp filechooser.h + frame.cpp frame.h + glfont.cpp glfont.h + glwidget.cpp glwidget.h + idledraw.cpp idledraw.h + image.cpp image.h + menu.cpp menu.h + messagebox.cpp messagebox.h + nonmodal.cpp nonmodal.h + paned.cpp paned.h + pointer.cpp pointer.h + toolbar.cpp toolbar.h + widget.cpp widget.h + window.cpp window.h + xorrectangle.cpp xorrectangle.h + ) + +target_include_directories(gtkutil PRIVATE uilib) +target_link_libraries(gtkutil PRIVATE uilib) + +target_include_directories(gtkutil PRIVATE ${GTK2_PANGO_INCLUDE_DIR}) +target_link_libraries(gtkutil PRIVATE ${GTK2_PANGO_LIBRARY}) + +find_package(GtkGLExt REQUIRED) +target_include_directories(gtkutil PRIVATE ${GTKGL_INCLUDE_DIRS}) +target_link_libraries(gtkutil PRIVATE ${GTKGL_LIBRARIES}) diff --git a/libs/l_net/CMakeLists.txt b/libs/l_net/CMakeLists.txt new file mode 100644 index 00000000..a0a19a84 --- /dev/null +++ b/libs/l_net/CMakeLists.txt @@ -0,0 +1,14 @@ +set(L_NETLIST + l_net.c l_net.h + ) +if (WIN32) + list(APPEND L_NETLIST l_net_wins.c l_net_wins.h) +else () + list(APPEND L_NETLIST l_net_berkley.c) +endif () + +add_library(l_net ${L_NETLIST}) + +if (WIN32) + target_link_libraries(l_net PRIVATE ws2_32) +endif () diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt new file mode 100644 index 00000000..4a5b4bdf --- /dev/null +++ b/libs/math/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(math + aabb.cpp aabb.h + curve.cpp curve.h + frustum.cpp frustum.h + line.cpp line.h + matrix.cpp matrix.h + pi.cpp pi.h + plane.cpp plane.h + quaternion.cpp quaternion.h + vector.cpp vector.h + ) diff --git a/libs/mathlib/CMakeLists.txt b/libs/mathlib/CMakeLists.txt new file mode 100644 index 00000000..5682a5e1 --- /dev/null +++ b/libs/mathlib/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(mathlib + bbox.c + line.c + m4x4.c + mathlib.c ../mathlib.h + ray.c + ) diff --git a/libs/memory/CMakeLists.txt b/libs/memory/CMakeLists.txt new file mode 100644 index 00000000..1c345734 --- /dev/null +++ b/libs/memory/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(memory + allocator.cpp allocator.h + ) diff --git a/libs/modulesystem/CMakeLists.txt b/libs/modulesystem/CMakeLists.txt new file mode 100644 index 00000000..764d3eb4 --- /dev/null +++ b/libs/modulesystem/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(modulesystem + moduleregistry.cpp moduleregistry.h + modulesmap.cpp modulesmap.h + singletonmodule.cpp singletonmodule.h + ) diff --git a/libs/os/CMakeLists.txt b/libs/os/CMakeLists.txt new file mode 100644 index 00000000..c6a4eb4c --- /dev/null +++ b/libs/os/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library(os + dir.cpp dir.h + file.cpp file.h + path.cpp path.h + ) + +find_package(GLIB REQUIRED) +target_include_directories(os PRIVATE ${GLIB_INCLUDE_DIRS}) +target_link_libraries(os PRIVATE ${GLIB_LIBRARIES}) diff --git a/libs/picomodel/CMakeLists.txt b/libs/picomodel/CMakeLists.txt new file mode 100644 index 00000000..0f1286d0 --- /dev/null +++ b/libs/picomodel/CMakeLists.txt @@ -0,0 +1,26 @@ +add_library(picomodel + lwo/clip.c + lwo/envelope.c + lwo/list.c + lwo/lwio.c + lwo/lwo2.c lwo/lwo2.h + lwo/lwob.c + lwo/pntspols.c + lwo/surface.c + lwo/vecmath.c + lwo/vmap.c + + picointernal.c picointernal.h + picomodel.c ../picomodel.h + picomodules.c + pm_3ds.c + pm_ase.c + pm_fm.c pm_fm.h + pm_lwo.c + pm_md2.c + pm_md3.c + pm_mdc.c + pm_ms3d.c + pm_obj.c + pm_terrain.c + ) diff --git a/libs/profile/CMakeLists.txt b/libs/profile/CMakeLists.txt new file mode 100644 index 00000000..e3822f42 --- /dev/null +++ b/libs/profile/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(profile + file.cpp file.h + profile.cpp profile.h + ) diff --git a/libs/script/CMakeLists.txt b/libs/script/CMakeLists.txt new file mode 100644 index 00000000..ba2b00ec --- /dev/null +++ b/libs/script/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(script + scripttokeniser.cpp scripttokeniser.h + scripttokenwriter.cpp scripttokenwriter.h + ) diff --git a/libs/signal/CMakeLists.txt b/libs/signal/CMakeLists.txt new file mode 100644 index 00000000..4b7cc94f --- /dev/null +++ b/libs/signal/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(signal + isignal.cpp isignal.h + signal.cpp signal.h + signalfwd.cpp signalfwd.h + ) diff --git a/libs/splines/CMakeLists.txt b/libs/splines/CMakeLists.txt new file mode 100644 index 00000000..3a6b603d --- /dev/null +++ b/libs/splines/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(splines + math_angles.cpp math_angles.h + math_matrix.cpp math_matrix.h + math_quaternion.cpp math_quaternion.h + math_vector.cpp math_vector.h + q_parse.cpp + q_shared.cpp q_shared.h + splines.cpp splines.h + util_list.h + util_str.cpp util_str.h + ) diff --git a/libs/stream/CMakeLists.txt b/libs/stream/CMakeLists.txt new file mode 100644 index 00000000..9f8fb265 --- /dev/null +++ b/libs/stream/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(stream + filestream.cpp filestream.h + memstream.cpp memstream.h + stringstream.cpp stringstream.h + textfilestream.cpp textfilestream.h + textstream.cpp textstream.h + ) diff --git a/libs/string/CMakeLists.txt b/libs/string/CMakeLists.txt new file mode 100644 index 00000000..d5e851ea --- /dev/null +++ b/libs/string/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(string + pooledstring.cpp pooledstring.h + string.cpp string.h + stringfwd.cpp stringfwd.h + ) diff --git a/libs/uilib/CMakeLists.txt b/libs/uilib/CMakeLists.txt new file mode 100644 index 00000000..c664d9c0 --- /dev/null +++ b/libs/uilib/CMakeLists.txt @@ -0,0 +1,10 @@ +add_library(uilib + uilib.cpp + ) + +find_package(GTK2 REQUIRED) +target_include_directories(uilib PUBLIC ${GTK2_INCLUDE_DIRS}) +target_link_libraries(uilib PUBLIC ${GTK2_LIBRARIES}) + +target_include_directories(uilib PUBLIC gtkutil) +target_link_libraries(uilib PUBLIC gtkutil) diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp new file mode 100644 index 00000000..e69de29b diff --git a/libs/xml/CMakeLists.txt b/libs/xml/CMakeLists.txt new file mode 100644 index 00000000..e7cdb61c --- /dev/null +++ b/libs/xml/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(xmllib + ixml.cpp ixml.h + xmlelement.cpp xmlelement.h + xmlparser.cpp xmlparser.h + xmltextags.cpp xmltextags.h + xmlwriter.cpp xmlwriter.h + ) + +find_package(GLIB REQUIRED) +target_include_directories(xmllib PUBLIC ${GLIB_INCLUDE_DIRS}) +target_link_libraries(xmllib PUBLIC ${GLIB_LIBRARIES}) + +find_package(LibXml2 REQUIRED) +target_include_directories(xmllib PUBLIC ${LIBXML2_INCLUDE_DIR}) +target_link_libraries(xmllib PUBLIC ${LIBXML2_LIBRARIES}) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt new file mode 100644 index 00000000..f2c0c172 --- /dev/null +++ b/plugins/CMakeLists.txt @@ -0,0 +1,23 @@ +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/modules") + +add_custom_target(modules) +macro(radiant_plugin name) + message(STATUS "Found Module ${name}") + add_library(${name} MODULE ${ARGN}) + add_dependencies(modules ${name}) +endmacro() + +add_subdirectory(archivepak) +add_subdirectory(archivewad) +add_subdirectory(archivezip) +add_subdirectory(entity) +add_subdirectory(image) +add_subdirectory(imagehl) +add_subdirectory(imagepng) +add_subdirectory(imageq2) +add_subdirectory(mapq3) +add_subdirectory(mapxml) +add_subdirectory(md3model) +add_subdirectory(model) +add_subdirectory(shaders) +add_subdirectory(vfspk3) diff --git a/plugins/archivepak/CMakeLists.txt b/plugins/archivepak/CMakeLists.txt new file mode 100644 index 00000000..4b3657ed --- /dev/null +++ b/plugins/archivepak/CMakeLists.txt @@ -0,0 +1,5 @@ +radiant_plugin(archivepak + archive.cpp archive.h + pak.cpp pak.h + plugin.cpp plugin.h + ) diff --git a/plugins/archivewad/CMakeLists.txt b/plugins/archivewad/CMakeLists.txt new file mode 100644 index 00000000..27a3e95f --- /dev/null +++ b/plugins/archivewad/CMakeLists.txt @@ -0,0 +1,5 @@ +radiant_plugin(archivewad + archive.cpp archive.h + plugin.cpp plugin.h + wad.cpp wad.h + ) diff --git a/plugins/archivezip/CMakeLists.txt b/plugins/archivezip/CMakeLists.txt new file mode 100644 index 00000000..e47b7f7d --- /dev/null +++ b/plugins/archivezip/CMakeLists.txt @@ -0,0 +1,10 @@ +radiant_plugin(archivezip + archive.cpp archive.h + pkzip.cpp pkzip.h + plugin.cpp plugin.h + zlibstream.cpp zlibstream.h + ) + +find_package(ZLIB REQUIRED) +target_include_directories(archivezip PRIVATE ${ZLIB_INCLUDE_DIRS}) +target_link_libraries(archivezip PRIVATE ${ZLIB_LIBRARIES}) diff --git a/plugins/entity/CMakeLists.txt b/plugins/entity/CMakeLists.txt new file mode 100644 index 00000000..b2911ed5 --- /dev/null +++ b/plugins/entity/CMakeLists.txt @@ -0,0 +1,25 @@ +radiant_plugin(entity + angle.cpp angle.h + angles.cpp angles.h + colour.cpp colour.h + curve.cpp curve.h + doom3group.cpp doom3group.h + eclassmodel.cpp eclassmodel.h + entity.cpp entity.h + filters.cpp filters.h + generic.cpp generic.h + group.cpp group.h + keyobservers.cpp keyobservers.h + light.cpp light.h + miscmodel.cpp miscmodel.h + model.cpp model.h + modelskinkey.cpp modelskinkey.h + namedentity.cpp namedentity.h + namekeys.cpp namekeys.h + origin.cpp origin.h + plugin.cpp plugin.h + rotation.cpp rotation.h + scale.cpp scale.h + skincache.cpp skincache.h + targetable.cpp targetable.h + ) diff --git a/plugins/image/CMakeLists.txt b/plugins/image/CMakeLists.txt new file mode 100644 index 00000000..07341c08 --- /dev/null +++ b/plugins/image/CMakeLists.txt @@ -0,0 +1,13 @@ +radiant_plugin(image + bmp.cpp bmp.h + dds.cpp dds.h + image.cpp image.h + jpeg.cpp jpeg.h + ktx.cpp ktx.h + pcx.cpp pcx.h + tga.cpp tga.h + ) + +find_package(JPEG REQUIRED) +target_include_directories(image PRIVATE ${JPEG_INCLUDE_DIR}) +target_link_libraries(image PRIVATE ddslib etclib ${JPEG_LIBRARIES}) diff --git a/plugins/imagehl/CMakeLists.txt b/plugins/imagehl/CMakeLists.txt new file mode 100644 index 00000000..f6541776 --- /dev/null +++ b/plugins/imagehl/CMakeLists.txt @@ -0,0 +1,6 @@ +radiant_plugin(imagehl + hlw.cpp hlw.h + imagehl.cpp imagehl.h + mip.cpp mip.h + sprite.cpp sprite.h + ) diff --git a/plugins/imagepng/CMakeLists.txt b/plugins/imagepng/CMakeLists.txt new file mode 100644 index 00000000..ec03da60 --- /dev/null +++ b/plugins/imagepng/CMakeLists.txt @@ -0,0 +1,7 @@ +radiant_plugin(imagepng + plugin.cpp plugin.h + ) + +find_package(PNG REQUIRED) +target_include_directories(imagepng PRIVATE ${PNG_INCLUDE_DIR}) +target_link_libraries(imagepng PRIVATE ${PNG_LIBRARIES}) diff --git a/plugins/imageq2/CMakeLists.txt b/plugins/imageq2/CMakeLists.txt new file mode 100644 index 00000000..7ba65cdd --- /dev/null +++ b/plugins/imageq2/CMakeLists.txt @@ -0,0 +1,5 @@ +radiant_plugin(imageq2 + imageq2.cpp imageq2.h + wal.cpp wal.h + wal32.cpp wal32.h + ) diff --git a/plugins/mapq3/CMakeLists.txt b/plugins/mapq3/CMakeLists.txt new file mode 100644 index 00000000..f743d076 --- /dev/null +++ b/plugins/mapq3/CMakeLists.txt @@ -0,0 +1,5 @@ +radiant_plugin(mapq3 + parse.cpp parse.h + plugin.cpp plugin.h + write.cpp write.h + ) diff --git a/plugins/mapxml/CMakeLists.txt b/plugins/mapxml/CMakeLists.txt new file mode 100644 index 00000000..47596d37 --- /dev/null +++ b/plugins/mapxml/CMakeLists.txt @@ -0,0 +1,8 @@ +radiant_plugin(mapxml + plugin.cpp plugin.h + xmlparse.cpp xmlparse.h + xmlwrite.cpp xmlwrite.h + ) + +target_include_directories(mapxml PRIVATE xmllib) +target_link_libraries(mapxml PRIVATE xmllib) diff --git a/plugins/md3model/CMakeLists.txt b/plugins/md3model/CMakeLists.txt new file mode 100644 index 00000000..23e51dba --- /dev/null +++ b/plugins/md3model/CMakeLists.txt @@ -0,0 +1,14 @@ +radiant_plugin(md3model + ident.h + md2.cpp md2.h + md3.cpp md3.h + md3normals.cpp md3normals.h + md5.cpp md5.h + mdc.cpp mdc.h + mdl.cpp mdl.h + mdlformat.cpp mdlformat.h + mdlimage.cpp mdlimage.h + mdlnormals.cpp mdlnormals.h + model.cpp model.h + plugin.cpp plugin.h + ) diff --git a/plugins/model/CMakeLists.txt b/plugins/model/CMakeLists.txt new file mode 100644 index 00000000..780cc080 --- /dev/null +++ b/plugins/model/CMakeLists.txt @@ -0,0 +1,7 @@ +radiant_plugin(model + model.cpp model.h + plugin.cpp plugin.h + ) + +target_include_directories(model PRIVATE picomodel) +target_link_libraries(model PRIVATE picomodel) diff --git a/plugins/sample/CMakeLists.txt b/plugins/sample/CMakeLists.txt new file mode 100644 index 00000000..8eeb07b3 --- /dev/null +++ b/plugins/sample/CMakeLists.txt @@ -0,0 +1,3 @@ +radiant_plugin(sample + sample.cpp sample.h + ) diff --git a/plugins/shaders/CMakeLists.txt b/plugins/shaders/CMakeLists.txt new file mode 100644 index 00000000..8f91f0ba --- /dev/null +++ b/plugins/shaders/CMakeLists.txt @@ -0,0 +1,8 @@ +radiant_plugin(shaders + plugin.cpp plugin.h + shaders.cpp shaders.h + ) + +find_package(GLIB REQUIRED) +target_include_directories(shaders PRIVATE ${GLIB_INCLUDE_DIRS}) +target_link_libraries(shaders PRIVATE ${GLIB_LIBRARIES}) diff --git a/plugins/textool/.cvswrappers b/plugins/textool/.cvswrappers deleted file mode 100644 index 21e5b0a3..00000000 --- a/plugins/textool/.cvswrappers +++ /dev/null @@ -1,2 +0,0 @@ -*.dsp -m 'COPY' -k 'b' -*.rc -m 'COPY' -k 'b' diff --git a/plugins/textool/Doc/.cvswrappers b/plugins/textool/Doc/.cvswrappers deleted file mode 100644 index 89bb1f8b..00000000 --- a/plugins/textool/Doc/.cvswrappers +++ /dev/null @@ -1 +0,0 @@ -*.jpg -m 'COPY' -k 'b' diff --git a/plugins/vfspk3/CMakeLists.txt b/plugins/vfspk3/CMakeLists.txt new file mode 100644 index 00000000..6b6b0c81 --- /dev/null +++ b/plugins/vfspk3/CMakeLists.txt @@ -0,0 +1,12 @@ +radiant_plugin(vfspk3 + archive.cpp archive.h + vfs.cpp vfs.h + vfspk3.cpp vfspk3.h + ) + +find_package(GLIB REQUIRED) +target_include_directories(vfspk3 PRIVATE ${GLIB_INCLUDE_DIRS}) +target_link_libraries(vfspk3 PRIVATE ${GLIB_LIBRARIES}) + +target_include_directories(vfspk3 PRIVATE filematch) +target_link_libraries(vfspk3 PRIVATE filematch) diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt new file mode 100644 index 00000000..a882ffe2 --- /dev/null +++ b/radiant/CMakeLists.txt @@ -0,0 +1,129 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") + +find_package(OpenGL REQUIRED) + +string(SUBSTRING ${CMAKE_SHARED_MODULE_SUFFIX} 1 -1 _clibext) +add_definitions(-DCMAKE_SHARED_MODULE_SUFFIX="${_clibext}") +unset(_clibext) + +set(RADIANTLIST + autosave.cpp autosave.h + brush.cpp brush.h + brush_primit.cpp brush_primit.h + brushmanip.cpp brushmanip.h + brushmodule.cpp brushmodule.h + brushnode.cpp brushnode.h + brushtokens.cpp brushtokens.h + brushxml.cpp brushxml.h + build.cpp build.h + camwindow.cpp camwindow.h + clippertool.cpp clippertool.h + commands.cpp commands.h + console.cpp console.h + csg.cpp csg.h + dialog.cpp dialog.h + eclass.cpp eclass.h + eclass_def.cpp eclass_def.h + eclass_doom3.cpp eclass_doom3.h + eclass_fgd.cpp eclass_fgd.h + eclass_xml.cpp eclass_xml.h + entity.cpp entity.h + entityinspector.cpp entityinspector.h + entitylist.cpp entitylist.h + environment.cpp environment.h + error.cpp error.h + feedback.cpp feedback.h + filetypes.cpp filetypes.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 + help.cpp help.h + image.cpp image.h + main.cpp main.h + mainframe.cpp mainframe.h + map.cpp map.h + mru.cpp mru.h + nullmodel.cpp nullmodel.h + parse.cpp parse.h + patch.cpp patch.h + patchdialog.cpp patchdialog.h + patchmanip.cpp patchmanip.h + patchmodule.cpp patchmodule.h + plugin.cpp plugin.h + pluginapi.cpp pluginapi.h + pluginmanager.cpp pluginmanager.h + pluginmenu.cpp pluginmenu.h + plugintoolbar.cpp plugintoolbar.h + points.cpp points.h + preferencedictionary.cpp preferencedictionary.h + preferences.cpp preferences.h + qe3.cpp qe3.h + qgl.cpp qgl.h + referencecache.cpp referencecache.h + renderer.cpp renderer.h + renderstate.cpp renderstate.h + resource.h + scenegraph.cpp scenegraph.h + select.cpp select.h + selection.cpp selection.h + server.cpp server.h + shaders.cpp shaders.h + sockets.cpp sockets.h + stacktrace.cpp stacktrace.h + surfacedialog.cpp surfacedialog.h + texmanip.cpp texmanip.h + textureentry.cpp textureentry.h + textures.cpp textures.h + texwindow.cpp texwindow.h + timer.cpp timer.h + treemodel.cpp treemodel.h + undo.cpp undo.h + url.cpp url.h + view.cpp view.h + watchbsp.cpp watchbsp.h + winding.cpp winding.h + windowobservers.cpp windowobservers.h + xmlstuff.cpp xmlstuff.h + xywindow.cpp xywindow.h +) +if (WIN32) + list(APPEND RADIANTLIST multimon.cpp multimon.h) +endif() + +add_executable(radiant WIN32 radiant.rc ${RADIANTLIST}) +target_link_libraries(radiant + ${CMAKE_DL_LIBS} + ${LIBXML2_LIBRARIES} + ${OPENGL_gl_LIBRARY} + ${GTKGL_LIBRARIES} + includes + cmdlib + container + ddslib + debugging + etclib + filematch + generic + l_net + math + mathlib + memory + modulesystem + os + picomodel + profile + script + signal + splines + stream + string + uilib + xmllib +) +if (X11_LIBRARIES) + target_link_libraries(radiant ${X11_LIBRARIES}) +endif () diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index a91dccdd..0e430f11 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -532,7 +532,9 @@ void operator()( const char* name ) const { }; const char* const c_library_extension = -#if defined( WIN32 ) +#if defined( CMAKE_SHARED_MODULE_SUFFIX ) + CMAKE_SHARED_MODULE_SUFFIX +#elif defined( WIN32 ) "dll" #elif defined ( __APPLE__ ) "dylib" diff --git a/radiant/qgl.cpp b/radiant/qgl.cpp index 2e44768c..6cc9d7ca 100644 --- a/radiant/qgl.cpp +++ b/radiant/qgl.cpp @@ -33,7 +33,11 @@ #define APIENTRY __stdcall #endif +#if defined( __APPLE__ ) && !defined( XWINDOWS ) +#include +#else #include +#endif #if defined( _WIN32 ) #undef WINGDIAPI @@ -61,6 +65,10 @@ Bool ( *qglXQueryExtension )( Display *dpy, int *errorb, int *event ); void* ( *qglXGetProcAddressARB )( const GLubyte * procName ); typedef void* ( *glXGetProcAddressARBProc )( const GLubyte *procName ); +#elif defined(__APPLE__) +#include +#include +#include #else #error "unsupported platform" #endif @@ -74,6 +82,7 @@ void QGL_Shutdown( OpenGLBinding& table ){ #elif defined( XWINDOWS ) qglXQueryExtension = glXQueryExtension; qglXGetProcAddressARB = 0; +#elif defined(__APPLE__) #else #error "unsupported platform" #endif @@ -171,6 +180,15 @@ QGLFunctionPointer QGL_getExtensionFunc( const char* symbol ){ { return (QGLFunctionPointer) qglXGetProcAddressARB( reinterpret_cast( symbol ) ); } +#elif defined(__APPLE__) + // Prepend a '_' for the Unix C symbol mangling convention + char *symbolName = (char *) malloc(strlen(symbol) + 2); + strcpy(symbolName + 1, symbol); + symbolName[0] = '_'; + NSSymbol nssymbol = NULL; + if (NSIsSymbolNameDefined(symbolName)) nssymbol = NSLookupAndBindSymbol(symbolName); + free(symbolName); + return nssymbol ? reinterpret_cast(NSAddressOfSymbol(nssymbol)) : reinterpret_cast(glInvalidFunction); #elif defined( WIN32 ) ASSERT_NOTNULL( qwglGetProcAddress ); return (QGLFunctionPointer) qwglGetProcAddress( symbol ); @@ -540,6 +558,7 @@ int QGL_Init( OpenGLBinding& table ){ if ( ( qglXQueryExtension == 0 ) || ( qglXQueryExtension( GDK_DISPLAY(),0,0 ) != True ) ) { return 0; } +#elif defined (__APPLE__) #else #error "unsupported platform" #endif diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 00000000..94cbbe5b --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,13 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") + +macro(radiant_tool name) + add_executable(${name} ${ARGN}) + if (NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL RADIANT_EXECUTABLE)) + add_custom_command(TARGET ${name} POST_BUILD + COMMAND ln -f -s "$" "${PROJECT_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}" + VERBATIM + ) + endif () +endmacro() + +add_subdirectory(quake3) diff --git a/tools/quake3/CMakeLists.txt b/tools/quake3/CMakeLists.txt new file mode 100644 index 00000000..adb6dc73 --- /dev/null +++ b/tools/quake3/CMakeLists.txt @@ -0,0 +1,165 @@ +include_directories(BEFORE common) + +set(Q3MAP_VERSION 2.5.17n) +find_package(Git REQUIRED) +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if (GIT_VERSION) + set(Q3MAP_VERSION "${Q3MAP_VERSION}-git-${GIT_VERSION}") +endif () +add_definitions(-DQ3MAP_VERSION="${Q3MAP_VERSION}") + +find_package(GLIB REQUIRED) +include_directories(${GLIB_INCLUDE_DIRS}) + +find_package(JPEG REQUIRED) +include_directories(${JPEG_INCLUDE_DIR}) + +find_package(PNG REQUIRED) +include_directories(${PNG_INCLUDE_DIR}) + +find_package(LibXml2 REQUIRED) +include_directories(${LIBXML2_INCLUDE_DIR}) + +find_package(ZLIB REQUIRED) +include_directories(${ZLIB_INCLUDE_DIRS}) + +set(q3map2_games + q3map2/game_darkplaces.h + q3map2/game_dq.h + q3map2/game_ef.h + q3map2/game_etut.h + q3map2/game_ja.h + q3map2/game_jk2.h + q3map2/game_nexuiz.h + q3map2/game_prophecy.h + q3map2/game_qfusion.h + q3map2/game_quake3.h + q3map2/game_quakelive.h + q3map2/game_reaction.h + q3map2/game_sof2.h + q3map2/game_tenebrae.h + q3map2/game_tremulous.h + q3map2/game_wolf.h + q3map2/game_wolfet.h + q3map2/game_xonotic.h + ) + +radiant_tool(q3map2 + common/cmdlib.c common/cmdlib.h + common/imagelib.c common/imagelib.h + common/inout.c common/inout.h + common/jpeg.c + common/md4.c common/md4.h + common/mutex.c common/mutex.h + common/polylib.c common/polylib.h + common/polyset.h + common/qfiles.h + common/qthreads.h + common/scriplib.c common/scriplib.h + common/surfaceflags.h + common/threads.c + common/unzip.c common/unzip.h + common/vfs.c common/vfs.h + + q3map2/brush.c + q3map2/brush_primit.c + q3map2/bsp.c + q3map2/bspfile_abstract.c + q3map2/bspfile_ibsp.c + q3map2/bspfile_rbsp.c + q3map2/convert_ase.c + q3map2/convert_map.c + q3map2/convert_obj.c + q3map2/decals.c + q3map2/facebsp.c + q3map2/fog.c + ${q3map2_games} q3map2/game__null.h + q3map2/image.c + q3map2/leakfile.c + q3map2/light.c + q3map2/light_bounce.c + q3map2/light_trace.c + q3map2/light_ydnar.c + q3map2/lightmaps_ydnar.c + q3map2/main.c + q3map2/map.c + q3map2/mesh.c + q3map2/model.c + q3map2/patch.c + q3map2/path_init.c + q3map2/portals.c + q3map2/prtfile.c + q3map2/q3map2.h + q3map2/shaders.c + q3map2/surface.c + q3map2/surface_extra.c + q3map2/surface_foliage.c + q3map2/surface_fur.c + q3map2/surface_meta.c + q3map2/tjunction.c + q3map2/tree.c + q3map2/vis.c + q3map2/visflow.c + q3map2/writebsp.c + ) + +target_link_libraries(q3map2 + ${GLIB_LIBRARIES} + ${JPEG_LIBRARIES} + ${PNG_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${ZLIB_LIBRARIES} + ddslib + etclib + filematch + l_net + mathlib + picomodel + ) + +radiant_tool(q3data + common/aselib.c common/aselib.h + common/bspfile.c common/bspfile.h + common/cmdlib.c common/cmdlib.h + common/imagelib.c common/imagelib.h + common/inout.c common/inout.h + common/md4.c common/md4.h + common/scriplib.c common/scriplib.h + common/trilib.c common/trilib.h + common/unzip.c common/unzip.h + common/vfs.c common/vfs.h + + q3data/3dslib.c q3data/3dslib.h + q3data/compress.c + q3data/images.c + q3data/md3lib.c q3data/md3lib.h + q3data/models.c + q3data/p3dlib.c q3data/p3dlib.h + q3data/polyset.c + q3data/q3data.c q3data/q3data.h + q3data/stripper.c + q3data/video.c + ) + +target_link_libraries(q3data + ${GLIB_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${ZLIB_LIBRARIES} + filematch + etclib + l_net + mathlib + ) + +add_custom_target(quake3) +add_dependencies(quake3 q3map2 q3data) + +if (UNIX) + target_link_libraries(q3map2 pthread m) + target_link_libraries(q3data m) +endif () diff --git a/tools/quake3/q3data/.cvswrappers b/tools/quake3/q3data/.cvswrappers deleted file mode 100644 index 2ea7d171..00000000 --- a/tools/quake3/q3data/.cvswrappers +++ /dev/null @@ -1,2 +0,0 @@ -*.dsp -m 'COPY' -k 'b' -*.dsw -m 'COPY' -k 'b' diff --git a/tools/quake3/q3map2/game_t.h b/tools/quake3/q3map2/game_t.h deleted file mode 100644 index 385afae0..00000000 --- a/tools/quake3/q3map2/game_t.h +++ /dev/null @@ -1,33 +0,0 @@ - -/* - Copyright (C) 1999-2007 id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* ydnar: for -game support */ -typedef struct game_s -{ - char *arg; /* -game matches this */ - char *gamePath; /* main game data dir */ - char *homeBasePath; /* home sub-dir on unix */ - char *magic; /* magic word for figuring out base path */ - qboolean wolfLight; /* when true, lights work like wolf q3map */ - int bspVersion; /* BSP version to use */ -} -game_t; -- 2.39.2