Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion ports/flann/fix-build-error.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ index f4b94d2..33b2c26 100644
option(BUILD_C_BINDINGS "Build C bindings" ON)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON)
option(BUILD_MATLAB_BINDINGS "Build Matlab bindings" ON)
@@ -146,8 +148,8 @@ if (BUILD_CUDA_LIB)
@@ -146,8 +148,9 @@ if (BUILD_CUDA_LIB)
endif(CUDA_FOUND)
endif(BUILD_CUDA_LIB)

-find_package(PkgConfig REQUIRED)
-pkg_check_modules(LZ4 REQUIRED liblz4)
+find_package(PkgConfig)
+find_package(lz4 CONFIG REQUIRED)
+set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} liblz4")

#set the C/C++ include path to the "include" directory
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src/cpp)
Expand Down
16 changes: 15 additions & 1 deletion ports/flann/fix-dependency-hdf5.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ff331a..155cabe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,11 +75,17 @@ if (NOT PYTHON_EXECUTABLE)
@@ -75,11 +75,18 @@ if (NOT PYTHON_EXECUTABLE)
endif()
endif()

Expand All @@ -19,6 +19,7 @@ index 7ff331a..155cabe 100644
+ elseif (TARGET hdf5::hdf5-static)
+ link_libraries(hdf5::hdf5-static)
+ endif()
+ set(PKG_EXTERNAL_DEPS "${PKG_EXTERNAL_DEPS} hdf5")
+endif()
endif()

Expand Down Expand Up @@ -51,3 +52,16 @@ index 8aef8e0..747414f 100644
mark_as_advanced( HDF5_IS_PARALLEL )
endmacro(find_hdf5)


diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
index e8bb3f766..ad33998d9 100644
--- a/cmake/Config.cmake.in
+++ b/cmake/Config.cmake.in
@@ -4,6 +4,7 @@
include(CMakeFindDependencyMacro)
# Find lz4. This will create 'lz4::lz4' target
find_dependency(lz4)
+find_package(hdf5 REQUIRED)

@cenit cenit Jan 22, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strega-nil-ms
this is an error and should have been a find_dependency.
If flann is not required, only optional for the downstream project, this check will make it fail unconditionally (in case hdf5 is not present). With the find dependency, flann would just have been completely skipped because invalid

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review, I will confirm and fix it soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submitted a new PR #22731


include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("flann")
7 changes: 3 additions & 4 deletions ports/flann/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" FLANN_BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" FLANN_BUILD_DYNAMIC)

vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS ${FEATURE_OPTIONS}
-DBUILD_DYNAMIC=${FLANN_BUILD_DYNAMIC}
Expand All @@ -37,8 +36,8 @@ vcpkg_configure_cmake(
-DHDF5_NO_FIND_PACKAGE_CONFIG_FILE=ON
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})

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

Expand Down
12 changes: 10 additions & 2 deletions ports/flann/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"name": "flann",
"version-date": "2019-04-07",
"port-version": 3,
"port-version": 4,
"description": "Fast Library for Approximate Nearest Neighbors",
"homepage": "https://github.com/mariusmuja/flann",
"dependencies": [
"lz4"
"lz4",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"cuda": {
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@
},
"flann": {
"baseline": "2019-04-07",
"port-version": 3
"port-version": 4
},
"flashlight-cpu": {
"baseline": "0.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/flann.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9ceb0dabb980c9cdfb5d9cf1a23e66ec90e75285",
"version-date": "2019-04-07",
"port-version": 4
},
{
"git-tree": "7677f18c73aa0d5216af138b2fba9bcea56e3f1b",
"version-date": "2019-04-07",
Expand Down