Check for jpeg_mem_src()

This function only exists starting with libjpeg8.
Check for existence and provide an implementation if necessary.
This allows libjpeg6 to be used.

Code borrowed from libjpeg8, adapt copyright in README
accordingly.
This commit is contained in:
dhewg 2011-12-22 13:40:12 +01:00 committed by Daniel Gibson
parent 27c5fd76ff
commit 22637272dc

View file

@ -25,6 +25,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sys/cmake")
set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE)
include(CheckCXXCompilerFlag)
include(CheckFunctionExists)
option(CORE "Build the core" ON)
option(GAME "Build the base game code" ON)
@ -70,6 +71,13 @@ endif()
find_package(JPEG REQUIRED)
include_directories(${JPEG_INCLUDE_DIR})
set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY})
CHECK_FUNCTION_EXISTS("jpeg_mem_src" jpeg_has_mem_src)
if (jpeg_has_mem_src)
add_definitions(-DHAVE_JPEG_MEM_SRC)
endif ()
find_package(OGG REQUIRED)
include_directories(${OGG_INCLUDE_DIR})