Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 0 additions & 278 deletions ports/flann/fix-build-error.patch

This file was deleted.

62 changes: 62 additions & 0 deletions ports/flann/fix-dep-lz4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fd73ba..ff357f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -155,8 +155,8 @@ if (BUILD_CUDA_LIB)
endif(CUDA_FOUND)
endif(BUILD_CUDA_LIB)

-find_package(PkgConfig REQUIRED)
-pkg_check_modules(LZ4 REQUIRED liblz4)
+find_package(lz4 CONFIG REQUIRED)
+set(LZ4_LINK_LIBRARIES lz4::lz4)
include_directories(${LZ4_INCLUDE_DIRS})

#set the C/C++ include path to the "include" directory
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
index 6b95a71..d78c74a 100644
--- a/cmake/Config.cmake.in
+++ b/cmake/Config.cmake.in
@@ -1,5 +1,10 @@
@PACKAGE_INIT@

+include(CMakeFindDependencyMacro)
+find_dependency(lz4 CONFIG)
+if(@WITH_HDF5@)
+ find_dependency(HDF5 CONFIG)
+endif()
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("flann")

diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index 7603abc..ce9fc40 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -18,8 +18,11 @@ if (CMAKE_BUILD_STATIC_LIBS)
else()
set_target_properties(flann_cpp_s PROPERTIES EXCLUDE_FROM_ALL true)
endif()
-
-add_library(flann_cpp SHARED ${CPP_SOURCES})
+if(CMAKE_BUILD_STATIC_LIBS)
+ add_library(flann_cpp STATIC ${CPP_SOURCES})
+else()
+ add_library(flann_cpp SHARED ${CPP_SOURCES})
+endif()
target_link_libraries(flann_cpp ${LZ4_LINK_LIBRARIES})
# export lz4 headers, so that MSVC to creates flann_cpp.lib
set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
@@ -91,8 +94,11 @@ if (BUILD_C_BINDINGS)
else()
set_target_properties(flann_s PROPERTIES EXCLUDE_FROM_ALL true)
endif()
-
- add_library(flann SHARED ${C_SOURCES})
+ if(CMAKE_BUILD_STATIC_LIBS)
+ add_library(flann STATIC ${C_SOURCES})
+ else()
+ add_library(flann SHARED ${C_SOURCES})
+ endif()
target_link_libraries(flann ${LZ4_LINK_LIBRARIES})
list(APPEND flann_install_targets flann)

Comment thread
jimwang118 marked this conversation as resolved.
13 changes: 0 additions & 13 deletions ports/flann/fix_undefined_pot_t.patch

This file was deleted.

Loading