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

Avoid overlinking of OpenCV libs, clean up CMakeLists.txt a bit #14

Merged
merged 1 commit into from
May 8, 2024

Conversation

valgur
Copy link
Contributor

@valgur valgur commented May 7, 2024

Replaces

target_link_libraries(fbow ${OpenCV_LIBS})

with

target_link_libraries(fbow
    PUBLIC
        opencv_core
    PRIVATE
        opencv_features2d
        opencv_highgui
        "$<$<BOOL:${USE_CONTRIB}>:opencv_xfeatures2d>"
)

The linker otherwise pulls symbols from unrelated OpenCV libraries like opencv_dnn, which causes invalid shared library references to these to be added to the FBoW shared library.

I also bumped the CMake policy version to 3.12 to enable some modern CMake features and dropped C from the project languages since the project contains no C files.

Related to conan-io/conan-center-index#23889.

@ymd-stella
Copy link
Contributor

LGTM

@ymd-stella ymd-stella merged commit c6e3c29 into stella-cv:master May 8, 2024
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.

2 participants