Revert "libs: use external project for libjpeg-turbo on windows"

This reverts commit e3c405ef32.
This commit is contained in:
Remy Marquis 2019-12-25 17:24:06 +01:00
parent 048c9f8bb9
commit 9420644d36
3 changed files with 81 additions and 122 deletions

View file

@ -64,32 +64,95 @@ if(WIN32)
check_include_file(stdlib.h HAVE_STDLIB_H)
set(JPEG_LIB "${CMAKE_CURRENT_LIST_DIR}/jpegturbo")
set(binary_dir "${LIBS_BINARYDIR_DIR}/jpegturbo")
if(VSTUDIO)
set(JPEG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(VS_BUILD_BUILD)
set(JPEG_BUNDLED_LIBRARIES "${binary_dir}/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
else()
set(JPEG_BUNDLED_LIBRARIES "${binary_dir}/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
if(WIN32 AND NOT CYGWIN)
set(TWO_FILE_COMMANDLINE true)
endif()
set(WITH_JPEG8 true)
configure_file (${JPEG_LIB}/jconfig.h.cmake ${JPEG_LIB}/jconfig.h)
configure_file (${JPEG_LIB}/jconfigint.h.cmake ${JPEG_LIB}/jconfigint.h)
ExternalProject_Add(bundled_jpeg
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/jpegturbo
BINARY_DIR ${LIBS_BINARYDIR_DIR}/jpegturbo
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DREQUIRE_SIMD=OFF -DWITH_12BIT=OFF
-DWITH_ARITH_DEC=ON -DWITH_ARITH_ENC=ON -DWITH_JAVA=OFF -DWITH_JPEG7=OFF -DWITH_JPEG8=ON
-DWITH_MEM_SRCDST=ON -DWITH_SIMD=OFF -DWITH_TURBOJPEG=ON
INSTALL_COMMAND ""
#include_directories(${CMAKE_CURRENT_BINARY_DIR})
FILE(GLOB JPEG_LIB_HEADERS
${JPEG_LIB}/jerror.h
${JPEG_LIB}/jmorecfg.h
${JPEG_LIB}/jpeglib.h
${JPEG_LIB}/jconfig.h
${JPEG_LIB}/jconfigint.h
${JPEG_LIB}/turbojpeg.h
)
#ExternalProject_Get_Property(bundled_jpeg binary_dir)
FILE(GLOB JPEG_LIB_SRC
${JPEG_LIB}/jmemnobs.c
${JPEG_LIB}/jaricom.c
${JPEG_LIB}/jcapimin.c
${JPEG_LIB}/jcapistd.c
${JPEG_LIB}/jcarith.c
${JPEG_LIB}/jccoefct.c
${JPEG_LIB}/jccolor.c
${JPEG_LIB}/jcdctmgr.c
${JPEG_LIB}/jchuff.c
${JPEG_LIB}/jcinit.c
${JPEG_LIB}/jcmainct.c
${JPEG_LIB}/jcmarker.c
${JPEG_LIB}/jcmaster.c
${JPEG_LIB}/jcomapi.c
${JPEG_LIB}/jcparam.c
${JPEG_LIB}/jcphuff.c
${JPEG_LIB}/jcprepct.c
${JPEG_LIB}/jcsample.c
${JPEG_LIB}/jctest.c
${JPEG_LIB}/jctrans.c
${JPEG_LIB}/jdapimin.c
${JPEG_LIB}/jdapistd.c
${JPEG_LIB}/jdarith.c
${JPEG_LIB}/jdatadst.c
${JPEG_LIB}/jdatasrc.c
${JPEG_LIB}/jdcoefct.c
${JPEG_LIB}/jdcolor.c
${JPEG_LIB}/jddctmgr.c
${JPEG_LIB}/jdhuff.c
${JPEG_LIB}/jdinput.c
${JPEG_LIB}/jdmainct.c
${JPEG_LIB}/jdmarker.c
${JPEG_LIB}/jdmaster.c
${JPEG_LIB}/jdmerge.c
${JPEG_LIB}/jdphuff.c
${JPEG_LIB}/jdpostct.c
${JPEG_LIB}/jdsample.c
${JPEG_LIB}/jdtrans.c
${JPEG_LIB}/jerror.c
${JPEG_LIB}/jfdctflt.c
${JPEG_LIB}/jfdctfst.c
${JPEG_LIB}/jfdctint.c
${JPEG_LIB}/jidctflt.c
${JPEG_LIB}/jidctfst.c
${JPEG_LIB}/jidctint.c
${JPEG_LIB}/jidctred.c
${JPEG_LIB}/jmemmgr.c
${JPEG_LIB}/jmemnobs.c
${JPEG_LIB}/jquant1.c
${JPEG_LIB}/jquant2.c
${JPEG_LIB}/jsimd_none.c
${JPEG_LIB}/jutils.c
${JPEG_LIB}/turbojpeg.c
${JPEG_LIB}/cderror.h
${JPEG_LIB}/cdjpeg.h
${JPEG_LIB}/jdct.h
${JPEG_LIB}/jinclude.h
${JPEG_LIB}/jmemsys.h
${JPEG_LIB}/jpegint.h
${JPEG_LIB}/jpeg_nbits_table.h
${JPEG_LIB}/jversion.h
${JPEG_LIB}/transupp.h
)
add_library(bundled_jpeg STATIC ${JPEG_LIB_SRC} ${JPEG_LIB_HEADERS})
set(JPEG_BUNDLED_LIBRARIES bundled_jpeg)
set(JPEG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/jpegturbo")
set_target_properties(bundled_jpeg PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
endif()

View file

@ -1,73 +0,0 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION 80
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 2.0.3
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER 203
/* Support arithmetic encoding */
#define C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#define D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
#define MEM_SRCDST_SUPPORTED 1
/* Use accelerated SIMD routines. */
#cmakedefine WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#cmakedefine HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1
/* Define if you need to include <sys/types.h> to get size_t. */
#cmakedefine NEED_SYS_TYPES_H 1
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
memset/memcpy in <string.h>. */
#cmakedefine NEED_BSD_STRINGS 1
/* Define to 1 if the system has the type `unsigned char'. */
#cmakedefine HAVE_UNSIGNED_CHAR 1
/* Define to 1 if the system has the type `unsigned short'. */
#cmakedefine HAVE_UNSIGNED_SHORT 1
/* Compiler does not support pointers to undefined structures. */
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
#cmakedefine __CHAR_UNSIGNED__ 1
#endif
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

View file

@ -1,31 +0,0 @@
/* libjpeg-turbo build number */
#define BUILD "0"
/* Compiler's inline keyword */
#undef inline
/* How to obtain function inlining. */
#define INLINE __inline
/* Define to the full name of this package. */
#define PACKAGE_NAME "libjpeg-turbo"
/* Version number of package */
#define VERSION "2.0.3"
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 32
/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
#cmakedefine HAVE_BUILTIN_CTZL
/* Define to 1 if you have the <intrin.h> header file. */
#cmakedefine HAVE_INTRIN_H
#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
#if (SIZEOF_SIZE_T == 8)
#define HAVE_BITSCANFORWARD64
#elif (SIZEOF_SIZE_T == 4)
#define HAVE_BITSCANFORWARD
#endif
#endif