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