]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
cmake: build quake2 and heretic2 tools to be on par with legacy Makefile
authorThomas Debesse <dev@illwieckz.net>
Sun, 16 Jun 2019 23:07:16 +0000 (01:07 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 18 Jun 2019 21:37:43 +0000 (23:37 +0200)
tools/CMakeLists.txt
tools/quake2/CMakeLists.txt [new file with mode: 0644]
tools/quake2/q2map/q2map.rc [new file with mode: 0644]
tools/quake2/qdata/qdata.rc [new file with mode: 0644]
tools/quake2/qdata_heretic2/CMakeLists.txt [new file with mode: 0644]
tools/quake2/qdata_heretic2/h2data.rc [new file with mode: 0644]
tools/quake2/qdata_heretic2/icon1.ico [deleted file]
tools/quake2/qdata_heretic2/script1.rc [deleted file]

index 4c2c5d28f8a2c81359e1f328831db320091dffc5..b36bb6cf399f9a8761477c021c30d9e6da792d9f 100644 (file)
@@ -1,6 +1,8 @@
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
 
+add_subdirectory(quake2)
+add_subdirectory(quake2/qdata_heretic2)
 add_subdirectory(quake3)
 
 add_custom_target(tools)
-add_dependencies(tools quake3)
+add_dependencies(tools quake2 heretic2 quake3)
diff --git a/tools/quake2/CMakeLists.txt b/tools/quake2/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6945ee6
--- /dev/null
@@ -0,0 +1,99 @@
+include_directories(BEFORE common)
+
+find_package(LibXml2 REQUIRED)
+include_directories(${LIBXML2_INCLUDE_DIR})
+
+radiant_tool(q2map
+    WIN32 q2map/q2map.rc
+
+    common/bspfile.c common/bspfile.h
+    common/cmdlib.c common/cmdlib.h
+    common/inout.c common/inout.h
+    common/l3dslib.c common/l3dslib.h
+    common/lbmlib.c common/lbmlib.h
+    common/mathlib.c common/mathlib.h
+    common/md4.c common/md4.h
+    common/path_init.c
+    common/qfiles.h
+    common/polylib.c common/polylib.h
+    common/scriplib.c common/scriplib.h
+    common/threads.c common/q2_threads.h
+    common/trilib.c common/trilib.h
+    
+    q2map/brushbsp.c
+    q2map/csg.c
+    q2map/faces.c
+    q2map/flow.c
+#   q2map/gldraw.c
+    q2map/glfile.c
+    q2map/leakfile.c
+    q2map/lightmap.c
+    q2map/main.c q2map/q2map.h
+    q2map/map.c
+    q2map/nodraw.c
+    q2map/patches.c
+    q2map/portals.c
+    q2map/prtfile.c
+    q2map/qbsp.c
+    q2map/qbsp.h
+    q2map/qrad.c
+    q2map/qrad.h
+    q2map/qvis.c
+    q2map/qvis.h
+    q2map/textures.c
+    q2map/trace.c
+    q2map/tree.c
+    q2map/writebsp.c
+)
+
+target_compile_definitions(q2map
+    PRIVATE
+)
+
+target_link_libraries(q2map
+    ${LIBXML2_LIBRARIES}
+    l_net
+)
+
+radiant_tool(qdata3
+    WIN32 qdata/qdata.rc
+
+    common/bspfile.c common/bspfile.h
+    common/cmdlib.c common/cmdlib.h
+    common/inout.c common/inout.h
+    common/l3dslib.c common/l3dslib.h
+    common/lbmlib.c common/lbmlib.h
+    common/mathlib.c common/mathlib.h
+    common/md4.c common/md4.h
+    common/path_init.c
+    common/qfiles.h
+    common/polylib.c common/polylib.h
+    common/scriplib.c common/scriplib.h
+    common/threads.c common/q2_threads.h
+    common/trilib.c common/trilib.h
+
+    qdata/anorms.h
+    qdata/images.c
+    qdata/models.c
+    qdata/qdata.c qdata/qdata.h
+    qdata/sprites.c
+    qdata/tables.c
+    qdata/video.c
+)
+
+target_compile_definitions(qdata3
+    PRIVATE
+)
+
+target_link_libraries(qdata3
+    ${LIBXML2_LIBRARIES}
+    l_net
+)
+
+add_custom_target(quake2)
+add_dependencies(quake2 q2map qdata3)
+
+if (UNIX)
+    target_link_libraries(q2map pthread m)
+    target_link_libraries(qdata3 pthread m)
+endif ()
diff --git a/tools/quake2/q2map/q2map.rc b/tools/quake2/q2map/q2map.rc
new file mode 100644 (file)
index 0000000..29e1dbd
--- /dev/null
@@ -0,0 +1 @@
+101                     ICON    DISCARDABLE     "..\\..\\..\\icons\\q2map.ico"
diff --git a/tools/quake2/qdata/qdata.rc b/tools/quake2/qdata/qdata.rc
new file mode 100644 (file)
index 0000000..d6e75b9
--- /dev/null
@@ -0,0 +1 @@
+101                     ICON    DISCARDABLE     "..\\..\\..\\icons\\qdata3.ico"
diff --git a/tools/quake2/qdata_heretic2/CMakeLists.txt b/tools/quake2/qdata_heretic2/CMakeLists.txt
new file mode 100644 (file)
index 0000000..aae4659
--- /dev/null
@@ -0,0 +1,73 @@
+include_directories(BEFORE . common qcommon)
+
+find_package(OpenGL REQUIRED)
+
+find_package(LibXml2 REQUIRED)
+include_directories(${LIBXML2_INCLUDE_DIR})
+
+radiant_tool(h2data
+    WIN32 h2data.rc
+
+    common/bspfile.c common/bspfile.h
+    common/cmdlib.c common/cmdlib.h
+    common/inout.c common/inout.h
+    common/l3dslib.c common/l3dslib.h
+    common/lbmlib.c common/lbmlib.h
+    common/mathlib.c common/mathlib.h
+    common/md4.c common/md4.h
+    common/path_init.c
+    common/polylib.c common/polylib.h
+    common/qfiles.c common/qfiles.h
+    common/scriplib.c common/scriplib.h
+    common/threads.c common/her2_threads.h
+    common/token.c common/token.h
+    common/trilib.c common/trilib.h
+
+    qcommon/angles.h
+    qcommon/arrayedlist.h
+    qcommon/flex.h
+    qcommon/fmodel.h
+    qcommon/h2common.h
+    qcommon/placement.h
+    qcommon/qfiles.h
+    qcommon/q_typedef.h
+    qcommon/reference.c qcommon/reference.h
+    qcommon/resourcemanager.c qcommon/resourcemanager.h
+    qcommon/skeletons.c qcommon/skeletons.h
+
+    adpcm.h
+    animcomp.c animcomp.h 
+    anorms.h
+    book.c
+    fmodels.c qd_fmodel.h
+    images.c
+    jointed.c
+    jointed.h
+    joints.h
+    models.c
+    pics.c
+    qdata.c qdata.h
+    qd_skeletons.c qd_skeletons.h
+    resource.h
+    sprites.c
+    svdcmp.c
+    tables.c
+    tmix.c
+    video.c
+)
+
+target_compile_definitions(h2data
+    PRIVATE
+)
+
+target_link_libraries(h2data
+    ${LIBXML2_LIBRARIES}
+    l_net
+)
+
+add_custom_target(heretic2)
+add_dependencies(heretic2 h2data)
+
+if (UNIX)
+    target_link_libraries(h2data pthread m)
+endif ()
diff --git a/tools/quake2/qdata_heretic2/h2data.rc b/tools/quake2/qdata_heretic2/h2data.rc
new file mode 100644 (file)
index 0000000..21540bc
--- /dev/null
@@ -0,0 +1,115 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON1               ICON    DISCARDABLE     "..\\..\\..\\icons\\h2data.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "Comments", "Heavily modified from original ID tool\0"
+            VALUE "CompanyName", "Raven Software\0"
+            VALUE "FileDescription", "qdata\0"
+            VALUE "FileVersion", "2.0\0"
+            VALUE "InternalName", "qdata\0"
+            VALUE "LegalCopyright", "Copyright © 1998\0"
+            VALUE "OriginalFilename", "qdata.exe\0"
+            VALUE "ProductName", "Raven Software qdata\0"
+            VALUE "ProductVersion", "2.0\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // !_MAC
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/tools/quake2/qdata_heretic2/icon1.ico b/tools/quake2/qdata_heretic2/icon1.ico
deleted file mode 100644 (file)
index 8f44194..0000000
Binary files a/tools/quake2/qdata_heretic2/icon1.ico and /dev/null differ
diff --git a/tools/quake2/qdata_heretic2/script1.rc b/tools/quake2/qdata_heretic2/script1.rc
deleted file mode 100644 (file)
index 7d05374..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1               ICON    DISCARDABLE     "icon1.ico"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "Comments", "Heavily modified from original ID tool\0"
-            VALUE "CompanyName", "Raven Software\0"
-            VALUE "FileDescription", "qdata\0"
-            VALUE "FileVersion", "2.0\0"
-            VALUE "InternalName", "qdata\0"
-            VALUE "LegalCopyright", "Copyright © 1998\0"
-            VALUE "OriginalFilename", "qdata.exe\0"
-            VALUE "ProductName", "Raven Software qdata\0"
-            VALUE "ProductVersion", "2.0\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-