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
2020-06-06 03:10:36 +08:00
R E F 6 d 9 5 c 5 1 a d f 0 c 3 1 4 0 1 7 f 5 4 1 b 6 c b 0 7 e 1 3 c c 1 b c e 7 5 4
S H A 5 1 2 a 2 1 c 8 b 3 a 5 6 1 b 3 8 7 9 3 3 a 2 7 b e f a a 1 d 0 5 a 8 c 6 3 b 0 e 2 0 3 d 7 2 d 7 3 0 7 1 a 4 c 9 b 5 7 c 6 b 7 d 5 7 b 4 4 8 3 6 f 2 1 1 c 4 d c b 8 0 e e e 4 b 0 1 8 7 6 f 0 a 0 f b 4 c 9 1 a 6 0 c 3 a e 8 6 7 e 9 0 6 e 5 e 4 e 2 7 1 6 5 6 2 7
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 )
2017-10-06 00:15:42 +08:00
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2019-08-01 04:01:02 +08:00
P R E F E R _ N I N J A
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
)
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 ( )