-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Use pkg-config to find Flann #2563
Use pkg-config to find Flann #2563
Conversation
Hey guys, this is a change I recently introduced in Debian, some details are covered here: P.S.: I just merged this from the simpler patch I did for Debian and the old version, will hopefully have time tomorrow to actually test it. Just wanted to hand it in so you are aware of it already. Feel free to fix my bugs ;). |
Thanks for the PR, I can try to test this under Windows with vcpkg in the next days 👍 |
Ubuntu 16.04 is fine, I can configure/build a downstream project that uses PCL/KdTrees. |
Confirmed the same on OS X.
|
I'm taking back my words, it's not fine, more details later. |
In my case In the case when |
This behavior definitely needs to be patched. The
find_package_handle_standard_args needs to move outside the conditional
branch.
|
@taketwo I added a workaround the the |
My comment was based on a practice which goes as following: when something doesn't fail and it should have, you first write code to ensure it fails and then you prevent the failure from happening. Furthermore this patch 12dc5a2 will appear slightly cryptic to someone who just sees this file.
|
It's one of those here: https://github.com/PointCloudLibrary/pcl/blob/master/cmake/pcl_targets.cmake#L113 |
There was no problem with |
I tested it on Ubuntu and it works. |
Hm, you are right, it indeed works after your latest commit. Nevertheless, I don't quite get the situation with the include directory. Here is the relevant CMake output:
As you can see, include directory is missing because |
In other cases it should be set in the pkg-config file and pkg_check_modules should pick it up ;): |
Is this still WIP, do you plan to change anything else? |
@taketwo it's fine with me (if it works for everyone). I would love to get rid of the |
12dc5a2
to
49b0523
Compare
It works under Windows 10 with
|
@jspricke Actually, do you see any reason for this test you referenced: Line 113 in a602b19
Why isn't the first part of the condition sufficient? Looking at the Git history, this was added as a single commit and does not provide any motivation. Maybe we just drop it? Or better after the release? |
@taketwo, my two cents here: there are part of CMake codes where some variables are set/evaluated |
I'm pro getting rid of that second condition after the release. One more
task for the CMake rework.
|
I looked into this a little more and I think
|
I updated the logic, please squash before merging. |
cmake/Modules/FindFLANN.cmake
Outdated
|
||
if(FLANN_FOUND) | ||
# pkg_check_modules sets FLANN_FOUND to 1, set it to TRUE here, as we do STREQUAL TRUE later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to remove this comment.
b1f84dc
to
75d64f4
Compare
Updated, thx. |
My output on OS X also seems to be fine. 👍
|
No description provided.