From 7419fc975ce8447b7faf058e218ff6dd84db992d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Mar 2019 22:31:23 +0100 Subject: [PATCH] fixed flann for linux --- ports/flann/CONTROL | 2 +- ports/flann/Revert-fix-install-flann.patch | 41 ---------------------- ports/flann/fix-install-flann.patch | 41 ---------------------- ports/flann/flann-linux.patch | 22 ++++++++++++ ports/flann/portfile.cmake | 4 +-- 5 files changed, 25 insertions(+), 85 deletions(-) delete mode 100644 ports/flann/Revert-fix-install-flann.patch delete mode 100644 ports/flann/fix-install-flann.patch create mode 100644 ports/flann/flann-linux.patch diff --git a/ports/flann/CONTROL b/ports/flann/CONTROL index 4ec6072ab2..5fdc23b2ea 100644 --- a/ports/flann/CONTROL +++ b/ports/flann/CONTROL @@ -1,3 +1,3 @@ Source: flann -Version: 1.9.1-8 +Version: 1.9.1-9 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 deleted file mode 100644 index ace1b592ad..0000000000 --- a/ports/flann/Revert-fix-install-flann.patch +++ /dev/null @@ -1,41 +0,0 @@ -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/fix-install-flann.patch b/ports/flann/fix-install-flann.patch deleted file mode 100644 index f65094e8f8..0000000000 --- a/ports/flann/fix-install-flann.patch +++ /dev/null @@ -1,41 +0,0 @@ -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/flann-linux.patch b/ports/flann/flann-linux.patch new file mode 100644 index 0000000000..da95aa7a2c --- /dev/null +++ b/ports/flann/flann-linux.patch @@ -0,0 +1,22 @@ +diff --git a/src/cpp/CMakeLists b/src/cpp/CMakeLists.txt +index e6c8ae06..c15a8e90 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -35,7 +35,7 @@ if (BUILD_CUDA_LIB) + endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC) +- add_library(flann_cpp SHARED "") ++ add_library(flann_cpp SHARED ${CPP_SOURCES}) + set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive) + +@@ -90,7 +90,7 @@ if (BUILD_C_BINDINGS) + set_property(TARGET flann_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC) + + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC) +- add_library(flann SHARED "") ++ add_library(flann SHARED ${C_SOURCES}) + set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive) + else() diff --git a/ports/flann/portfile.cmake b/ports/flann/portfile.cmake index 2d6c40486e..f8c6b96d42 100644 --- a/ports/flann/portfile.cmake +++ b/ports/flann/portfile.cmake @@ -7,10 +7,9 @@ vcpkg_from_github( SHA512 0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7 HEAD_REF master PATCHES - fix-install-flann.patch - Revert-fix-install-flann.patch export-all-symbols-of-flann-cpp.patch no-write-src-dir.patch + flann-linux.patch ) vcpkg_configure_cmake( @@ -18,6 +17,7 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_MATLAB_BINDINGS=OFF