2019-05-02 22:57:43 -07:00
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
2018-03-28 08:55:47 -07:00
2017-11-03 22:47:41 -07: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 07:58:22 +00: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-03 22:47:41 -07:00
H E A D _ R E F m a s t e r
2019-02-28 18:52:31 +11:00
P A T C H E S
2022-08-06 08:25:53 +02:00
f i x - d e p e n d e n c i e s . p a t c h
2019-05-25 02:39:59 +10:00
f i n d _ b l a s . p a t c h
2017-02-18 13:11:48 +01:00
)
2017-11-03 22:47:41 -07:00
2022-08-06 08:25:53 +02:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/dlib/external" )
2017-06-22 14:54:34 -07:00
2020-05-08 08:33:16 +02:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-07-20 12:24:58 -05: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 08:33:16 +02:00
)
2017-11-11 15:31:38 +00:00
2022-09-15 21:33:44 +02:00
if ( VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" )
set ( COMMON_OPTIONS -DUSE_SSE2_INSTRUCTIONS=OFF )
endif ( )
2024-03-08 07:06:15 +01: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-22 14:54:34 -07:00
O P T I O N S
2020-05-08 08:33:16 +02:00
$ { F E A T U R E _ O P T I O N S }
2022-09-15 21:33:44 +02:00
$ { C O M M O N _ O P T I O N S }
2017-06-22 14:54:34 -07:00
- D D L I B _ P N G _ S U P P O R T = O N
2022-08-06 08:25:53 +02: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-22 14:54:34 -07:00
- D D L I B _ J P E G _ S U P P O R T = O N
2022-08-06 08:25:53 +02: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 07:58:20 +11: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-22 14:54:34 -07:00
- D D L I B _ G I F _ S U P P O R T = O F F
2022-08-06 08:25:53 +02:00
- D D L I B _ W E B P _ S U P P O R T = O F F
2017-06-22 14:54:34 -07:00
- D D L I B _ U S E _ M K L _ F F T = O F F
2024-10-15 07:58:22 +00:00
- D D L I B _ U S E _ F F M P E G = O F F
2017-06-22 14:54:34 -07:00
O P T I O N S _ D E B U G
2024-03-08 07:06:15 +01:00
$ { d b g _ o p t s }
2017-06-22 14:54:34 -07:00
#-DDLIB_ENABLE_STACK_TRACE=ON
2017-02-18 13:11:48 +01:00
)
2021-12-14 03:26:16 +08:00
vcpkg_cmake_install ( )
2017-02-18 13:11:48 +01:00
2024-03-08 07:06:15 +01: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-22 14:54:34 -07: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 08:25:53 +02:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc" )
2017-02-18 13:11:48 +01: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 07:58:22 +00: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 13:11:48 +01:00
2024-10-15 07:58:22 +00:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/dlib/LICENSE.txt" )