-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (31 loc) · 1.12 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.0)
project(SegStats)
OPTION(SYNC "Enables stream syncronization in code" OFF) # diabled by default
IF(SYNC)
ADD_DEFINITIONS(-DSYNC_STREAM)
ENDIF(SYNC)
find_package(OpenCV REQUIRED)
find_package(CUDA REQUIRED)
#find_package(CUDNN REQUIRED)
set(CMAKE_CXX_FLAGS "--std=c++11 -Wall -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -D GOOGLE_CUDA=1")
#set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --default-stream per-thread" )
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" )
set(CMAKE_BUILD_TYPE Debug)
#pass flags to c++ compiler
set(CUDA_PROPAGATE_HOST_FLAGS ON)
set(MAIN_SRC
"src/main.cu"
"lib/zupply/zupply.cpp"
)
include_directories("include")
include_directories(SYSTEM "lib/zupply")
include_directories(SYSTEM "lib/cnmem/include")
include_directories(${OpenCV_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS})
add_subdirectory("lib/cnmem")
cuda_add_executable(SegStats ${MAIN_SRC})
target_link_libraries(SegStats ${OpenCV_LIBS} ${CUDA_LIBRARIES} cudnn stdc++fs cnmem)
set(TEST_SRC
"test/runTests.cu"
)
cuda_add_executable(runTests ${TEST_SRC})
target_link_libraries(runTests ${OpenCV_LIBS} ${CUDA_LIBRARIES} cudnn stdc++fs cnmem)