- Allow use of system GME library. It defaults to forcing the use of the internal library at least for now though.

This commit is contained in:
Braden Obrzut 2013-11-06 13:37:34 -05:00
parent 7dbf4ec38f
commit f0b946c3cf
3 changed files with 22 additions and 6 deletions

View file

@ -3,6 +3,7 @@ project(ZDoom)
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} )
include( CreateLaunchers )
include( FindPackageHandleStandardArgs )
# Generator expression are available some time in CMake 2.8. Due to
# cmake_minimum_required, we can assume a minor version of > 7 implies major >= 2
@ -72,6 +73,13 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
find_package( BZip2 )
find_package( JPEG )
find_package( ZLIB )
# GME
find_path( GME_INCLUDE_DIR gme.h )
find_library( GME_LIBRARIES gme )
mark_as_advanced( GME_INCLUDE_DIR GME_LIBRARIES )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GME
REQUIRED_VARS GME_LIBRARIES GME_INCLUDE_DIR
)
if( MSVC )
# Eliminate unreferenced functions and data
@ -125,6 +133,7 @@ set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEB_C_FLAGS} -D_DEBUG" )
option(FORCE_INTERNAL_ZLIB "Use internal zlib")
option(FORCE_INTERNAL_JPEG "Use internal jpeg")
option(FORCE_INTERNAL_BZIP2 "Use internal bzip2")
option(FORCE_INTERNAL_GME "Use internal gme" ON)
if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB )
message( STATUS "Using system zlib" )
@ -156,11 +165,19 @@ else( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 )
set( BZIP2_LIBRARY bz2 )
endif( BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2 )
if( GME_FOUND AND NOT FORCE_INTERNAL_GME )
message( STATUS "Using system gme library ${GME_INCLUDE_DIR}" )
else( GME_FOUND AND NOT FORCE_INTERNAL_GME )
message( STATUS "Using internal gme library" )
add_subdirectory( game-music-emu )
set( GME_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/game-music-emu" )
set( GME_LIBRARIES gme )
endif( GME_FOUND AND NOT FORCE_INTERNAL_GME )
set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lzma/C" )
add_subdirectory( lzma )
add_subdirectory( tools )
add_subdirectory( game-music-emu )
add_subdirectory( dumb )
add_subdirectory( gdtoa )
add_subdirectory( wadsrc )

View file

@ -503,8 +503,8 @@ add_custom_target( revision_check ALL
# Libraries ZDoom needs
message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" )
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${FMOD_LIBRARY}" )
include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" )
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${FMOD_LIBRARY}" )
include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" )
if( FLUIDSYNTH_FOUND )
if( NOT DYN_FLUIDSYNTH)
@ -1065,7 +1065,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
set( ZDOOM_LIBS ${ZDOOM_LIBS} nsl socket)
endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
target_link_libraries( zdoom ${ZDOOM_LIBS} gme gdtoa dumb lzma )
target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma )
include_directories( .
g_doom
g_heretic
@ -1079,7 +1079,6 @@ include_directories( .
thingdef
timidity
xlat
../game-music-emu/gme
../gdtoa
../dumb/include
${CMAKE_BINARY_DIR}/gdtoa

View file

@ -40,7 +40,7 @@
#include "i_musicinterns.h"
#include "c_cvars.h"
#include "critsec.h"
#include "gme.h"
#include <gme/gme.h>
#include "v_text.h"
// MACROS ------------------------------------------------------------------