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-02-09 01:05:09 +08:00
|
|
|
REF 074ab8bdbadbee1afb95653c3ce46867ed32dfa1 #v19.23
|
|
|
|
SHA512 da7942cf006566bafdd7079cc31ac445cd66e300714e522c53dfcf6b1a811de4cf2188c9a75c978388b09554bccc4164d40afc907bf9e6f75a17f8ca10ee0355
|
2017-11-04 13:47:41 +08:00
|
|
|
HEAD_REF master
|
2019-02-28 15:52:31 +08:00
|
|
|
PATCHES
|
|
|
|
fix-sqlite3-fftw-linkage.patch
|
2019-05-04 02:43:35 +08:00
|
|
|
force_finding_packages.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
|
|
|
|
2021-12-14 03:26:16 +08:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/dlib/external/libjpeg")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/dlib/external/libpng")
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/dlib/external/zlib")
|
2017-02-18 20:11:48 +08:00
|
|
|
|
2017-06-23 05:54:34 +08:00
|
|
|
# This fixes static builds; dlib doesn't pull in the needed transitive dependencies
|
|
|
|
file(READ "${SOURCE_PATH}/dlib/CMakeLists.txt" DLIB_CMAKE)
|
|
|
|
string(REPLACE "PNG_LIBRARY" "PNG_LIBRARIES" DLIB_CMAKE "${DLIB_CMAKE}")
|
|
|
|
file(WRITE "${SOURCE_PATH}/dlib/CMakeLists.txt" "${DLIB_CMAKE}")
|
|
|
|
|
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
|
|
|
|
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}
|
2017-06-23 05:54:34 +08:00
|
|
|
-DDLIB_PNG_SUPPORT=ON
|
|
|
|
-DDLIB_JPEG_SUPPORT=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
|
|
|
|
-DDLIB_USE_MKL_FFT=OFF
|
2019-05-04 02:43:35 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
2017-06-23 05:54:34 +08:00
|
|
|
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
|
|
|
|
2017-02-18 20:11:48 +08:00
|
|
|
# There is no way to suppress installation of the headers and resource files in debug build.
|
2021-12-14 03:26:16 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
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
|
|
|
|
2017-02-18 20:11:48 +08:00
|
|
|
# Handle copyright
|
2021-12-14 03:26:16 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/dlib/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|