Fix libjpeg build on OSX.

This commit is contained in:
rude
2013-10-01 18:02:12 +02:00
parent 3f488f59d8
commit 52e2754b97
2 changed files with 60 additions and 0 deletions
+7
View File
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8)
project(jpeg)
include(CheckIncludeFiles)
option(JPEG_BUILD_SHARED "Build shared library" OFF)
option(JPEG_BUILD_STATIC "Build static library" ON)
@@ -57,6 +59,11 @@ set(JPEG_SRC
if(MSVC)
file(COPY jconfig.vc DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/jconfig.vc ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h)
elseif(APPLE)
check_include_files("stddef.h" HAVE_STDDEF_H)
check_include_files("stdlib.h" HAVE_STDLIB_H)
check_include_files("locale.h" HAVE_LOCALE_H)
configure_file(jconfig.cmake jconfig.h)
endif()
if(JPEG_BUILD_STATIC)
+53
View File
@@ -0,0 +1,53 @@
/* jconfig.cmake --- config for CMake */
/* see jconfig.txt for explanations */
#define HAVE_PROTOTYPES
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_SHORT
// #undef void
// #undef const
#undef CHAR_IS_UNSIGNED
#cmakedefine HAVE_STDDEF_H
#cmakedefine HAVE_STDLIB_H
#cmakedefine HAVE_LOCALE_H
#undef NEED_BSD_STRINGS
#undef NEED_SYS_TYPES_H
#undef NEED_FAR_POINTERS
#undef NEED_SHORT_EXTERNAL_NAMES
/* Define this if you get warnings about undefined structures. */
#undef INCOMPLETE_TYPES_BROKEN
/* Define "boolean" as unsigned char, not int, on Windows systems. */
#ifdef _WIN32
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
typedef unsigned char boolean;
#endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
#endif
#ifdef JPEG_INTERNALS
#undef RIGHT_SHIFT_IS_UNSIGNED
#undef INLINE
/* These are for configuring the JPEG memory manager. */
#undef DEFAULT_MAX_MEM
#undef NO_MKTEMP
#endif /* JPEG_INTERNALS */
#ifdef JPEG_CJPEG_DJPEG
#define BMP_SUPPORTED /* BMP image file format */
#define GIF_SUPPORTED /* GIF image file format */
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
#undef RLE_SUPPORTED /* Utah RLE image file format */
#define TARGA_SUPPORTED /* Targa image file format */
#undef TWO_FILE_COMMANDLINE
#undef NEED_SIGNAL_CATCHER
#undef DONT_USE_B_MODE
/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
#undef PROGRESS_REPORT
#endif /* JPEG_CJPEG_DJPEG */