flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.21k stars 646 forks source link

Use string(JOIN) to avoid semicolons in pc file. #480

Open mikepurvis opened 3 years ago

mikepurvis commented 3 years ago

An issue was encountered (https://github.com/NixOS/nixpkgs/pull/129491) when updating the Nix package for FLANN, where a list-separating semicolon was making it into the pkgconfig file:

Name: flann
Description: Fast Library for Approximate Nearest Neighbors
Version: 1.9.1
Requires:
Libs: -L${libdir} -L/nix/store/3nf85zf44vyvwr32hx53v7swljxysyjm-lz4-1.9.3/lib;-llz4 -lflann -lflann_cpp
Cflags: -I${includedir}

This semicolon breaks the flag parsing logic in the linker and needs to be filtered out, either with a string replacement or by doing a string(JOIN) as in this PR, for which CMake 3.12 is required. Note that 3.12 was released in July 2018, so this change would break a user building master from source on Ubuntu 18.04, but is fine on 20.04 or anything newer than that.

This should go in after https://github.com/flann-lib/flann/issues/369; that change is being patched into Debian, Nix, Homebrew, buildroot, and probably elsewhere.

FYI @jspricke