flann-lib / flann

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

Allow disabling of static library build #498

Closed StefanBruens closed 1 year ago

StefanBruens commented 1 year ago

Currently, both the static and the shared library are always build, and installed.

Building itself is not a big issue, but as the static library is part of the EXPORT set: https://github.com/flann-lib/flann/blob/1d04523268c388dabf1c0865d69e1b638c8c7d9d/src/cpp/CMakeLists.txt#L120-L123

the installation is considered incomplete/broken when libflann_cpp_s.a does not exist. This is unfortunate, as for most use cases the shared library is totally sufficient.

Preferably, the static lib is omitted when the CMAKE_BUILD_STATIC_LIBS option is off.