2021-01-11 15:55:40 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/mozjpeg/copyright" )
message ( FATAL_ERROR "Can't build ${PORT} if mozjpeg is installed. Please remove mozjpeg:${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 ( )
2018-09-12 04:11:51 +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 l i b j p e g - t u r b o / l i b j p e g - t u r b o
2023-02-04 03:20:01 +08:00
R E F " $ { V E R S I O N } "
2024-09-17 03:45:13 +08:00
S H A 5 1 2 f 4 3 e 1 b 6 b 9 d 0 4 8 e 2 9 e 3 8 1 7 9 6 c 7 1 e 1 c 3 4 a 0 4 c 0 f 1 c 5 2 c 1 f 4 6 2 d b 9 f 9 9 3 0 c f c 7 5 d 6 9 a 5 0 8 6 1 b e 2 5 7 0 a 6 a 4 a d c 2 6 a 4 1 8 3 b 6 6 0 1 3 0 0 f d 9 d 5 5 5 3 c 0 6 b c 0 4 2 f 0 d 3 2 f c 1 e 4 0 8 e d 9
2018-09-12 04:11:51 +08:00
H E A D _ R E F m a s t e r
P A T C H E S
a d d - o p t i o n s - f o r - e x e s - d o c s - h e a d e r s . p a t c h
2021-12-29 10:38:36 +08:00
# workaround for vcpkg bug see #5697 on github for more information
2019-05-07 00:54:05 +08:00
w o r k a r o u n d _ c m a k e _ s y s t e m _ p r o c e s s o r . p a t c h
2016-09-19 11:50:08 +08:00
)
2023-09-26 14:51:24 +08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32" )
set ( LIBJPEGTURBO_SIMD -DWITH_SIMD=OFF )
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR ( VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" ) )
2022-05-21 05:44:29 +08:00
set ( LIBJPEGTURBO_SIMD -DWITH_SIMD=ON -DNEON_INTRINSICS=ON )
2018-01-04 07:19:52 +08:00
else ( )
set ( LIBJPEGTURBO_SIMD -DWITH_SIMD=ON )
vcpkg_find_acquire_program ( NASM )
get_filename_component ( NASM_EXE_PATH ${ NASM } DIRECTORY )
set ( ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}" )
endif ( )
2016-09-19 11:50:08 +08:00
2018-03-18 15:33:00 +08:00
if ( VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
set ( ENV{_CL_} "-DNO_GETENV -DNO_PUTENV" )
endif ( )
2017-10-26 02:28:27 +08:00
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED )
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC )
string ( COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL )
2016-11-02 02:11:24 +08:00
2020-12-10 03:52:46 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-09-09 06:28:41 +08:00
F E A T U R E S
j p e g 7 W I T H _ J P E G 7
j p e g 8 W I T H _ J P E G 8
2020-12-10 03:52:46 +08:00
)
2021-12-29 10:38:36 +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 } "
2016-09-19 11:50:08 +08:00
O P T I O N S
2017-10-17 02:22:21 +08:00
- 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 }
- 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 }
2016-09-19 11:50:08 +08:00
- D E N A B L E _ E X E C U T A B L E S = O F F
- D I N S T A L L _ D O C S = O F F
2017-10-26 02:28:27 +08:00
- D W I T H _ C R T _ D L L = $ { W I T H _ C R T _ D L L }
2020-12-10 03:52:46 +08:00
$ { F E A T U R E _ O P T I O N S }
2017-03-14 09:01:17 +08:00
$ { L I B J P E G T U R B O _ S I M D }
2021-09-09 06:28:41 +08:00
O P T I O N S _ D E B U G
- D I N S T A L L _ H E A D E R S = O F F
M A Y B E _ U N U S E D _ V A R I A B L E S
W I T H _ C R T _ D L L
2016-09-19 11:50:08 +08:00
)
2021-12-29 10:38:36 +08:00
vcpkg_cmake_install ( )
2022-03-12 03:17:51 +08:00
vcpkg_copy_pdbs ( )
vcpkg_fixup_pkgconfig ( )
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/libjpeg-turbo )
2016-09-19 11:50:08 +08:00
2016-11-17 23:43:08 +08:00
# Rename libraries for static builds
2019-05-07 00:54:05 +08:00
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" )
2021-09-09 06:28:41 +08:00
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" )
2022-03-12 03:17:51 +08:00
endif ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2019-06-07 14:34:06 +08:00
2022-03-12 03:17:51 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-debug.cmake" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-debug.cmake"
2024-06-20 05:07:05 +08:00
" j p e g - s t a t i c $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " " j p e g $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " I G N O R E _ U N C H A N G E D )
2022-03-12 03:17:51 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-debug.cmake"
2024-06-20 05:07:05 +08:00
" t u r b o j p e g - s t a t i c $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " " t u r b o j p e g $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " I G N O R E _ U N C H A N G E D )
2022-03-12 03:17:51 +08:00
endif ( )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-release.cmake" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-release.cmake"
2024-06-20 05:07:05 +08:00
" j p e g - s t a t i c $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " " j p e g $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " I G N O R E _ U N C H A N G E D )
2022-03-12 03:17:51 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/share/${PORT}/libjpeg-turboTargets-release.cmake"
2024-06-20 05:07:05 +08:00
" t u r b o j p e g - s t a t i c $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " " t u r b o j p e g $ { V C P K G _ T A R G E T _ S T A T I C _ L I B R A R Y _ S U F F I X } " I G N O R E _ U N C H A N G E D )
2019-05-07 00:54:05 +08:00
endif ( )
2016-11-17 23:43:08 +08:00
endif ( )
2021-12-29 10:38:36 +08:00
file ( REMOVE_RECURSE
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / m a n " )
2019-05-07 00:54:05 +08:00
2021-12-29 10:38:36 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/jpeg" )
2019-06-07 14:34:06 +08:00
2023-02-04 03:20:01 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/LICENSE.md" )