aboutsummaryrefslogtreecommitdiff
path: root/ports/dlib
diff options
context:
space:
mode:
authorAlexander Saprykin <xelfium@gmail.com>2018-05-26 13:27:14 +0200
committerGitHub <noreply@github.com>2018-05-26 13:27:14 +0200
commit4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5 (patch)
treed95c9490352eb73f078d34a33bc4bb44ac9fa48b /ports/dlib
parentfb689bd13dd6ba563a885d71fff1dd2b32a615db (diff)
parent2ac7527b40b1dbeb7856b9f763362c1e139e2ca9 (diff)
downloadvcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.tar.gz
vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.zip
Merge pull request #1 from Microsoft/master
Update vcpkg from upstream
Diffstat (limited to 'ports/dlib')
-rw-r--r--ports/dlib/CONTROL8
-rw-r--r--ports/dlib/portfile.cmake90
2 files changed, 61 insertions, 37 deletions
diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL
index a6e886c4a..bfd8e371f 100644
--- a/ports/dlib/CONTROL
+++ b/ports/dlib/CONTROL
@@ -1,4 +1,8 @@
Source: dlib
-Version: 19.4-3
-Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3
+Version: 19.12
+Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas, clapack
Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++
+
+Feature: cuda
+Build-Depends: cuda
+Description: CUDA support for dlib
diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake
index 2a5ae6f44..5889f7fe5 100644
--- a/ports/dlib/portfile.cmake
+++ b/ports/dlib/portfile.cmake
@@ -1,63 +1,83 @@
-# Common Ambient Variables:
-# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
-# TARGET_TRIPLET is the current triplet (x86-windows, etc)
-# PORT is the current port name (zlib, etc)
-# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
-# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
-
include(vcpkg_common_functions)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dlib-19.4)
-vcpkg_download_distfile(ARCHIVE
- URLS "http://dlib.net/files/dlib-19.4.tar.bz2"
- FILENAME "dlib-19.4.tar.bz2"
- SHA512 c5ae22c507b57a13d880d79e9671730829114d0276508b0a41b373d3abae9057d960fce84fafe1be468d943910853baaa70c88f2516e20a0c41f3895bf217f7b
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ message("dlib only supports static linkage")
+ set(VCPKG_LIBRARY_LINKAGE "static")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO davisking/dlib
+ REF v19.12
+ SHA512 d10f050df116b038045821c3af71f9e6e12cbe2fc328f1361d6a64edc9a80899f50f024cfb07df96a326a99b0925a1f2ca8b186dc3b424e823cfea1efa331acf
+ HEAD_REF master
)
-vcpkg_extract_source_archive(${ARCHIVE})
+
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}")
+
+set(WITH_CUDA OFF)
+if("cuda" IN_LIST FEATURES)
+ set(WITH_CUDA ON)
+endif()
+
vcpkg_configure_cmake(
- SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
- OPTIONS
- -DDLIB_LINK_WITH_SQLITE3=ON
- -DDLIB_USE_FFTW=ON
- -DDLIB_PNG_SUPPORT=ON
- -DDLIB_JPEG_SUPPORT=ON
- -DDLIB_USE_BLAS=OFF
- -DDLIB_USE_LAPACK=OFF
- -DDLIB_USE_CUDA=OFF
- -DDLIB_GIF_SUPPORT=OFF
- -DDLIB_USE_MKL_FFT=OFF
- #-DDLIB_USE_CUDA=ON
- OPTIONS_DEBUG
- -DDLIB_ENABLE_ASSERTS=ON
- #-DDLIB_ENABLE_STACK_TRACE=ON
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DDLIB_LINK_WITH_SQLITE3=ON
+ -DDLIB_USE_FFTW=ON
+ -DDLIB_PNG_SUPPORT=ON
+ -DDLIB_JPEG_SUPPORT=ON
+ -DDLIB_USE_BLAS=ON
+ -DDLIB_USE_LAPACK=ON
+ -DDLIB_USE_CUDA=${WITH_CUDA}
+ -DDLIB_GIF_SUPPORT=OFF
+ -DDLIB_USE_MKL_FFT=OFF
+ OPTIONS_DEBUG
+ -DDLIB_ENABLE_ASSERTS=ON
+ #-DDLIB_ENABLE_STACK_TRACE=ON
)
vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/dlib)
+
# 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)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
# Remove other files not required in package
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
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)
+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/external/libpng/arm)
# 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)
-string(REPLACE "/* #undef ENABLE_ASSERTS */" "#if !defined(NDEBUG)\n#define ENABLE_ASSERTS\n#endif" _contents ${_contents})
-string(REPLACE "#define DLIB_DISABLE_ASSERTS" "#if defined(NDEBUG)\n#define DLIB_DISABLE_ASSERTS\n#endif" _contents ${_contents})
+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})
file(WRITE ${CURRENT_PACKAGES_DIR}/include/dlib/config.h ${_contents})
+file(READ ${CURRENT_PACKAGES_DIR}/share/dlib/dlib.cmake _contents)
+string(REPLACE
+ "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
+ "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)"
+ _contents "${_contents}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/dlib/dlib.cmake "${_contents}")
+
# Handle copyright
-file(COPY ${CURRENT_PACKAGES_DIR}/share/doc/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib)
+file(COPY ${SOURCE_PATH}/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/dlib/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/dlib/COPYRIGHT)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)