mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 12:01:25 +00:00
Make some cmake deps more optional. Don't bail when zlib is unavailable.
This commit is contained in:
parent
ed06967318
commit
d5c711014f
2 changed files with 28 additions and 11 deletions
|
@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES(
|
||||||
engine
|
engine
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (EXISTS ${CMAKE_SOURCE_DIR}/.svn)
|
IF (EXISTS ${CMAKE_SOURCE_DIR}/.svn AND "${FTE_REVISON}" STREQUAL "")
|
||||||
EXECUTE_PROCESS(COMMAND
|
EXECUTE_PROCESS(COMMAND
|
||||||
"svnversion"
|
"svnversion"
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
@ -42,7 +42,7 @@ IF (EXISTS ${CMAKE_SOURCE_DIR}/.svn)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF (EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
IF (EXISTS ${CMAKE_SOURCE_DIR}/.git AND "${FTE_REVISON}" STREQUAL "")
|
||||||
EXECUTE_PROCESS(COMMAND
|
EXECUTE_PROCESS(COMMAND
|
||||||
git describe --always --long --dirty
|
git describe --always --long --dirty
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
@ -78,7 +78,7 @@ IF (EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
MATH(EXPR SVNREVISION "${SVNREVISION} + 29") #not all svn commits managed to appear im the git repo, so we have a small bias to keep things consistent.
|
MATH(EXPR SVNREVISION "${SVNREVISION} + 29") #not all svn commits managed to appear im the git repo, so we have a small bias to keep things consistent.
|
||||||
IF (FTE_BRANCH STREQUAL "master")
|
IF (FTE_BRANCH STREQUAL "master" OR FTE_BRANCH STREQUAL "")
|
||||||
SET(SVNREVISION "${SVNREVISION}-git-${FTE_REVISON_GIT}")
|
SET(SVNREVISION "${SVNREVISION}-git-${FTE_REVISON_GIT}")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(SVNREVISION "${FTE_BRANCH}-${SVNREVISION}-git-${FTE_REVISON_GIT}") #weird branches get a different form of revision, to reduce confusion.
|
SET(SVNREVISION "${FTE_BRANCH}-${SVNREVISION}-git-${FTE_REVISON_GIT}") #weird branches get a different form of revision, to reduce confusion.
|
||||||
|
@ -138,7 +138,10 @@ ELSE()
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_ZLIB)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_ZLIB)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_PACKAGE(BZip2)
|
SET(FTE_DEP_BZIP2 true CACHE BOOL "Link against libbzip2.")
|
||||||
|
IF(FTE_DEP_BZIP2)
|
||||||
|
FIND_PACKAGE(BZip2)
|
||||||
|
ENDIF()
|
||||||
IF(BZIP2_FOUND)
|
IF(BZIP2_FOUND)
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};AVAIL_BZLIB;BZLIB_STATIC)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};AVAIL_BZLIB;BZLIB_STATIC)
|
||||||
SET(FTE_LIBS ${FTE_LIBS} bz2)
|
SET(FTE_LIBS ${FTE_LIBS} bz2)
|
||||||
|
@ -170,7 +173,10 @@ ELSE()
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_JPEG)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_JPEG)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_PACKAGE(PNG)
|
SET(FTE_DEP_PNG true CACHE BOOL "Link against libpng.")
|
||||||
|
IF(FTE_DEP_PNG)
|
||||||
|
FIND_PACKAGE(PNG)
|
||||||
|
ENDIF()
|
||||||
IF(PNG_FOUND)
|
IF(PNG_FOUND)
|
||||||
INCLUDE_DIRECTORIES( ${PNG_INCLUDE_DIRS} )
|
INCLUDE_DIRECTORIES( ${PNG_INCLUDE_DIRS} )
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};LIBPNG_STATIC)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};LIBPNG_STATIC)
|
||||||
|
@ -180,7 +186,10 @@ ELSE()
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_PNG)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_PNG)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_PACKAGE(Freetype)
|
SET(FTE_DEP_FREETYPE true CACHE BOOL "Link against libfreetype.")
|
||||||
|
IF(FTE_DEP_FREETYPE)
|
||||||
|
FIND_PACKAGE(Freetype)
|
||||||
|
ENDIF()
|
||||||
IF(FREETYPE_FOUND)
|
IF(FREETYPE_FOUND)
|
||||||
INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} )
|
INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} )
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};LIBFREETYPE_STATIC)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};LIBFREETYPE_STATIC)
|
||||||
|
@ -199,6 +208,7 @@ ELSE()
|
||||||
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_FREETYPE)
|
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};NO_FREETYPE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#this is just for headers.
|
||||||
FIND_PATH(VULKAN_INCLUDE_DIR vulkan/vulkan.h)
|
FIND_PATH(VULKAN_INCLUDE_DIR vulkan/vulkan.h)
|
||||||
IF(VULKAN_INCLUDE_DIR)
|
IF(VULKAN_INCLUDE_DIR)
|
||||||
INCLUDE_DIRECTORIES( ${VULKAN_INCLUDE_DIR} )
|
INCLUDE_DIRECTORIES( ${VULKAN_INCLUDE_DIR} )
|
||||||
|
@ -207,7 +217,10 @@ ELSE()
|
||||||
MESSAGE(WARNING "Vulkan headers NOT available.")
|
MESSAGE(WARNING "Vulkan headers NOT available.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile)
|
SET(FTE_DEP_VORBISFILE true CACHE BOOL "Link against libvorbisfile.")
|
||||||
|
IF(FTE_DEP_VROBISFILE)
|
||||||
|
FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile)
|
||||||
|
ENDIF()
|
||||||
IF(NOT VORBISFILE_LIBRARY)
|
IF(NOT VORBISFILE_LIBRARY)
|
||||||
INCLUDE_DIRECTORIES( ${VORBISFILE_INCLUDE_DIRS} )
|
INCLUDE_DIRECTORIES( ${VORBISFILE_INCLUDE_DIRS} )
|
||||||
MESSAGE(WARNING "libvorbisfile library NOT available. Who listens to the bgm anyway?")
|
MESSAGE(WARNING "libvorbisfile library NOT available. Who listens to the bgm anyway?")
|
||||||
|
@ -921,7 +934,7 @@ ELSE()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#ODE Physics library plugin
|
#ODE Physics library plugin
|
||||||
SET(FTE_PLUG_ODE true CACHE STRING "Compile ODE rigid body physics plugin.")
|
SET(FTE_PLUG_ODE true CACHE BOOL "Compile ODE rigid body physics plugin.")
|
||||||
SET_PROPERTY(CACHE FTE_PLUG_ODE PROPERTY STRINGS false true static)
|
SET_PROPERTY(CACHE FTE_PLUG_ODE PROPERTY STRINGS false true static)
|
||||||
IF(FTE_PLUG_ODE)
|
IF(FTE_PLUG_ODE)
|
||||||
FIND_PATH(LIBODE_INCLUDE_DIR ode/ode.h)
|
FIND_PATH(LIBODE_INCLUDE_DIR ode/ode.h)
|
||||||
|
@ -1372,7 +1385,7 @@ IF(FTE_PLUG_HL2)
|
||||||
plugins/hl2/mat_vmt.c
|
plugins/hl2/mat_vmt.c
|
||||||
)
|
)
|
||||||
SET_TARGET_PROPERTIES(plug_hl2 PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;MULTITHREAD;${FTE_LIB_DEFINES}")
|
SET_TARGET_PROPERTIES(plug_hl2 PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;MULTITHREAD;${FTE_LIB_DEFINES}")
|
||||||
TARGET_LINK_LIBRARIES(plug_hl2 ${SYS_LIBS} ${ZLIB_LIBRARIES})
|
TARGET_LINK_LIBRARIES(plug_hl2 ${SYS_LIBS})
|
||||||
|
|
||||||
EMBED_PLUGIN_META(hl2 "HalfLife2 Formats Plugin" "Adds support for reading various file formats used by HalfLife2. Requires mod support to be useful.")
|
EMBED_PLUGIN_META(hl2 "HalfLife2 Formats Plugin" "Adds support for reading various file formats used by HalfLife2. Requires mod support to be useful.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1611,7 +1624,7 @@ IF(FTE_MENU_SYS)
|
||||||
VERBATIM
|
VERBATIM
|
||||||
DEPENDS fteqcc
|
DEPENDS fteqcc
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/quakec/menusys/"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/quakec/menusys/"
|
||||||
COMMAND fteqcc -srcfile "menu.src" -o "${CMAKE_CURRENT_BINARY_DIR}/menu.dat"
|
COMMAND fteqcc -srcfile "menu.src" -o "${CMAKE_CURRENT_BINARY_DIR}/menu.dat" -DREVISION="${SVNREVISION}" -DDATE="${FTE_DATE}" -DBRANCH="${FTE_BRANCH}"
|
||||||
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/menu.dat" "${CMAKE_CURRENT_BINARY_DIR}/menu.lno"
|
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/menu.dat" "${CMAKE_CURRENT_BINARY_DIR}/menu.lno"
|
||||||
SOURCES
|
SOURCES
|
||||||
quakec/menusys/menu.src
|
quakec/menusys/menu.src
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include "fs.h"
|
#include "fs.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "../../engine/libs/zlib.h"
|
#ifdef AVAIL_ZLIB
|
||||||
|
#include <zlib.h>
|
||||||
|
#endif
|
||||||
#include "blast.h"
|
#include "blast.h"
|
||||||
|
|
||||||
//http://bazaar.launchpad.net/~jeanfrancois.roy/mpqkit/trunk/files
|
//http://bazaar.launchpad.net/~jeanfrancois.roy/mpqkit/trunk/files
|
||||||
|
@ -598,6 +600,7 @@ static void MPQF_decompress(qboolean legacymethod, void *outdata, unsigned int o
|
||||||
struct blastdata_s args = {outdata, outlen, indata, inlen};
|
struct blastdata_s args = {outdata, outlen, indata, inlen};
|
||||||
blast(mpqf_blastin, &args, mpqf_blastout, &args);
|
blast(mpqf_blastin, &args, mpqf_blastout, &args);
|
||||||
}
|
}
|
||||||
|
#ifdef AVAIL_ZLIB
|
||||||
else if (methods == 2)
|
else if (methods == 2)
|
||||||
{
|
{
|
||||||
z_stream strm =
|
z_stream strm =
|
||||||
|
@ -651,6 +654,7 @@ static void MPQF_decompress(qboolean legacymethod, void *outdata, unsigned int o
|
||||||
|
|
||||||
inflateEnd(&strm);
|
inflateEnd(&strm);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Con_Printf("mpq: unsupported decompression method - %x\n", methods);
|
Con_Printf("mpq: unsupported decompression method - %x\n", methods);
|
||||||
|
|
Loading…
Reference in a new issue