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(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO davisking/dlib
|
2020-04-22 20:28:56 +02:00
|
|
|
REF v19.19
|
|
|
|
SHA512 013f0c37fa98b0b93824ef94f2c50cb7b41461906ddec1df3021b489e8a02d299b20802416e9dcd6483fd55197e3792119e7b7774ca8dd9c307e8be68a39fe6b
|
2017-11-03 22:47:41 -07:00
|
|
|
HEAD_REF master
|
2019-02-28 18:52:31 +11:00
|
|
|
PATCHES
|
|
|
|
fix-sqlite3-fftw-linkage.patch
|
2019-05-03 20:43:35 +02:00
|
|
|
force_finding_packages.patch
|
2019-05-25 02:39:59 +10:00
|
|
|
find_blas.patch
|
2017-02-18 13:11:48 +01:00
|
|
|
)
|
2017-11-03 22:47:41 -07:00
|
|
|
|
2017-03-16 15:11:34 -07: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 13:11:48 +01:00
|
|
|
|
2017-06-22 14:54:34 -07: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}")
|
|
|
|
|
2017-11-11 15:31:38 +00:00
|
|
|
set(WITH_CUDA OFF)
|
|
|
|
if("cuda" IN_LIST FEATURES)
|
|
|
|
set(WITH_CUDA ON)
|
|
|
|
endif()
|
|
|
|
|
2017-02-18 13:11:48 +01:00
|
|
|
vcpkg_configure_cmake(
|
2017-06-22 14:54:34 -07:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-05-03 20:43:35 +02:00
|
|
|
PREFER_NINJA
|
2017-06-22 14:54:34 -07:00
|
|
|
OPTIONS
|
|
|
|
-DDLIB_LINK_WITH_SQLITE3=ON
|
|
|
|
-DDLIB_USE_FFTW=ON
|
|
|
|
-DDLIB_PNG_SUPPORT=ON
|
|
|
|
-DDLIB_JPEG_SUPPORT=ON
|
2018-01-03 07:58:20 +11:00
|
|
|
-DDLIB_USE_BLAS=ON
|
|
|
|
-DDLIB_USE_LAPACK=ON
|
2017-11-11 15:31:38 +00:00
|
|
|
-DDLIB_USE_CUDA=${WITH_CUDA}
|
2017-06-22 14:54:34 -07:00
|
|
|
-DDLIB_GIF_SUPPORT=OFF
|
|
|
|
-DDLIB_USE_MKL_FFT=OFF
|
2019-05-03 20:43:35 +02:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
2017-06-22 14:54:34 -07:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DDLIB_ENABLE_ASSERTS=ON
|
|
|
|
#-DDLIB_ENABLE_STACK_TRACE=ON
|
2017-02-18 13:11:48 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2017-11-04 00:39:59 -07:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/dlib)
|
2017-06-22 14:54:34 -07:00
|
|
|
|
2017-02-18 13:11:48 +01:00
|
|
|
# There is no way to suppress installation of the headers and resource files in debug build.
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
|
|
|
# Remove other files not required in package
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/all)
|
2017-12-20 08:15:18 -08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/appveyor)
|
2017-03-17 01:17:34 +07:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/test)
|
2019-05-03 20:43:35 +02:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/travis)
|
2017-11-04 00:39:59 -07:00
|
|
|
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)
|
2018-05-27 08:46:34 -07:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_avx)
|
2018-07-08 22:30:49 -07:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_sse4)
|
2020-04-22 20:28:56 +02:00
|
|
|
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)
|
2017-02-18 13:11:48 +01:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm)
|
|
|
|
|
2017-05-07 03:03:40 -07:00
|
|
|
# Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead.
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/dlib/config.h _contents)
|
2018-01-27 16:07:07 -08:00
|
|
|
string(REPLACE "/* #undef ENABLE_ASSERTS */" "#if defined(_DEBUG)\n#define ENABLE_ASSERTS\n#endif" _contents ${_contents})
|
|
|
|
string(REPLACE "#define DLIB_DISABLE_ASSERTS" "#if !defined(_DEBUG)\n#define DLIB_DISABLE_ASSERTS\n#endif" _contents ${_contents})
|
2018-07-03 12:41:53 +01:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/dlib/config.h "${_contents}")
|
2017-05-07 03:03:40 -07:00
|
|
|
|
2017-02-18 13:11:48 +01:00
|
|
|
# Handle copyright
|
2020-04-22 20:28:56 +02:00
|
|
|
file(INSTALL ${SOURCE_PATH}/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2017-03-17 01:17:34 +07:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)
|