aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-16 23:00:52 -0700
committerGitHub <noreply@github.com>2017-06-16 23:00:52 -0700
commitd25bea6987406156cab83d2f986b851782bf6c2c (patch)
treeb48344fb7e08c9e9d75c4e66ef6bc9ba0ab4fe6a
parent73a0161bb13977309209a89ad6328a97b11d28ab (diff)
parent525d30d256f67a86ed6497b80c659106fcb84521 (diff)
downloadvcpkg-d25bea6987406156cab83d2f986b851782bf6c2c.tar.gz
vcpkg-d25bea6987406156cab83d2f986b851782bf6c2c.zip
Merge pull request #1297 from seanlis/master
Add building of flann_cpp for FLANN port.
-rw-r--r--ports/flann/CONTROL4
-rw-r--r--ports/flann/Revert-fix-install-flann.patch41
-rw-r--r--ports/flann/export-all-symbols-of-flann-cpp.patch12
-rw-r--r--ports/flann/portfile.cmake64
4 files changed, 86 insertions, 35 deletions
diff --git a/ports/flann/CONTROL b/ports/flann/CONTROL
index a4a5c4ddc..41a18ae62 100644
--- a/ports/flann/CONTROL
+++ b/ports/flann/CONTROL
@@ -1,3 +1,3 @@
Source: flann
-Version: 1.9.1
-Description: performing fast approximate nearest neighbor searches in high dimensional spaces
+Version: 1.9.1-2
+Description: Fast Library for Approximate Nearest Neighbors
diff --git a/ports/flann/Revert-fix-install-flann.patch b/ports/flann/Revert-fix-install-flann.patch
new file mode 100644
index 000000000..ace1b592a
--- /dev/null
+++ b/ports/flann/Revert-fix-install-flann.patch
@@ -0,0 +1,41 @@
+diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
+index cc58c90..49c53f0 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 ${C_SOURCES})
++ add_library(flann SHARED ${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
++ TARGETS flann flann_s
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${FLANN_LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${FLANN_LIB_INSTALL_DIR}
diff --git a/ports/flann/export-all-symbols-of-flann-cpp.patch b/ports/flann/export-all-symbols-of-flann-cpp.patch
new file mode 100644
index 000000000..86f172ff3
--- /dev/null
+++ b/ports/flann/export-all-symbols-of-flann-cpp.patch
@@ -0,0 +1,12 @@
+diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
+index 49c53f0..b9cf76b 100644
+--- a/src/cpp/CMakeLists.txt
++++ b/src/cpp/CMakeLists.txt
+@@ -52,6 +52,7 @@ set_target_properties(flann_cpp PROPERTIES
+ VERSION ${FLANN_VERSION}
+ SOVERSION ${FLANN_SOVERSION}
+ DEFINE_SYMBOL FLANN_EXPORTS
++ WINDOWS_EXPORT_ALL_SYMBOLS ON
+ )
+
+ if (BUILD_CUDA_LIB)
diff --git a/ports/flann/portfile.cmake b/ports/flann/portfile.cmake
index 4a87365c0..96f2af0e3 100644
--- a/ports/flann/portfile.cmake
+++ b/ports/flann/portfile.cmake
@@ -1,51 +1,49 @@
-# 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
+ OUT_SOURCE_PATH SOURCE_PATH
REPO mariusmuja/flann
- REF 1.9.1
- SHA512 0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7
+ REF 1.9.1
+ SHA512 0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7
+ HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
- PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-flann.patch"
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/fix-install-flann.patch
+ ${CMAKE_CURRENT_LIST_DIR}/Revert-fix-install-flann.patch
+ ${CMAKE_CURRENT_LIST_DIR}/export-all-symbols-of-flann-cpp.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
-
+ PREFER_NINJA
+ OPTIONS
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_DOC=OFF
+ -DBUILD_PYTHON_BINDINGS=OFF
+ -DBUILD_MATLAB_BINDINGS=OFF
)
vcpkg_install_cmake()
-#clean
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/flann.lib ${CURRENT_PACKAGES_DIR}/debug/lib/flann.lib)
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/flann_cpp.lib ${CURRENT_PACKAGES_DIR}/debug/lib/flann_cpp.lib)
+ # Rename static libs to appear dynamic
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/flann_s.lib ${CURRENT_PACKAGES_DIR}/lib/flann.lib)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/flann_s.lib ${CURRENT_PACKAGES_DIR}/debug/lib/flann.lib)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/flann_cpp_s.lib ${CURRENT_PACKAGES_DIR}/lib/flann_cpp.lib)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/flann_cpp_s.lib ${CURRENT_PACKAGES_DIR}/debug/lib/flann_cpp.lib)
+elseif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/flann_s.lib ${CURRENT_PACKAGES_DIR}/debug/lib/flann_s.lib)
+ file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/flann_cpp_s.lib ${CURRENT_PACKAGES_DIR}/debug/lib/flann_cpp_s.lib)
+endif()
+
# 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
+file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/flann)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/flann/COPYING ${CURRENT_PACKAGES_DIR}/share/flann/copyright)