[qhull] Fix target cannot be found by cmake#9923
[qhull] Fix target cannot be found by cmake#9923NancyLi1013 wants to merge 2 commits intomicrosoft:masterfrom
Conversation
|
Ran into this issue today. Any news when it could be fixed? Thank you! |
|
@jafrado thanks for your feedback. |
|
@NancyLi1013 - thank you for your fix, looks good. However, now VTK with QT and OpenGL Is broken. Let me raise a separate PR for that one and send you the fix for VTK- target is PCL+QTOpenGL... |
|
Hi @NancyLi1013 - still no joy. I have this in my CMakeLists.txt find_package(Qt5 CONFIG REQUIRED Widgets) When I configure, I get the below (Windows 10): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:9 (set_property): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:10 (set_target_properties): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:19 (set_property): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:20 (set_target_properties): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:29 (set_property): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:30 (set_target_properties): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:39 (set_property): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:40 (set_target_properties): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:103 (set_property): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:104 (set_target_properties): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:113 (set_property): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:114 (set_target_properties): CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:150 (message): but this file does not exist. Possible reasons include:
but not all the files it references. Call Stack (most recent call first): |
|
Hi @jafrado Thanks. |
|
@NancyLi1013 Thanks for looking into it. It seems that when I configure PCL it find, but find the release version as both release and debug: |
|
@larshg - thank you so much for finding this first; I'm now trying to build all PCL packages using vcpkg as well. Running into the same issue. @NancyLi1013 - thanks, yes, I did update my repo and include all of your changes. If you have the time, could you test the sample qhull test application which is representative of what Lars and I are trying to get working. I did test this with the PCL pre-installed (1.9.1) and I also tested this both on Linux and Windows with my build. If we can get the QHull to work correctly with vcpkg, we could use vcpkg for everything! Here is my test app, I just added it: https://github.com/jafrado/qhulltest |
|
@NancyLi1013 - just tried from current master, same thing: The version I compiled works fine, but with my app and the test app I just sent you. Please try my test app after doing: It should compile and run as in the example I provided here: |
|
Hi @NancyLi1013 - could you take a look? Thanks. |
|
@jafrado you wrote you used latest master, but have you explicitly merged this PR as well? |
|
@larshg - I pulled master last Friday and tried to build the sample. No joy. However, if I build qhull by hand (manually via cmake-gui) and use this instead, it works fine. Did you get it working? Maybe there is some trick :) |
|
Hi @NancyLi1013, Some good news, I think I figured out what was wrong. On my system, I had two installs of vcpkg, one in c:\vcpkg and the other in c:\msft\vcpkg - now to answer your question and that from @larshg - I did patch my local vcpkg build in both, with your changes, however, I got the strange errors you see above. Now here is where it gets interesting. I deleted my c:\msft\vcpkg (and there is another issue with that in that you can't remove wildcards), but alas I wrote a .bat file and deleted everything. I then went back and rebuild EVERYTHING from c:\vcpkg and when completed, I did the usual "vcpkg integrate install" Guess what! It works now ... it seems like there are now a couple more issues - 1) you can't have two copies of vcpkg on your system (even if you only did vcpkg integrate install it somehow gets screwed up) 2) reg-ex doesn't work and 3) VTK with QT+OpenGL doesn't build (I will open a separate issue and provide a patch and test-app for that tomorrow if you can confirm the above). To recreate my whole dev environment from scratch, here is what I use to build: Then, to build PCL app and configure the qhulltest I listed above: It works and generates an exe in: Regarding the debug postfix: I use CMAKE_DEBUG_POSTFIX="d" for my build options. In most cases, applications correctly set the suffix for debug builds to include "d" at the end. When you set this CMake variable it ensures that everthing works. I guess you're saying I don't need that. Anyhow, if you could test out the above and build the app; please commit the changes and sorry for any confusion this caused. Thank you very much! |
|
@larshg - yes, I did patch it. I found out you can't have more than one vcpkg in your system and I could build today with a clean vcpkg install - I guess there can be only one, thank you! |
|
@NancyLi1013 yes, I noticed that the library names are the same, but paths as well. Shouldn't the debug library find the one on debug\lib folder instead? |
|
@jafrado thanks for your so detailed description and test about this issue. @larshg as you said, the debug library should find the one on debug\lib folder. If not like this, please post the error info or describe it more clearly. I also will check this later. Thanks. |
|
Well, there is no error per se. Only that it find the same folder path as I posted earlier. It adds the same path to both debug and release. |
|
@NancyLi1013 - thank you for looking into this; well, I have not had any success with two copies of vcpkg, that sent me out in the wrong direction so I will wait until this issue is fixed before I try that again. Today I tried testing what I built yesterday. A few things to mention:
That builds everything from scratch with your patch now and links correctly. However, NEITHER THE RELEASE OR DEBUG VERSION RUNS! In Debug build, it does not find lz4.dll, or libpng16.dll; however, both lz4d.dll and libpng16d.dll are in the Debug directory. Copying the non-debug versions it is looking for (lz4.dll and libpng16.dll) gives the runtime error: In Release mode, the app simply crashes with a back-trace that makes no sense. See image below: So as @larshg said earlier, the debug mode is broken; and unfortunately it seems I still cannot build pcl/qhull with vcpkg. Looking forward to your findings (and fix) for qhull with the sample app. |
|
Hi @jafrado Sorry for the late reply. I have tested the sample app you provided above. This only happened when building debug type. But I don't agree with that this is related with Could you please check it again? |
|
Hi @NancyLi1013, No problem; thank you for your reply. Well, I did check it again this morning, it doesn't make sense that the release build fails, and I realized I had my command line argument wrong in the debug arguments (it requires a PCD file as in the documentation) and also, I missed the VC Runtime DLL's, these somehow do not get copied with devenv: The files below were missing so I copied them into the release directory: And now when you run from command line: (Press 'r' to resize and recenter the point cloud in PCL Viewer, and then 'q' to quit) I think it might be worth testing to see if you add the below flags, it fixes the problem, or at least if we force this then we're guaranteeing that the correct flavor of debug library is built: Could you check this issue? I just added command line checking to the test app; and just did a commit. I also added an ifdef where you can link with just PCL and VTK and do RANSAC and no Pyramidal extraction/Qhull operations. Thank you very much! |
|
Hi @NancyLi1013 I think that PCL has a bug in how it finds qhull - after I added qhull like this its properly added with correct paths to both release and debug version. @jafrado You can try link to qhull using regards, Lars |
|
Hi @larshg Either in debug type or release type, it seems that both of them target at debug/lib. This is also a bug in the test app that provided by @jafrado . So could you help check it again to confirm if you used qhull successfully? |
|
@NancyLi1013, @larshg - I use and the line that @larshg provided uses: It doesn't matter if you use either line, the behavior is the same as my last post and status report. I just confirmed the same. |
|
@NancyLi1013 I think this patch works fine with my minimal example using both dynamic or static linking. However is there a reason to remove the "d" from debug libraries? Then you can't have both debug and release side by side if it is removed? As of PCL there needs to be some update for PCL to properly find the correct libraries. Supporting both the old way and the new way with CONFIG. Edit: |
|
@NancyLi1013 Can we maybe revive this one, as we have a pending PR at PCL to find qhull with a new method and now we get the above mentioned errors again. See PointCloudLibrary/pcl#3741 for reference. |
|
@larshg |
|
Is there some way to only limit to build only whats required/asked for - right now it build all the different versions, dynamic and static, qhull/qhull_p, qhull_r and tools? |
|
If you have the requirements, it might be better to bring up this to the upstream. |
|
Ah yes, it should probably be part of their CMake script, to enable/disable wanted libraries. Just wanted to reduce required time/cpu/power. |
|
Has there been any progress towards merging this? |
|
The current solution is not suitable. So it cannot be merged now. |
|
Should we close this PR then @NancyLi1013 ? |
|
Thanks for your kindly reminder. It might be better to open a new PR to fix this in the future. So I'm closing this PR now. |




When we using
find_package(Qhull CONFIG REQUIRED)to findQhull, it will always useQhullTargets-debug.cmakeand all the targets are not found.Since before exporting targets, all libs are added suffix
-dif build debug type.I remove the suffix
-dand also do the related changes.Related issue #9836
Note: No feature needs to test.