2019-05-03 13:57:43 +08:00
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
2018-03-28 23:55:47 +08:00
2017-11-04 13:47:41 +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 d a v i s k i n g / d l i b
2024-10-15 15:58:22 +08:00
R E F " v $ { V E R S I O N } "
S H A 5 1 2 5 4 8 f 1 5 f c d 3 4 5 a 5 6 b 6 e 7 a 0 a 5 6 8 f a 7 c 6 9 4 b e e e d a 3 b 8 6 3 4 9 2 f 5 9 b d a a 0 b 0 e 6 d 4 8 b 2 1 d 6 7 0 5 e 2 a c 5 6 a 0 6 f 3 4 9 a a 2 6 b 0 e 9 b 7 9 a a 0 a 4 3 7 8 7 0 9 4 0 1 7 0 7 7 2 b 5 b 3 0 c f 3 5 8 4 1 c b b 4
2017-11-04 13:47:41 +08:00
H E A D _ R E F m a s t e r
2019-02-28 15:52:31 +08:00
P A T C H E S
2022-08-06 14:25:53 +08:00
f i x - d e p e n d e n c i e s . p a t c h
2019-05-25 00:39:59 +08:00
f i n d _ b l a s . p a t c h
2017-02-18 20:11:48 +08:00
)
2017-11-04 13:47:41 +08:00
2022-08-06 14:25:53 +08:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/dlib/external" )
2017-06-23 05:54:34 +08:00
2020-05-08 14:33:16 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-07-21 01:24:58 +08:00
F E A T U R E S
" s q l i t e 3 " D L I B _ L I N K _ W I T H _ S Q L I T E 3
" f f t w 3 " D L I B _ U S E _ F F T W
" c u d a " D L I B _ U S E _ C U D A
2020-05-08 14:33:16 +08:00
)
2017-11-11 23:31:38 +08:00
2022-09-16 03:33:44 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" )
set ( COMMON_OPTIONS -DUSE_SSE2_INSTRUCTIONS=OFF )
endif ( )
2024-03-08 14:06:15 +08:00
set ( dbg_opts "" )
if ( VCPKG_TARGET_IS_WINDOWS )
set ( dbg_opts -DDLIB_ENABLE_ASSERTS=ON )
endif ( )
2021-12-14 03:26:16 +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-06-23 05:54:34 +08:00
O P T I O N S
2020-05-08 14:33:16 +08:00
$ { F E A T U R E _ O P T I O N S }
2022-09-16 03:33:44 +08:00
$ { C O M M O N _ O P T I O N S }
2017-06-23 05:54:34 +08:00
- D D L I B _ P N G _ S U P P O R T = O N
2022-08-06 14:25:53 +08:00
- D C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ P N G = O N
2017-06-23 05:54:34 +08:00
- D D L I B _ J P E G _ S U P P O R T = O N
2022-08-06 14:25:53 +08:00
- D C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ J P E G = O N
2018-01-03 04:58:20 +08:00
- D D L I B _ U S E _ B L A S = O N
- D D L I B _ U S E _ L A P A C K = O N
2017-06-23 05:54:34 +08:00
- D D L I B _ G I F _ S U P P O R T = O F F
2022-08-06 14:25:53 +08:00
- D D L I B _ W E B P _ S U P P O R T = O F F
2017-06-23 05:54:34 +08:00
- D D L I B _ U S E _ M K L _ F F T = O F F
2024-10-15 15:58:22 +08:00
- D D L I B _ U S E _ F F M P E G = O F F
2017-06-23 05:54:34 +08:00
O P T I O N S _ D E B U G
2024-03-08 14:06:15 +08:00
$ { d b g _ o p t s }
2017-06-23 05:54:34 +08:00
#-DDLIB_ENABLE_STACK_TRACE=ON
2017-02-18 20:11:48 +08:00
)
2021-12-14 03:26:16 +08:00
vcpkg_cmake_install ( )
2017-02-18 20:11:48 +08:00
2024-03-08 14:06:15 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
# Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead. <- The below is using _DEBUG but there is no correct way to switch this on !windows
# Only windows defines _DEBUG in debug builds.
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/dlib/config.h" "/* #undef ENABLE_ASSERTS */" "#if defined(_DEBUG)\n#define ENABLE_ASSERTS\n#endif" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/dlib/config.h" "#define DLIB_DISABLE_ASSERTS" "#if !defined(_DEBUG)\n#define DLIB_DISABLE_ASSERTS\n#endif" )
endif ( )
2021-12-14 03:26:16 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/dlib )
vcpkg_fixup_pkgconfig ( )
2017-06-23 05:54:34 +08:00
2021-12-14 03:26:16 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2022-08-06 14:25:53 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc" )
2017-02-18 20:11:48 +08:00
# Remove other files not required in package
2021-12-14 03:26:16 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/all" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/appveyor" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/test" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/travis" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_neon" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cudnn" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cuda" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cpp11" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_avx" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_sse4" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libjpeg" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libpng" )
2024-10-15 15:58:22 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libjxl" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libwebp" )
2021-12-14 03:26:16 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm" )
2017-02-18 20:11:48 +08:00
2024-10-15 15:58:22 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/dlib/LICENSE.txt" )