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 ( )
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
2021-02-02 11:24:55 +08:00
R E F 1 0 b a 6 e d 3 3 6 5 6 1 5 e d 5 c 2 9 9 5 f e 2 d 2 4 0 c b 2 d 5 0 0 0 1 7 3 # 2.0.6
S H A 5 1 2 2 1 9 d 0 1 9 0 7 e 6 6 d d 0 f c 2 0 e a 1 3 c f a 5 1 a 8 e f e e 3 0 5 8 1 0 f 1 2 4 5 d 0 6 4 8 b 6 a d 8 e e 3 c f 1 1 b f 0 b b d 4 3 b 1 c e e e b 1 4 2 a 6 e b b b f a 2 8 1 e c 6 a 3 b 4 e 2 8 3 b 2 f c 3 4 3 c 3 6 0 c d 3 a d 2 9 e 9 d 4 2 5 2 8
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
2019-05-07 00:54:05 +08:00
#workaround for vcpkg bug see #5697 on github for more information
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
2020-12-27 14:39:06 +08:00
f i x - i n c o m p a t i b i l i t y - f o r - c 1 1 - c 1 7 . p a t c h
2016-09-19 11:50:08 +08:00
)
2018-03-14 02:34:59 +08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR ( VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" ) )
2018-01-04 07:19:52 +08:00
set ( LIBJPEGTURBO_SIMD -DWITH_SIMD=OFF )
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
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
)
2016-09-19 11:50:08 +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 }
2017-03-14 09:01:17 +08:00
P R E F E R _ N I N J A
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 }
2016-09-19 11:50:08 +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
)
vcpkg_install_cmake ( )
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" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpegd.lib" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpegd.lib" )
2019-06-07 14:34:06 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /bin ${ CURRENT_PACKAGES_DIR } /debug/bin )
2019-05-07 00:54:05 +08:00
endif ( )
else ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpegd.lib" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpegd.lib" )
endif ( )
2016-11-17 23:43:08 +08:00
endif ( )
2021-01-20 14:30:34 +08:00
set ( _file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libjpeg.pc" )
if ( EXISTS "${_file}" AND VCPKG_TARGET_IS_WINDOWS )
vcpkg_replace_string ( "${_file}" "-ljpeg" "-ljpegd" )
endif ( )
vcpkg_fixup_pkgconfig ( )
2019-05-07 00:54:05 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
2019-06-07 14:34:06 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
2019-05-07 00:54:05 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /share/man )
2019-06-07 14:34:06 +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 )
2020-12-27 14:39:06 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE.md DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
2019-06-07 14:34:06 +08:00
2020-12-27 14:39:06 +08:00
vcpkg_copy_pdbs ( )