early-access version 2853
This commit is contained in:
13
externals/vcpkg/ports/dlib/find_blas.patch
vendored
Executable file
13
externals/vcpkg/ports/dlib/find_blas.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/dlib/cmake_utils/find_blas.cmake b/dlib/cmake_utils/find_blas.cmake
|
||||
index 806b938..507f871 100644
|
||||
--- a/dlib/cmake_utils/find_blas.cmake
|
||||
+++ b/dlib/cmake_utils/find_blas.cmake
|
||||
@@ -438,7 +438,7 @@ endif()
|
||||
# If using lapack, determine whether to mangle functions
|
||||
if (lapack_found)
|
||||
include(CheckFortranFunctionExists)
|
||||
- set(CMAKE_REQUIRED_LIBRARIES ${lapack_libraries})
|
||||
+ set(CMAKE_REQUIRED_LIBRARIES ${lapack_libraries} ${blas_libraries})
|
||||
|
||||
check_function_exists("sgesv" LAPACK_FOUND_C_UNMANGLED)
|
||||
check_function_exists("sgesv_" LAPACK_FOUND_C_MANGLED)
|
||||
57
externals/vcpkg/ports/dlib/fix-sqlite3-fftw-linkage.patch
vendored
Executable file
57
externals/vcpkg/ports/dlib/fix-sqlite3-fftw-linkage.patch
vendored
Executable file
@@ -0,0 +1,57 @@
|
||||
diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt
|
||||
--- a/dlib/CMakeLists.txt
|
||||
+++ b/dlib/CMakeLists.txt
|
||||
@@ -747,32 +750,15 @@
|
||||
|
||||
|
||||
if (DLIB_LINK_WITH_SQLITE3)
|
||||
- find_library(sqlite sqlite3)
|
||||
- # make sure sqlite3.h is in the include path
|
||||
- find_path(sqlite_path sqlite3.h)
|
||||
- if (sqlite AND sqlite_path)
|
||||
- set(dlib_needed_includes ${dlib_needed_includes} ${sqlite_path})
|
||||
- set(dlib_needed_libraries ${dlib_needed_libraries} ${sqlite} )
|
||||
- else()
|
||||
- set(DLIB_LINK_WITH_SQLITE3 OFF CACHE STRING ${DLIB_LINK_WITH_SQLITE3_STR} FORCE )
|
||||
- endif()
|
||||
- mark_as_advanced(sqlite sqlite_path)
|
||||
+ find_package(unofficial-sqlite3 CONFIG)
|
||||
+ set(dlib_needed_libraries ${dlib_needed_libraries} unofficial::sqlite3::sqlite3)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if (DLIB_USE_FFTW)
|
||||
- find_library(fftw fftw3)
|
||||
- # make sure fftw3.h is in the include path
|
||||
- find_path(fftw_path fftw3.h)
|
||||
- if (fftw AND fftw_path)
|
||||
- set(dlib_needed_includes ${dlib_needed_includes} ${fftw_path})
|
||||
- set(dlib_needed_libraries ${dlib_needed_libraries} ${fftw} )
|
||||
- else()
|
||||
- set(DLIB_USE_FFTW OFF CACHE STRING ${DLIB_USE_FFTW_STR} FORCE )
|
||||
- toggle_preprocessor_switch(DLIB_USE_FFTW)
|
||||
- endif()
|
||||
- mark_as_advanced(fftw fftw_path)
|
||||
+ find_package(FFTW3 CONFIG)
|
||||
+ set(dlib_needed_libraries ${dlib_needed_libraries} FFTW3::fftw3)
|
||||
endif()
|
||||
|
||||
|
||||
--- a/dlib/cmake_utils/dlibConfig.cmake.in
|
||||
+++ b/dlib/cmake_utils/dlibConfig.cmake.in
|
||||
@@ -28,6 +28,14 @@
|
||||
include("${dlib_CMAKE_DIR}/dlib.cmake")
|
||||
endif()
|
||||
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+if("@DLIB_USE_FFTW@")
|
||||
+ find_dependency(FFTW3 CONFIG)
|
||||
+endif()
|
||||
+if("@DLIB_LINK_WITH_SQLITE3@")
|
||||
+ find_dependency(unofficial-sqlite3 CONFIG)
|
||||
+endif()
|
||||
+
|
||||
set(dlib_LIBRARIES dlib::dlib)
|
||||
set(dlib_LIBS dlib::dlib)
|
||||
set(dlib_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@" "@dlib_needed_includes@")
|
||||
44
externals/vcpkg/ports/dlib/force_finding_packages.patch
vendored
Executable file
44
externals/vcpkg/ports/dlib/force_finding_packages.patch
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
diff --git a/dlib/cmake_utils/find_libjpeg.cmake b/dlib/cmake_utils/find_libjpeg.cmake
|
||||
index 3b9e656..d741f31 100644
|
||||
--- a/dlib/cmake_utils/find_libjpeg.cmake
|
||||
+++ b/dlib/cmake_utils/find_libjpeg.cmake
|
||||
@@ -14,7 +14,7 @@ if (DEFINED JPEG_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
-find_package(JPEG QUIET)
|
||||
+find_package(JPEG REQUIRED)
|
||||
|
||||
if(JPEG_FOUND)
|
||||
set(JPEG_TEST_CMAKE_FLAGS
|
||||
@@ -31,7 +31,7 @@ if(JPEG_FOUND)
|
||||
message (STATUS "Found system copy of libjpeg: ${JPEG_LIBRARY}")
|
||||
if(NOT test_for_libjpeg_worked)
|
||||
set(JPEG_FOUND 0)
|
||||
- message (STATUS "System copy of libjpeg is broken or too old. Will build our own libjpeg and use that instead.")
|
||||
+ message (FATAL_ERROR "System copy of libjpeg is broken or too old. Will build our own libjpeg and use that instead.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
diff --git a/dlib/cmake_utils/find_libpng.cmake b/dlib/cmake_utils/find_libpng.cmake
|
||||
index 1b35604..489a4c8 100644
|
||||
--- a/dlib/cmake_utils/find_libpng.cmake
|
||||
+++ b/dlib/cmake_utils/find_libpng.cmake
|
||||
@@ -14,7 +14,7 @@ if (DEFINED PNG_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
-find_package(PNG QUIET)
|
||||
+find_package(PNG REQUIRED)
|
||||
|
||||
if(PNG_FOUND)
|
||||
set(PNG_TEST_CMAKE_FLAGS
|
||||
@@ -31,7 +31,7 @@ if(PNG_FOUND)
|
||||
message (STATUS "Found system copy of libpng: ${PNG_LIBRARIES}")
|
||||
if(NOT test_for_libpng_worked)
|
||||
set(PNG_FOUND 0)
|
||||
- message (STATUS "System copy of libpng is broken. Will build our own libpng and use that instead.")
|
||||
+ message (FATAL_ERROR "System copy of libpng is broken. Will build our own libpng and use that instead.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
78
externals/vcpkg/ports/dlib/portfile.cmake
vendored
Executable file
78
externals/vcpkg/ports/dlib/portfile.cmake
vendored
Executable file
@@ -0,0 +1,78 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO davisking/dlib
|
||||
REF 074ab8bdbadbee1afb95653c3ce46867ed32dfa1 #v19.23
|
||||
SHA512 da7942cf006566bafdd7079cc31ac445cd66e300714e522c53dfcf6b1a811de4cf2188c9a75c978388b09554bccc4164d40afc907bf9e6f75a17f8ca10ee0355
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-sqlite3-fftw-linkage.patch
|
||||
force_finding_packages.patch
|
||||
find_blas.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/dlib/external/libjpeg")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/dlib/external/libpng")
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/dlib/external/zlib")
|
||||
|
||||
# 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}")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
"sqlite3" DLIB_LINK_WITH_SQLITE3
|
||||
"fftw3" DLIB_USE_FFTW
|
||||
"cuda" DLIB_USE_CUDA
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DDLIB_PNG_SUPPORT=ON
|
||||
-DDLIB_JPEG_SUPPORT=ON
|
||||
-DDLIB_USE_BLAS=ON
|
||||
-DDLIB_USE_LAPACK=ON
|
||||
-DDLIB_GIF_SUPPORT=OFF
|
||||
-DDLIB_USE_MKL_FFT=OFF
|
||||
-DCMAKE_DEBUG_POSTFIX=d
|
||||
OPTIONS_DEBUG
|
||||
-DDLIB_ENABLE_ASSERTS=ON
|
||||
#-DDLIB_ENABLE_STACK_TRACE=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/dlib)
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# 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")
|
||||
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")
|
||||
|
||||
# Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead.
|
||||
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")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/dlib/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
||||
46
externals/vcpkg/ports/dlib/vcpkg.json
vendored
Executable file
46
externals/vcpkg/ports/dlib/vcpkg.json
vendored
Executable file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "dlib",
|
||||
"version": "19.23",
|
||||
"description": "Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++",
|
||||
"homepage": "https://github.com/davisking/dlib",
|
||||
"license": "BSL-1.0",
|
||||
"dependencies": [
|
||||
"blas",
|
||||
"lapack",
|
||||
"libjpeg-turbo",
|
||||
"libpng",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"fftw3",
|
||||
"sqlite3"
|
||||
],
|
||||
"features": {
|
||||
"cuda": {
|
||||
"description": "CUDA support for dlib",
|
||||
"dependencies": [
|
||||
"cuda",
|
||||
"cudnn"
|
||||
]
|
||||
},
|
||||
"fftw3": {
|
||||
"description": "fftw3 support for dlib",
|
||||
"dependencies": [
|
||||
"fftw3"
|
||||
]
|
||||
},
|
||||
"sqlite3": {
|
||||
"description": "sqlite3 support for dlib",
|
||||
"dependencies": [
|
||||
"sqlite3"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user