2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-07-13 01:47:35 +08:00
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libjpeg-turbo/libjpeg-turbo
|
2020-02-11 08:08:57 +08:00
|
|
|
REF 166e34213e4f4e2363ce058a7bcc69fd03e38b76 # 2.0.4
|
|
|
|
SHA512 e4ac657cdb5df0b37e9429d21c2c49eed0c195408469597b49c06791fc5899a66f7f7dbb0b253f32eb28e63e5382fcf3afe68e5e30b04f76e145f6151d8f1112
|
2018-09-12 04:11:51 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
add-options-for-exes-docs-headers.patch
|
2019-05-07 00:54:05 +08:00
|
|
|
|
|
|
|
#workaround for vcpkg bug see #5697 on github for more information
|
|
|
|
workaround_cmake_system_processor.patch
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
2018-03-14 02:34:59 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR (VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
|
2018-01-04 07:19:52 +08:00
|
|
|
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=OFF)
|
|
|
|
else()
|
|
|
|
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=ON)
|
|
|
|
vcpkg_find_acquire_program(NASM)
|
|
|
|
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
|
|
|
|
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
|
|
|
|
endif()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2018-03-18 15:33:00 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
set(ENV{_CL_} "-DNO_GETENV -DNO_PUTENV")
|
|
|
|
endif()
|
|
|
|
|
2017-10-26 02:28:27 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL)
|
2016-11-02 02:11:24 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-03-14 09:01:17 +08:00
|
|
|
PREFER_NINJA
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
2017-10-17 02:22:21 +08:00
|
|
|
-DENABLE_STATIC=${ENABLE_STATIC}
|
|
|
|
-DENABLE_SHARED=${ENABLE_SHARED}
|
2016-09-19 11:50:08 +08:00
|
|
|
-DENABLE_EXECUTABLES=OFF
|
|
|
|
-DINSTALL_DOCS=OFF
|
2017-10-26 02:28:27 +08:00
|
|
|
-DWITH_CRT_DLL=${WITH_CRT_DLL}
|
2017-03-14 09:01:17 +08:00
|
|
|
${LIBJPEGTURBO_SIMD}
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2016-11-17 23:43:08 +08:00
|
|
|
# Rename libraries for static builds
|
2019-05-07 00:54:05 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib")
|
|
|
|
endif()
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpegd.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpegd.lib")
|
2019-06-07 14:34:06 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2019-05-07 00:54:05 +08:00
|
|
|
endif()
|
|
|
|
else(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpegd.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpegd.lib")
|
|
|
|
endif()
|
2016-11-17 23:43:08 +08:00
|
|
|
endif()
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
file(COPY
|
|
|
|
${SOURCE_PATH}/LICENSE.md
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo
|
|
|
|
)
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2019-05-07 00:54:05 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2019-06-07 14:34:06 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2019-05-07 00:54:05 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man)
|
|
|
|
|
2019-06-07 14:34:06 +08:00
|
|
|
file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
|
|
|
file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
|
|
|
if(EXE OR DEBUG_EXE)
|
|
|
|
file(REMOVE ${EXE} ${DEBUG_EXE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/jpeg)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/libjpeg-turbo/copyright)
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
vcpkg_test_cmake(PACKAGE_NAME JPEG MODULE)
|