Commit cb94f539 authored by Rashad Kanavath's avatar Rashad Kanavath

ENH: Using libjpeg-turbo as SuperBuild libjpeg

parent f1dfb6a1
......@@ -12,66 +12,60 @@ if(USE_SYSTEM_JPEG)
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using libjpeg SuperBuild version")
if(WIN32)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://www.ijg.org/files/jpegsrc.v9a.tar.gz"
URL_MD5 3353992aecaee1805ef4109aadd433e7
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_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt ${JPEG_SB_SRC}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DWITH_SIMD:BOOL=OFF
-DWITH_TURBOJPEG:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
)
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/jconfigint.h.in ${JPEG_SB_SRC}/win/
)
ExternalProject_Add_Step(${proj} copy_jconfig
COMMAND ${CMAKE_COMMAND} -E copy
${JPEG_SB_SRC}/jconfig.vc ${JPEG_SB_SRC}/jconfig.h
DEPENDEES patch
DEPENDERS build
)
else()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://www.ijg.org/files/jpegsrc.v9a.tar.gz"
URL_MD5 3353992aecaee1805ef4109aadd433e7
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
else()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${JPEG_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared=yes
BUILD_COMMAND $(MAKE) bin_PROGRAMS=
INSTALL_COMMAND $(MAKE) install bin_PROGRAMS=
DEPENDS ${${proj}_DEPENDENCIES}
)
ExternalProject_Add_Step(${proj} copy_source
COMMAND ${CMAKE_COMMAND} -E copy_directory
--with-jpeg8
--without-simd
--without-java
BUILD_COMMAND $(MAKE) bin_PROGRAMS=
INSTALL_COMMAND $(MAKE) install bin_PROGRAMS=
DEPENDS ${${proj}_DEPENDENCIES} )
ExternalProject_Add_Step(${proj} copy_source
COMMAND ${CMAKE_COMMAND} -E copy_directory
${JPEG_SB_SRC} ${JPEG_SB_BUILD_DIR}
DEPENDEES patch update
DEPENDERS configure
)
DEPENDEES patch update
DEPENDERS configure )
endif()
ExternalProject_Add_Step(${proj} remove_static
COMMAND ${CMAKE_COMMAND} -E remove ${SB_INSTALL_PREFIX}/lib/libjpeg.a
DEPENDEES install)
endif()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libjpeg${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
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