diff --git a/pybind_interface/cuda/CMakeLists.txt b/pybind_interface/cuda/CMakeLists.txt index 9bd369a0..e8c0e70c 100644 --- a/pybind_interface/cuda/CMakeLists.txt +++ b/pybind_interface/cuda/CMakeLists.txt @@ -18,13 +18,18 @@ INCLUDE(../GetPybind11.cmake) find_package(PythonLibs 3.7 REQUIRED) find_package(CUDA REQUIRED) -include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include) +include_directories(${PYTHON_INCLUDE_DIRS}) +if(pybind11_FOUND) + include_directories(${pybind11_INCLUDE_DIRS}) +else() # means pybind11 has been fetched in GetPybind11.cmake + include_directories(${pybind11_SOURCE_DIR}/include) +endif() cuda_add_library(qsim_cuda MODULE pybind_main_cuda.cpp) set_target_properties(qsim_cuda PROPERTIES - CUDA_ARCHITECTURES "all" - PREFIX "${PYTHON_MODULE_PREFIX}" - SUFFIX "${PYTHON_MODULE_EXTENSION}" + CUDA_ARCHITECTURES "all" + PREFIX "${PYTHON_MODULE_PREFIX}" + SUFFIX "${PYTHON_MODULE_EXTENSION}" ) set_source_files_properties(pybind_main_cuda.cpp PROPERTIES LANGUAGE CUDA)