Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup library build, make static library optional #6

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

StefanBruens
Copy link

Build the shared library on Linux the same way as on Windows, i.e. compile the sources individually for static and shared libs.

This removes the "FLANN_STATIC" compile definition from the shared library build (confusing, albeit without any effect on Linux), and avoids any linker trickery.

Also allow to disable build and installation of the static libraries completely, as these are often unwanted on Linux distributions.

Fixes flann-lib#498.
See flann-lib#369.

Build the shared library on Linux the same way as on Windows, i.e.
compile the sources individually for static and shared libs.

This removes the "FLANN_STATIC" compile definition from the shared
library build (confusing, albeit without any effect on Linux), and
avoids any linker trickery.

Also allow to disable build and installation of the static libraries
completely, as these are often unwanted on Linux distributions.

Fixes flann-lib#498.
See flann-lib#369.
@tkircher tkircher merged commit 00efff9 into tkircher:master Oct 26, 2022
@pedroexenberger
Copy link

pedroexenberger commented Apr 25, 2023

How does one activate the generation of the static library after this changes? I'm using cmake-gui and could not find a CMAKE_BUILD_STATIC_LIBS variable to set it on or off. I add a new CMAKE_BUILD_STATIC_LIBS boolean entry manually, and see that the static version is now in the generated folder. However when I do make install it does not get copied to the CMAKE_INSTALL_PREFIX. Just the .so gets copied there.
Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow disabling of static library build
3 participants