aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormmazaherit <m.mazaheri.t@gmail.com>2017-06-11 17:26:22 -0400
committermmazaherit <m.mazaheri.t@gmail.com>2017-06-11 17:26:22 -0400
commitec625bc160748ea4b35c3c0c4fb7daa06b42de32 (patch)
treebfc208f7c756aad29900cde894e6ca1712c44dea
parentc4de5e29b11bd5815b479aa94172a227c3cac55a (diff)
downloadvcpkg-ec625bc160748ea4b35c3c0c4fb7daa06b42de32.tar.gz
vcpkg-ec625bc160748ea4b35c3c0c4fb7daa06b42de32.zip
check in flann
-rw-r--r--ports/flann/CONTROL3
-rw-r--r--ports/flann/fix-install-flann.patch41
-rw-r--r--ports/flann/portfile.cmake51
3 files changed, 95 insertions, 0 deletions
diff --git a/ports/flann/CONTROL b/ports/flann/CONTROL
new file mode 100644
index 000000000..a4a5c4ddc
--- /dev/null
+++ b/ports/flann/CONTROL
@@ -0,0 +1,3 @@
+Source: flann
+Version: 1.9.1
+Description: performing fast approximate nearest neighbor searches in high dimensional spaces
diff --git a/ports/flann/fix-install-flann.patch b/ports/flann/fix-install-flann.patch
new file mode 100644
index 000000000..f65094e8f
--- /dev/null
+++ b/ports/flann/fix-install-flann.patch
@@ -0,0 +1,41 @@
+diff --git "a/src/cpp/CMakeLists.txt" "b/src/cpp/CMakeLists.txt"
+index 49c53f0..cc58c90 100644
+--- "a/src/cpp/CMakeLists.txt"
++++ "b/src/cpp/CMakeLists.txt"
+@@ -87,7 +87,7 @@ if (BUILD_C_BINDINGS)
+ set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
+ target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive)
+ else()
+- add_library(flann SHARED ${C_SOURCES})
++ add_library(flann ${C_SOURCES})
+
+ if(MINGW AND OPENMP_FOUND)
+ target_link_libraries(flann gomp)
+@@ -111,12 +111,12 @@ endif()
+ endif(WIN32)
+
+
+-install (
+- TARGETS flann_cpp flann_cpp_s
+- RUNTIME DESTINATION bin
+- LIBRARY DESTINATION ${FLANN_LIB_INSTALL_DIR}
+- ARCHIVE DESTINATION ${FLANN_LIB_INSTALL_DIR}
+-)
++#install (
++# TARGETS flann_cpp flann_cpp_s
++# RUNTIME DESTINATION bin
++# LIBRARY DESTINATION ${FLANN_LIB_INSTALL_DIR}
++# ARCHIVE DESTINATION ${FLANN_LIB_INSTALL_DIR}
++#)
+
+ if (BUILD_CUDA_LIB)
+ install (
+@@ -129,7 +129,7 @@ endif()
+
+ if (BUILD_C_BINDINGS)
+ install (
+- TARGETS flann flann_s
++ TARGETS flann
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${FLANN_LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${FLANN_LIB_INSTALL_DIR}
diff --git a/ports/flann/portfile.cmake b/ports/flann/portfile.cmake
new file mode 100644
index 000000000..4a87365c0
--- /dev/null
+++ b/ports/flann/portfile.cmake
@@ -0,0 +1,51 @@
+# Common Ambient Variables:
+# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
+# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
+# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
+# PORT = current port name (zlib, etc)
+# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
+# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
+# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
+# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
+# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
+#
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO mariusmuja/flann
+ REF 1.9.1
+ SHA512 0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-flann.patch"
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ #PREFER_NINJA # Disable this option if project cannot be built with Ninja
+ OPTIONS
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_PYTHON_BINDINGS=OFF
+ -DBUILD_MATLAB_BINDINGS=OFF
+ -DBUILD_DOC=OFF
+
+ OPTIONS_RELEASE
+ -DFLANN_LIB_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/lib
+
+ OPTIONS_DEBUG
+ -DFLANN_LIB_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/lib
+
+)
+
+vcpkg_install_cmake()
+
+#clean
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/flann)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/flann/README.md ${CURRENT_PACKAGES_DIR}/share/flann/copyright) \ No newline at end of file