Skip to content

Commit bc4b12f

Browse files
longhuan2018Lily Wang
andauthored
[flann] Fix missing hdf5 dependency in flann-config.cmake (#22153)
* add find_package hdf5 in flann-config.cmake * update versions * Update flann.json Co-authored-by: Lily Wang <v-lilywang@microsoft.com>
1 parent 9e50a7c commit bc4b12f

6 files changed

Lines changed: 36 additions & 9 deletions

File tree

ports/flann/fix-build-error.patch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ index f4b94d2..33b2c26 100644
2828
option(BUILD_C_BINDINGS "Build C bindings" ON)
2929
option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON)
3030
option(BUILD_MATLAB_BINDINGS "Build Matlab bindings" ON)
31-
@@ -146,8 +148,8 @@ if (BUILD_CUDA_LIB)
31+
@@ -146,8 +148,9 @@ if (BUILD_CUDA_LIB)
3232
endif(CUDA_FOUND)
3333
endif(BUILD_CUDA_LIB)
3434

3535
-find_package(PkgConfig REQUIRED)
3636
-pkg_check_modules(LZ4 REQUIRED liblz4)
3737
+find_package(PkgConfig)
3838
+find_package(lz4 CONFIG REQUIRED)
39+
+set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} liblz4")
3940

4041
#set the C/C++ include path to the "include" directory
4142
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src/cpp)

ports/flann/fix-dependency-hdf5.patch

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
22
index 7ff331a..155cabe 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -75,11 +75,17 @@ if (NOT PYTHON_EXECUTABLE)
5+
@@ -75,11 +75,18 @@ if (NOT PYTHON_EXECUTABLE)
66
endif()
77
endif()
88

@@ -19,6 +19,7 @@ index 7ff331a..155cabe 100644
1919
+ elseif (TARGET hdf5::hdf5-static)
2020
+ link_libraries(hdf5::hdf5-static)
2121
+ endif()
22+
+ set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} hdf5")
2223
+endif()
2324
endif()
2425

@@ -51,3 +52,16 @@ index 8aef8e0..747414f 100644
5152
mark_as_advanced( HDF5_IS_PARALLEL )
5253
endmacro(find_hdf5)
5354

55+
56+
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
57+
index e8bb3f766..ad33998d9 100644
58+
--- a/cmake/Config.cmake.in
59+
+++ b/cmake/Config.cmake.in
60+
@@ -4,6 +4,7 @@
61+
include(CMakeFindDependencyMacro)
62+
# Find lz4. This will create 'lz4::lz4' target
63+
find_dependency(lz4)
64+
+find_package(hdf5 REQUIRED)
65+
66+
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
67+
check_required_components("flann")

ports/flann/portfile.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2020
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" FLANN_BUILD_STATIC)
2121
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" FLANN_BUILD_DYNAMIC)
2222

23-
vcpkg_configure_cmake(
23+
vcpkg_cmake_configure(
2424
SOURCE_PATH ${SOURCE_PATH}
25-
PREFER_NINJA
2625
DISABLE_PARALLEL_CONFIGURE
2726
OPTIONS ${FEATURE_OPTIONS}
2827
-DBUILD_DYNAMIC=${FLANN_BUILD_DYNAMIC}
@@ -37,8 +36,8 @@ vcpkg_configure_cmake(
3736
-DHDF5_NO_FIND_PACKAGE_CONFIG_FILE=ON
3837
)
3938

40-
vcpkg_install_cmake()
41-
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
39+
vcpkg_cmake_install()
40+
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
4241

4342
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
4443

ports/flann/vcpkg.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
{
22
"name": "flann",
33
"version-date": "2019-04-07",
4-
"port-version": 3,
4+
"port-version": 4,
55
"description": "Fast Library for Approximate Nearest Neighbors",
66
"homepage": "https://github.com/mariusmuja/flann",
77
"dependencies": [
8-
"lz4"
8+
"lz4",
9+
{
10+
"name": "vcpkg-cmake",
11+
"host": true
12+
},
13+
{
14+
"name": "vcpkg-cmake-config",
15+
"host": true
16+
}
917
],
1018
"features": {
1119
"cuda": {

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@
21742174
},
21752175
"flann": {
21762176
"baseline": "2019-04-07",
2177-
"port-version": 3
2177+
"port-version": 4
21782178
},
21792179
"flash-runtime-extensions": {
21802180
"baseline": "2.4",

versions/f-/flann.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "9ceb0dabb980c9cdfb5d9cf1a23e66ec90e75285",
5+
"version-date": "2019-04-07",
6+
"port-version": 4
7+
},
38
{
49
"git-tree": "7677f18c73aa0d5216af138b2fba9bcea56e3f1b",
510
"version-date": "2019-04-07",

0 commit comments

Comments
 (0)