aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-02-21 13:32:31 -0800
committerGitHub <noreply@github.com>2017-02-21 13:32:31 -0800
commitb921dce5fc17bd4c1c206b79eb0a7b8758dcf5bf (patch)
tree06e1ff2648abadf235a4947e7307875bfbad5995
parent7459156943653c73a0d4087ed4c4ad9703cc6538 (diff)
parent2ab8eb3ef05eaf840389e0ea1a78489490e37983 (diff)
downloadvcpkg-b921dce5fc17bd4c1c206b79eb0a7b8758dcf5bf.tar.gz
vcpkg-b921dce5fc17bd4c1c206b79eb0a7b8758dcf5bf.zip
Merge pull request #690 from Shadowrom2020/master
dlib port
-rw-r--r--ports/dlib/CONTROL3
-rw-r--r--ports/dlib/portfile.cmake45
2 files changed, 48 insertions, 0 deletions
diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL
new file mode 100644
index 000000000..91ce3eb57
--- /dev/null
+++ b/ports/dlib/CONTROL
@@ -0,0 +1,3 @@
+Source: dlib
+Version: 19.2
+Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++
diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake
new file mode 100644
index 000000000..3ef3f840e
--- /dev/null
+++ b/ports/dlib/portfile.cmake
@@ -0,0 +1,45 @@
+# 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.2)
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://dlib.net/files/dlib-19.2.tar.bz2"
+ FILENAME "dlib-19.2.tar.bz2"
+ SHA512 dcef5c8be52fe2650c1eccac6c7ac4050075dc07ee504a8bf3df6c9a597da5fdc09506e631abfa979d71c74940ce39ec5267be4c3a676a01ac66fcb14cbfe854
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA # Disable this option if project cannot be built with Ninja
+ # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
+ # OPTIONS_RELEASE -DOPTIMIZE=1
+ # OPTIONS_DEBUG -DDEBUGGABLE=1
+)
+
+vcpkg_install_cmake()
+
+# 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}/include/dlib/test)
+
+# Remove other files not required in package
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/all)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm)
+
+# Handle copyright
+#file(COPY ${SOURCE_PATH}/docs/license.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib)
+file(COPY ${CURRENT_PACKAGES_DIR}/share/doc/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) \ No newline at end of file