summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: f3369d9ec7362a35890fa2993b69efb9745af226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
project(ipecamera)

set(IPECAMERA_VERSION "0.0.1")
set(IPECAMERA_ABI_VERSION "0")

cmake_minimum_required(VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

add_definitions("-fPIC --std=gnu99 -Wall -O2 -gdwarf-2 -g3  -fno-omit-frame-pointer")

find_package(CUDA REQUIRED)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35;-rdc=true)
set(CUDA_SEPARABLE_COMPILATION ON)


find_package(PkgConfig REQUIRED)

pkg_check_modules(PCILIB pcitool>=0.2 REQUIRED)


include_directories(
    ${CMAKE_SOURCE_DIR}
    ${PCILIB_INCLUDE_DIRS}
    ${CUDA_INCLUDE_DIRS}
)

link_directories(
    ${PCILIB_LIBRARY_DIRS}
    ${CUDA_LIBRARY_DIRS}
)


set(CUDA_KERNELS kernels.cu)

#cuda_compile_ptx(cuda_ptx_files kernels.cu)
#add_custom_target(ptx ALL DEPENDS ${cuda_ptx_files} ${CUDA_KERNELS} SOURCES ${CUDA_KERNELS})


cuda_add_executable(gdr_test gdr_test.cu kernels.cu)
target_link_libraries(gdr_test pcilib rt cuda gdrapi /usr/local/cuda/lib64/libcudadevrt.a)