Skip to content

Commit 57ba5cb

Browse files
committed
Fix lz4 missing from flann.pc Requires: line.
lz4 is an unconditional dependency of flann (see #399), but until now was not correctly generated into the `Requires: lz4` line of `flann.pc`, because the `PKG_EXTERNAL_DEPS` variable used in `flann.pc.in` was not defined at all. This fixes build error `lz4.h: No such file or directory` for properly sandboxed builds, in which undeclared dependencies are not made available.
1 parent 1d04523 commit 57ba5cb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ option(USE_MPI "Use MPI" OFF)
6161

6262
set(NVCC_COMPILER_BINDIR "" CACHE PATH "Directory where nvcc should look for C++ compiler. This is passed to nvcc through the --compiler-bindir option.")
6363

64+
# pkg-config dependencies to be generated into the .pc file
65+
set(PKGCONFIG_EXTERNAL_DEPS_LIST "")
66+
6467
if (NOT BUILD_C_BINDINGS)
6568
set(BUILD_PYTHON_BINDINGS OFF)
6669
set(BUILD_MATLAB_BINDINGS OFF)
@@ -148,6 +151,7 @@ endif(BUILD_CUDA_LIB)
148151

149152
find_package(PkgConfig REQUIRED)
150153
pkg_check_modules(LZ4 REQUIRED liblz4)
154+
list(APPEND PKGCONFIG_EXTERNAL_DEPS_LIST "lz4")
151155

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

cmake/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
set(PKG_DESC "Fast Library for Approximate Nearest Neighbors")
2+
3+
# Compute `PKG_EXTERNAL_DEPS` string from `PKGCONFIG_EXTERNAL_DEPS_LIST`.
4+
# Once the project has `cmake_minimum_required(VERSION 2.6)`, this
5+
# can be replaced by `list(JOIN ...)`.
6+
set(PKG_EXTERNAL_DEPS "")
7+
foreach(_dep ${PKGCONFIG_EXTERNAL_DEPS_LIST})
8+
string(APPEND PKG_EXTERNAL_DEPS " ${_dep}")
9+
endforeach()
10+
211
set(pkg_conf_file ${CMAKE_CURRENT_BINARY_DIR}/flann.pc)
312
configure_file(flann.pc.in ${pkg_conf_file} @ONLY)
413
install(FILES ${pkg_conf_file}

0 commit comments

Comments
 (0)