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(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO davisking/dlib
|
2022-07-14 01:31:37 +08:00
|
|
|
REF 6097093ab329fcd19aed03a8fe67949f6971a65d #v19.24
|
|
|
|
SHA512 4bdcecdf0f986abc748245d21616bf2c304461e9a37572c66743f69141fc3f37eb846fdaedc6c910135d986534f7989cbcc52a884ae7a52464fbb2a07b16a327
|
2017-11-04 13:47:41 +08:00
|
|
|
HEAD_REF master
|
2019-02-28 15:52:31 +08:00
|
|
|
PATCHES
|
2022-08-06 14:25:53 +08:00
|
|
|
fix-dependencies.patch
|
2019-05-25 00:39:59 +08:00
|
|
|
find_blas.patch
|
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
|
|
|
FEATURES
|
|
|
|
"sqlite3" DLIB_LINK_WITH_SQLITE3
|
|
|
|
"fftw3" DLIB_USE_FFTW
|
|
|
|
"cuda" DLIB_USE_CUDA
|
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()
|
|
|
|
|
2021-12-14 03:26:16 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-06-23 05:54:34 +08:00
|
|
|
OPTIONS
|
2020-05-08 14:33:16 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2022-09-16 03:33:44 +08:00
|
|
|
${COMMON_OPTIONS}
|
2017-06-23 05:54:34 +08:00
|
|
|
-DDLIB_PNG_SUPPORT=ON
|
2022-08-06 14:25:53 +08:00
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_PNG=ON
|
2017-06-23 05:54:34 +08:00
|
|
|
-DDLIB_JPEG_SUPPORT=ON
|
2022-08-06 14:25:53 +08:00
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_JPEG=ON
|
2018-01-03 04:58:20 +08:00
|
|
|
-DDLIB_USE_BLAS=ON
|
|
|
|
-DDLIB_USE_LAPACK=ON
|
2017-06-23 05:54:34 +08:00
|
|
|
-DDLIB_GIF_SUPPORT=OFF
|
2022-08-06 14:25:53 +08:00
|
|
|
-DDLIB_WEBP_SUPPORT=OFF
|
2017-06-23 05:54:34 +08:00
|
|
|
-DDLIB_USE_MKL_FFT=OFF
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DDLIB_ENABLE_ASSERTS=ON
|
|
|
|
#-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
|
|
|
|
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")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm")
|
2017-02-18 20:11:48 +08:00
|
|
|
|
2017-05-07 18:03:40 +08:00
|
|
|
# Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead.
|
2021-12-14 03:26:16 +08:00
|
|
|
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")
|
2017-05-07 18:03:40 +08:00
|
|
|
|
2021-12-14 03:26:16 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/dlib/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|