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 ( )
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
2022-10-17 23:13:45 +08:00
R E F a 2 d 2 9 0 7 f f 0 2 3 2 2 7 e 8 0 c 1 e 4 e f a 8 0 9 8 1 2 4 1 0 2 7 5 a 1 2 #v4.1.1
S H A 5 1 2 7 7 c 0 0 3 4 0 6 a 0 b 8 6 8 5 9 c 4 6 1 d 9 2 b d 2 1 6 1 6 8 d 6 c 4 f 5 d 5 5 7 3 5 e 4 a 9 a b 4 7 3 d 3 d b c a d 0 3 f d 4 e 3 9 8 2 0 4 f 8 8 4 d f d 0 3 f 0 f a 8 8 3 d a 2 9 6 a c 0 5 a 8 c 5 2 4 2 a a 4 0 7 9 2 a 3 e 1 7 9 6 2 7 e 5 1 d b 1 5 4
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
2021-09-29 23:39:58 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )