2020-12-29 04:37:54 +08:00
if ( EXISTS ${ CURRENT_INSTALLED_DIR } /share/libturbo-jpeg/copyright )
message ( FATAL_ERROR "'${PORT}' conflicts with 'libturbo-jpeg'. Please remove libturbo-jpeg:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again." )
endif ( )
if ( EXISTS ${ CURRENT_INSTALLED_DIR } /share/mozjpeg/copyright )
message ( FATAL_ERROR "'${PORT}' conflicts with 'mozjpeg'. Please remove mozjpeg:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again." )
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS )
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
endif ( )
vcpkg_download_distfile ( ARCHIVE
2022-04-26 08:28:30 +08:00
U R L S " h t t p : / / w w w . i j g . o r g / f i l e s / j p e g s r 9 e . z i p "
F I L E N A M E " j p e g s r 9 e . z i p "
S H A 5 1 2 d b 7 a 2 f b 4 4 e 5 c c 2 0 d 6 1 9 5 6 c 4 6 3 3 4 9 4 8 a f 0 3 4 c 0 7 c d c c 0 d 6 e 4 1 d 9 b d 4 f 6 6 1 1 c 0 f b e d 8 9 4 3 d 0 a 0 5 0 2 9 b a 1 b f b 9 d 9 9 3 f 4 a c d 0 d f 5 e 9 5 d 0 b c 1 c f b 5 a 8 8 9 b 8 6 a 5 5 b 6 b 7 5 f d f 6 4
2020-12-29 04:37:54 +08:00
)
vcpkg_extract_source_archive_ex (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
A R C H I V E $ { A R C H I V E }
)
# Replace some #define in jconfig.txt to #cmakedefine so the CMakeLists.txt can run `configure_file` command.
# See https://github.com/LuaDist/libjpeg
2022-04-26 08:28:30 +08:00
vcpkg_replace_string ( "${SOURCE_PATH}/jconfig.txt"
2020-12-29 04:37:54 +08:00
" #define HAVE_STDDEF_H"
" #cmakedefine HAVE_STDDEF_H"
)
2022-04-26 08:28:30 +08:00
vcpkg_replace_string ( "${SOURCE_PATH}/jconfig.txt"
2020-12-29 04:37:54 +08:00
" #define HAVE_STDLIB_H"
" #cmakedefine HAVE_STDLIB_H"
)
2022-04-26 08:28:30 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}" )
2020-12-29 04:37:54 +08:00
2022-04-26 08:28:30 +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 } "
2020-12-29 04:37:54 +08:00
O P T I O N S
- D B U I L D _ E X E C U T A B L E S = O F F # supports [tools] feature to enable this option?
)
2022-04-26 08:28:30 +08:00
vcpkg_cmake_install ( )
2020-12-29 04:37:54 +08:00
vcpkg_copy_pdbs ( )
# There is no LICENSE file, but README containes some legal text.
2022-04-26 08:28:30 +08:00
file ( INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )
2020-12-29 04:37:54 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2022-04-26 08:28:30 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2020-12-29 04:37:54 +08:00
endif ( )
2022-04-26 08:28:30 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )