AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Mozilla Public License 2.0
2.62k stars 647 forks source link

Preserve Directory Structure for NanoVDB util/ and cuda/ Headers on Installation #1734

Closed eclipse0922 closed 4 months ago

eclipse0922 commented 9 months ago

This PR addresses an issue where the directory structure of the util/ and util/cuda/ headers in NanoVDB is not preserved when installed through CMake. The current installation process flattens the directory structure, leading to incorrect include paths when NanoVDB is used from the installed directories.

For example, https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/util/GridHandle.h uses cuda utils like this, but there is no 'cuda' directory in installed path.

#if defined(__CUDACC__)
#include <nanovdb/util/cuda/CudaGridHandle.cuh>
#endif// defined(__CUDACC__)

#endif // NANOVDB_GRID_HANDLE_H_HAS_BEEN_INCLUDED

Changes Modified the CMakeLists.txt to use install(DIRECTORY ...) instead of install(FILES ...) for the util/ directory. This change ensures that the directory hierarchy (specifically the util/cuda/ subdirectory) is maintained during installation.

linux-foundation-easycla[bot] commented 9 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

eclipse0922 commented 9 months ago

Another approach: Split NANOVDB_INCLUDE_UTILFILES into two parts, cuda and non-cuda, then install them separately.