cuNSearch icon indicating copy to clipboard operation
cuNSearch copied to clipboard

Unable to use cuNSearch as submodule

Open davidAlgis opened this issue 8 months ago • 0 comments

I tried to use cuNSearch as a submodule of my main cmake project. However, when I add

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Vendors/cuNSearch)

in my cmake and then build it throws :

D:\Recherches\Vendors\neighborSearchUnityCUDA\Vendors\cuNSearch\Utils\Timing.h(17): fatal error C1083: Unable to open include file : 'cuNSearch_export.h': No such file or directory [D:\Recherches\Vendors\neighborSearchUnityCUDA\build\Vendors\cuNSearch\cuNSearch.vcxproj]
  cuNSearch.cu

It comes from the face that in your cmake you use :

target_include_directories(cuNSearch PUBLIC
	"include"
	"Utils"
	${CUDA_INCLUDE_DIRS}
	${CMAKE_BINARY_DIR}/cuNSearch
)

${CMAKE_BINARY_DIR} is the "full path to the top level of the current CMake build tree". Therefore, it won't correctly find the generated header. If you simply replace it by $CMAKE_CURRENT_BINARY_DIR :

target_include_directories(cuNSearch PUBLIC
	"include"
	"Utils"
	${CUDA_INCLUDE_DIRS}
	${CMAKE_CURRENT_BINARY_DIR}/cuNSearch
)

It works perfectly.

davidAlgis avatar Jun 10 '25 09:06 davidAlgis