Make the dependency of "outofcore" on "visualization" optional.#6254
Conversation
|
Thanks for the pull request. I understand your wish to make the dependency of outofcore on visualization optional. Some thoughts I have on this pull request:
I will look further into this and try to come up with a suggestion. |
mvieth
left a comment
There was a problem hiding this comment.
Sorry for the delay. I thought about it and while there is likely a way to move some code around and make the queryFrustum function work even without the visualization module, I think that the outofcore module and the queryFrustum function in particular are not used enough to justify putting a lot of work in. So I am happy with your approach, just have some minor remarks.
pcl_config.h.in
Outdated
|
|
||
| #cmakedefine HAVE_QVTK 1 | ||
|
|
||
| #cmakedefine BUILD_visualization |
There was a problem hiding this comment.
I feel like BUILD_visualization might not send a clear message to a person using PCL. Maybe it would be better to introduce a separate preprocessor symbol, like PCL_VISUALIZATION_AVAILABLE or similar, and use that in the *.h and *.hpp files (this should then be set to true in visualization/CMakeLists.txt if the visualization module is indeed built).
There was a problem hiding this comment.
Yes, a better name would be nice. I tried your suggestion, but couldn't make it work. The problem is that pcl_config.h.in is generated before the PCL module CMake files are processed (generating it afterwards does not work). So I'm setting in in the main CMakeLists.txt now.
In outofcore/CMakeLists.txt, I still use BUILD_visualization. We could switch that to PCL_VISUALIZATION_AVAILABLE if you want.
Without "visualization", one of the overloads of queryFrustum is unavailable.
e63be17 to
a8f0e4c
Compare
outofcore uses Boost::filesystem and needs to link to it. If visualization is not built, building outofcore fails due to missing symbols, likely as a consequence of PointCloudLibrary#6254 (before, outofcore was not built if visualization was not built either)
* Link Boost::filesystem to pcl_outofcore outofcore uses Boost::filesystem and needs to link to it. If visualization is not built, building outofcore fails due to missing symbols, likely as a consequence of #6254 (before, outofcore was not built if visualization was not built either) * Use Boost::system target
I would like to propose the following patch, to make the
outofcorecomponent not depend on thevisualizationcomponent, because that brings in a pretty large dependency chain via VTK.I noticed that
outofcoreneeds only a single method fromvisualization, which is this overload ofqueryFrustum.I'm not sure if my approach to make this dependency optional in CMake is correct. But it seems to work fine on my end.
What it does is:
visualizationis enabled, andoutofcoreis enabled, the latter will be built as normalvisualizationis disabled, butoutofcoreis enabled, the latter will be built without the method.