How to compile the Dynamic Parallelism CUDA code by cmake ?

I am trying to learn how to use Dynamic Parallelism, and I find that my cmake file always cannot work.

My cmake code is like this:

cmake_minimum_required(VERSION 2.8)
project(Test)

IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE Release)
ENDIF()

MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3 -march=native ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall   -O3 -march=native")

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35)
set(CUDA_SEPARABLE_COMPILATION TRUE)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__")
   add_definitions(-DCOMPILEDWITHC11)
   message(STATUS "Using flag -std=c++11.")
elseif(COMPILER_SUPPORTS_CXX0X)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   add_definitions(-DCOMPILEDWITHC0X)
   message(STATUS "Using flag -std=c++0x.")
else()
   message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)

find_package(OpenCV 2.4.3 REQUIRED)
find_package(CUDA QUIET REQUIRED)

include_directories(
${PROJECT_SOURCE_DIR}
)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)

add_library(${PROJECT_NAME} SHARED
)

target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${CUDA_LIBS}
)

# Build examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/)

cuda_add_executable(
test
./process.cu
)
target_link_libraries(test ${PROJECT_NAME} -lcudadevrt)

And the wrong information is :

nvlink error   : Undefined reference to 'cudaGetParameterBufferV2' in '/media/ikenaga-lab/ボリューム/CUDA_test/DynamicParallelism/build/CMakeFiles/test.dir/././test_generated_process.cu.o'
nvlink error   : Undefined reference to 'cudaLaunchDeviceV2' in '/media/ikenaga-lab/ボリューム/CUDA_test/DynamicParallelism/build/CMakeFiles/test.dir/././test_generated_process.cu.o'
CMakeFiles/test.dir/build.make:948: recipe for target 'CMakeFiles/test.dir/test_intermediate_link.o' failed
make[2]: *** [CMakeFiles/test.dir/test_intermediate_link.o] Error 255
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test.dir/all' failed
make[1]: *** [CMakeFiles/test.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

And my cuda code is :

//#include "process.h"
#include <stdio.h>
#include <vector>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/sort.h>
#include <iostream>
#include <algorithm>

__global__ void HELLO (int n) {
	printf ("HELLO %d\n",n);
}
__global__ void CUDAfunction (const int size) {
	int idx = threadIdx.x + blockDim.x * blockIdx.x;
	HELLO <<<1,1>>> (idx);
}

void function1 (int size) {

	CUDAfunction<<<1,size>>> (size);

	//HELLO <<<1,1>>> (100);
	cudaDeviceSynchronize();
}

int main (int argv,char ** argc) {
	function1(9);
	return 0;
}

I would like to know why this cmake file cannot work? And I haven’t find some useful information. Dose anyone solves this problem? Please let me know.

Thanks in advance,

ACWrong