2021-01-11 15:55:40 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/libjpeg-turbo/copyright" )
message ( FATAL_ERROR "Can't build ${PORT} if libjpeg-turbo is installed. Please remove libjpeg-turbo:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again." )
endif ( )
2024-08-23 17:19:15 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/ijg-libjpeg/copyright" )
message ( FATAL_ERROR "Can't build ${PORT} if ijg-libjpeg is installed. Please remove ijg-libjpeg:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again." )
endif ( )
2021-01-11 15:55:40 +08:00
2017-10-07 05:06:43 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O m o z i l l a / m o z j p e g
2023-11-10 02:33:33 +08:00
R E F " v $ { V E R S I O N } "
S H A 5 1 2 9 0 e 1 b 0 0 6 7 7 4 0 b 1 6 1 3 9 8 d 9 0 8 e 9 0 b 9 7 6 e c c c 2 e e 7 1 7 4 4 9 6 c e 9 6 9 3 b a 3 c d f 4 7 2 7 5 5 9 e c f f 3 9 7 4 4 6 1 1 6 5 7 d 8 4 7 d d 8 3 1 6 4 b 8 0 9 9 3 1 5 2 7 3 9 6 9 2 a 5 2 3 3 a c a 5 7 7 e b d 0 5 2 e f a f 5 0 1
2017-10-07 05:06:43 +08:00
H E A D _ R E F m a s t e r
2019-03-28 00:52:02 +08:00
P A T C H E S
f i x - i n s t a l l - e r r o r . p a t c h
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 )
2021-09-29 23:39:58 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2017-10-07 05:06:43 +08:00
O P T I O N S
2020-07-31 13:38:32 +08:00
- D E N A B L E _ S H A R E D = $ { E N A B L E _ S H A R E D }
- D E N A B L E _ S T A T I C = $ { E N A B L E _ S T A T I C }
2017-10-07 05:06:43 +08:00
- D W I T H _ C R T _ D L L = $ { W I T H _ C R T _ D L L }
2017-10-06 00:15:42 +08:00
)
2021-09-29 23:39:58 +08:00
vcpkg_cmake_install ( )
2017-10-06 00:15:42 +08:00
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 ( )
2021-09-29 23:39:58 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/mozjpeg )
2020-07-31 13:38:32 +08:00
# Remove extra debug files
2021-09-29 23:39:58 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2017-10-06 00:15:42 +08:00
2021-09-29 23:39:58 +08:00
vcpkg_copy_tools ( TOOL_NAMES cjpeg djpeg jpegtran tjbench AUTO_CLEAN )
2020-07-31 13:38:32 +08:00
vcpkg_fixup_pkgconfig ( )
2021-09-29 23:39:58 +08:00
vcpkg_copy_pdbs ( )
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 )
2021-09-29 23:39:58 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" )
2017-10-06 00:15:42 +08:00
endif ( )
# Handle copyright
2024-08-23 17:19:15 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/LICENSE.md" )