Commit 3528bdea authored by Rashad Kanavath's avatar Rashad Kanavath

SuperBuild: patch jpeg cmake for linux and macosx. configure + rpath not working

parent 04396510
......@@ -13,26 +13,12 @@ SETUP_SUPERBUILD(PROJECT JPEG)
message(STATUS " Using libjpeg SuperBuild version")
if(WIN32)
set(JPEG_CONFIGURE_COMMAND ${SB_CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Release
-DENABLE_SHARED=TRUE
-DENABLE_STATIC=FALSE
-DWITH_SIMD=FALSE
-DWITH_TURBOJPEG=FALSE
-DCMAKE_INSTALL_PREFIX=${SB_INSTALL_PREFIX})
set(JPEG_PATCH_COMMAND ${CMAKE_COMMAND}
-E copy
${CMAKE_SOURCE_DIR}/patches/JPEG/jconfigint.h.in
${JPEG_SB_SRC}/win/)
else()
set(JPEG_CONFIGURE_COMMAND "${SB_ENV_CONFIGURE_CMD};${JPEG_SB_SRC}/configure"
--prefix=${SB_INSTALL_PREFIX}
--without-java
--disable-dependency-tracking
--without-simd
)
set(JPEG_PATCH_COMMAND)
endif()
......@@ -41,13 +27,24 @@ ExternalProject_Add(JPEG
URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
SOURCE_DIR ${JPEG_SB_SRC}
BINARY_DIR ${JPEG_SB_SRC}
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND ${JPEG_CONFIGURE_COMMAND}
PATCH_COMMAND ${JPEG_PATCH_COMMAND}
CONFIGURE_COMMAND ${SB_CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Release
-DENABLE_SHARED=TRUE
-DENABLE_STATIC=FALSE
-DWITH_SIMD=FALSE
-DWITH_TURBOJPEG=FALSE
-DWITH_ARITH_DEC=TRUE
-DWITH_JAVA=FALSE
-DCMAKE_INSTALL_PREFIX=${SB_INSTALL_PREFIX}
${JPEG_SB_SRC}
PATCH_COMMAND ${JPEG_PATCH_COMMAND}
)
SUPERBUILD_PATCH_SOURCE(JPEG "patch-for-unix")
set(_SB_JPEG_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_JPEG_LIBRARY ${SB_INSTALL_PREFIX}/lib/jpeg.lib)
......
diff -burN libjpeg-turbo-1.4.1.orig/CMakeLists.txt libjpeg-turbo-1.4.1/CMakeLists.txt
--- libjpeg-turbo-1.4.1.orig/CMakeLists.txt 2016-05-19 08:20:33.000000000 +0200
+++ libjpeg-turbo-1.4.1/CMakeLists.txt 2016-05-19 09:24:28.000000000 +0200
@@ -167,6 +167,11 @@
message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}")
+
+include(CheckTypeSize)
+check_type_size("size_t" JPEG_SIZEOF_SIZE_T)
+set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -DSIZEOF_SIZE_T=${JPEG_SIZEOF_SIZE_T})
+
configure_file(win/jconfig.h.in jconfig.h)
configure_file(win/jconfigint.h.in jconfigint.h)
@@ -287,9 +292,9 @@
endif()
if(WITH_12BIT)
- set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE")
+ set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED")
else()
- set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
+ set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED")
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
endif()
diff -burN libjpeg-turbo-1.4.1.orig/win/jconfig.h.in libjpeg-turbo-1.4.1/win/jconfig.h.in
--- libjpeg-turbo-1.4.1.orig/win/jconfig.h.in 2016-05-19 08:20:33.000000000 +0200
+++ libjpeg-turbo-1.4.1/win/jconfig.h.in 2016-05-19 09:26:12.000000000 +0200
@@ -48,3 +48,5 @@
#undef RIGHT_SHIFT_IS_UNSIGNED
#endif /* JPEG_INTERNALS */
+
+#undef USE_SETMODE
diff -burN libjpeg-turbo-1.4.1.orig/CMakeLists.txt libjpeg-turbo-1.4.1/CMakeLists.txt
--- libjpeg-turbo-1.4.1.orig/CMakeLists.txt 2016-05-19 08:20:33.000000000 +0200
+++ libjpeg-turbo-1.4.1/CMakeLists.txt 2016-05-19 09:24:28.000000000 +0200
@@ -167,6 +167,11 @@
message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}")
+
+include(CheckTypeSize)
+check_type_size("size_t" JPEG_SIZEOF_SIZE_T)
+set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -DSIZEOF_SIZE_T=${JPEG_SIZEOF_SIZE_T})
+
configure_file(win/jconfig.h.in jconfig.h)
configure_file(win/jconfigint.h.in jconfigint.h)
@@ -287,9 +292,9 @@
endif()
if(WITH_12BIT)
- set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE")
+ set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED")
else()
- set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
+ set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED")
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
endif()
diff -burN libjpeg-turbo-1.4.1.orig/win/jconfig.h.in libjpeg-turbo-1.4.1/win/jconfig.h.in
--- libjpeg-turbo-1.4.1.orig/win/jconfig.h.in 2016-05-19 08:20:33.000000000 +0200
+++ libjpeg-turbo-1.4.1/win/jconfig.h.in 2016-05-19 09:26:12.000000000 +0200
@@ -48,3 +48,5 @@
#undef RIGHT_SHIFT_IS_UNSIGNED
#endif /* JPEG_INTERNALS */
+
+#undef USE_SETMODE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment