mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 03:43:58 +08:00
a7c0f2b2b4
* [libjpeg-turbo] update to 2.1.5 * update version --------- Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
177 lines
6.5 KiB
Diff
177 lines
6.5 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 3730326..f5958eb 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -194,6 +194,12 @@ option(ENABLE_SHARED "Build shared libraries" TRUE)
|
|
boolean_number(ENABLE_SHARED)
|
|
option(ENABLE_STATIC "Build static libraries" TRUE)
|
|
boolean_number(ENABLE_STATIC)
|
|
+option(ENABLE_EXECUTABLES "Build executables" TRUE)
|
|
+boolean_number(ENABLE_EXECUTABLES)
|
|
+option(INSTALL_DOCS "Install doc files" TRUE)
|
|
+boolean_number(INSTALL_DOCS)
|
|
+option(INSTALL_HEADERS "Install header files" TRUE)
|
|
+boolean_number(INSTALL_HEADERS)
|
|
option(REQUIRE_SIMD "Generate a fatal error if SIMD extensions are not available for this platform (default is to fall back to a non-SIMD build)" FALSE)
|
|
boolean_number(REQUIRE_SIMD)
|
|
option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_ARITH_DEC=0 WITH_ARITH_ENC=0 WITH_JAVA=0 WITH_SIMD=0 WITH_TURBOJPEG=0 )" FALSE)
|
|
@@ -664,6 +670,7 @@ if(WITH_TURBOJPEG)
|
|
LINK_FLAGS "${TJMAPFLAG}${TJMAPFILE}")
|
|
endif()
|
|
|
|
+ if(ENABLE_EXECUTABLES)
|
|
add_executable(tjunittest tjunittest.c tjutil.c md5/md5.c md5/md5hl.c)
|
|
target_link_libraries(tjunittest turbojpeg)
|
|
|
|
@@ -676,6 +683,7 @@ if(WITH_TURBOJPEG)
|
|
add_executable(tjexample tjexample.c)
|
|
target_link_libraries(tjexample turbojpeg)
|
|
endif()
|
|
+ endif()
|
|
|
|
if(ENABLE_STATIC)
|
|
add_library(turbojpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
|
|
@@ -687,6 +695,7 @@ if(WITH_TURBOJPEG)
|
|
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
|
|
endif()
|
|
|
|
+ if(ENABLE_EXECUTABLES)
|
|
add_executable(tjunittest-static tjunittest.c tjutil.c md5/md5.c
|
|
md5/md5hl.c)
|
|
target_link_libraries(tjunittest-static turbojpeg-static)
|
|
@@ -696,6 +705,7 @@ if(WITH_TURBOJPEG)
|
|
if(UNIX)
|
|
target_link_libraries(tjbench-static m)
|
|
endif()
|
|
+ endif()
|
|
endif()
|
|
endif()
|
|
|
|
@@ -710,7 +720,7 @@ else()
|
|
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
|
|
endif()
|
|
|
|
-if(ENABLE_STATIC)
|
|
+if(ENABLE_STATIC AND ENABLE_EXECUTABLES)
|
|
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c
|
|
${CJPEG_BMP_SOURCES})
|
|
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
|
@@ -726,10 +736,11 @@ if(ENABLE_STATIC)
|
|
set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "${USE_SETMODE}")
|
|
endif()
|
|
|
|
+if(ENABLE_EXECUTABLES)
|
|
add_executable(rdjpgcom rdjpgcom.c)
|
|
|
|
add_executable(wrjpgcom wrjpgcom.c)
|
|
-
|
|
+endif()
|
|
|
|
###############################################################################
|
|
# TESTS
|
|
@@ -1466,8 +1477,10 @@ if(WITH_TURBOJPEG)
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
+ if(ENABLE_EXECUTABLES)
|
|
install(TARGETS tjbench
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
+ endif()
|
|
if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
|
|
CMAKE_C_LINKER_SUPPORTS_PDB)
|
|
install(FILES "$<TARGET_PDB_FILE:turbojpeg>"
|
|
@@ -1478,7 +1491,7 @@ if(WITH_TURBOJPEG)
|
|
install(TARGETS turbojpeg-static EXPORT ${CMAKE_PROJECT_NAME}Targets
|
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
- if(NOT ENABLE_SHARED)
|
|
+ if(NOT ENABLE_SHARED AND ENABLE_EXECUTABLES)
|
|
if(GENERATOR_IS_MULTI_CONFIG)
|
|
set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
|
|
else()
|
|
@@ -1488,15 +1501,17 @@ if(WITH_TURBOJPEG)
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE})
|
|
endif()
|
|
endif()
|
|
+ if(INSTALL_HEADERS)
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
+ endif()
|
|
endif()
|
|
|
|
if(ENABLE_STATIC)
|
|
install(TARGETS jpeg-static EXPORT ${CMAKE_PROJECT_NAME}Targets
|
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
- if(NOT ENABLE_SHARED)
|
|
+ if(NOT ENABLE_SHARED AND ENABLE_EXECUTABLES)
|
|
if(GENERATOR_IS_MULTI_CONFIG)
|
|
set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
|
|
else()
|
|
@@ -1511,8 +1526,11 @@ if(ENABLE_STATIC)
|
|
endif()
|
|
endif()
|
|
|
|
+if(ENABLE_EXECUTABLES)
|
|
install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
+endif()
|
|
|
|
+if(INSTALL_DOCS)
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
|
|
${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
|
|
${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c
|
|
@@ -1524,8 +1542,9 @@ if(WITH_JAVA)
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
endif()
|
|
+endif()
|
|
|
|
-if(UNIX OR MINGW)
|
|
+if((UNIX OR MINGW) AND INSTALL_DOCS)
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cjpeg.1
|
|
${CMAKE_CURRENT_SOURCE_DIR}/djpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/jpegtran.1
|
|
${CMAKE_CURRENT_SOURCE_DIR}/rdjpgcom.1
|
|
@@ -1546,10 +1565,12 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
|
|
NAMESPACE ${CMAKE_PROJECT_NAME}::
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})
|
|
|
|
+if(INSTALL_HEADERS)
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
+endif()
|
|
|
|
include(cmakescripts/BuildPackages.cmake)
|
|
|
|
diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt
|
|
index aea0b9d..069dbe2 100644
|
|
--- a/sharedlib/CMakeLists.txt
|
|
+++ b/sharedlib/CMakeLists.txt
|
|
@@ -76,6 +76,7 @@ else()
|
|
set(DJPEG_BMP_SOURCES ../wrbmp.c ../wrtarga.c)
|
|
endif()
|
|
|
|
+if(ENABLE_EXECUTABLES)
|
|
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdgif.c ../rdppm.c
|
|
../rdswitch.c ${CJPEG_BMP_SOURCES})
|
|
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
|
@@ -92,14 +93,17 @@ set_property(TARGET jpegtran PROPERTY COMPILE_FLAGS "${USE_SETMODE}")
|
|
|
|
add_executable(jcstest ../jcstest.c)
|
|
target_link_libraries(jcstest jpeg)
|
|
+endif()
|
|
|
|
install(TARGETS jpeg EXPORT ${CMAKE_PROJECT_NAME}Targets
|
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
+if(ENABLE_EXECUTABLES)
|
|
install(TARGETS cjpeg djpeg jpegtran
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
+endif()
|
|
if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
|
|
CMAKE_C_LINKER_SUPPORTS_PDB)
|
|
install(FILES "$<TARGET_PDB_FILE:jpeg>"
|