Skip to content

Unable to use cuNSearch as submodule #17

@davidAlgis

Description

@davidAlgis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions