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
2022-07-14 01:31:37 +08:00
R E F 6 0 9 7 0 9 3 a b 3 2 9 f c d 1 9 a e d 0 3 a 8 f e 6 7 9 4 9 f 6 9 7 1 a 6 5 d #v19.24
S H A 5 1 2 4 b d c e c d f 0 f 9 8 6 a b c 7 4 8 2 4 5 d 2 1 6 1 6 b f 2 c 3 0 4 4 6 1 e 9 a 3 7 5 7 2 c 6 6 7 4 3 f 6 9 1 4 1 f c 3 f 3 7 e b 8 4 6 f d a e d c 6 c 9 1 0 1 3 5 d 9 8 6 5 3 4 f 7 9 8 9 c b c c 5 2 a 8 8 4 a e 7 a 5 2 4 6 4 f b b 2 a 0 7 b 1 6 a 3 2 7
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
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" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm" )
2017-02-18 13:11:48 +01:00
2021-12-14 03:26:16 +08:00
file ( INSTALL "${SOURCE_PATH}/dlib/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )