2017-10-07 05:06:43 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mozilla/mozjpeg
|
2020-06-06 03:10:36 +08:00
|
|
|
REF 6d95c51adf0c314017f541b6cb07e13cc1bce754
|
|
|
|
SHA512 a21c8b3a561b387933a27befaa1d05a8c63b0e203d72d73071a4c9b57c6b7d57b44836f211c4dcb80eee4b01876f0a0fb4c91a60c3ae867e906e5e4e27165627
|
2017-10-07 05:06:43 +08:00
|
|
|
HEAD_REF master
|
2019-03-28 00:52:02 +08:00
|
|
|
PATCHES
|
|
|
|
fix-install-error.patch
|
2017-10-06 00:15:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_find_acquire_program(NASM)
|
|
|
|
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
|
2020-06-06 03:10:36 +08:00
|
|
|
vcpkg_add_to_path(${NASM_EXE_PATH})
|
2017-10-06 00:15:42 +08:00
|
|
|
|
2020-07-31 13:38:32 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
|
2017-10-07 05:06:43 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL)
|
|
|
|
|
2017-10-06 00:15:42 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-08-01 04:01:02 +08:00
|
|
|
PREFER_NINJA
|
2017-10-07 05:06:43 +08:00
|
|
|
OPTIONS
|
2020-07-31 13:38:32 +08:00
|
|
|
-DENABLE_SHARED=${ENABLE_SHARED}
|
|
|
|
-DENABLE_STATIC=${ENABLE_STATIC}
|
2017-10-07 05:06:43 +08:00
|
|
|
-DWITH_CRT_DLL=${WITH_CRT_DLL}
|
2017-10-06 00:15:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2020-07-31 13:38:32 +08:00
|
|
|
# Rename libraries for static builds
|
|
|
|
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/jpeg.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Remove extra debug files
|
2017-10-06 00:15:42 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2019-03-28 00:52:02 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2017-10-06 00:15:42 +08:00
|
|
|
|
2020-07-31 13:38:32 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES cjpeg djpeg jpegtran AUTO_CLEAN)
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2017-10-07 05:06:43 +08:00
|
|
|
|
2020-07-31 13:38:32 +08:00
|
|
|
# Remove empty folders after static build
|
2017-10-07 05:06:43 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2017-10-06 00:15:42 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Handle copyright
|
2020-06-06 03:10:36 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2017-10-06 00:15:42 +08:00
|
|
|
vcpkg_copy_pdbs()
|