Closed Rayman closed 2 months ago
That actually does make a lot of sense!
I was under the (wrong) impression that openvdb
wasn't apt installable there...
I'm backporting and releasing jazzy again
@tfoote can you give me some pointers on which conditions this should be enabled.
Alternatively, what about searching for OpenVDBConfig.cmake in all paths under /usr and adding the parent folder?
In this case you should only be appending the path for the current architecture. Right now you're appending the path for both architectures, which probably will be ok, but could give some very weird errors if someone happens to be doing some multi-arch builds and it picks up the wrong architecture from their system.
I don't have the exact commands but GNUInstallDirs is commonly used for picking the installation targets like this: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#result-variables so I presume it should be able to help set the search path.
Otherwise you could simply check the arch in your CMake manually and then extend the CMAKE_MODULE_PATH conditionally.
Good idea.
Otherwise you could simply check the arch in your CMake manually and then extend the CMAKE_MODULE_PATH conditionally.
Do you have an example of best practices for this? I see ways of doing it with CMAKE_SYSTEM_PROCESSOR
which seems a little fragile since its OS dependent, 32/64 bit dependent, and even Linux flavor dependent. If that's SOP, I'll do that, but otherwise I'd love to know if there's a better solution that some ROS core packages currently leverage
In the cmake these variables are available that could be of use:
-- CMAKE_CXX_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
-- CMAKE_C_IMPLICIT_LINK_DIRECTORIES=/usr/lib/gcc/x86_64-linux-gnu/13;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
-- CMAKE_C_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
-- CMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
A solution could be to append /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/cmake/OpenVDB
?
The cmake module was located in another folder.