forked from udacity/cs344
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (42 loc) · 1.77 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
42
43
44
45
46
47
48
49
50
############################################################################
# <summary> CMakeLists.txt for OpenCV and CUDA. </summary>
# <date> 2012-02-07 </date>
# <author> Quan Tran Minh. edit by Johannes Kast, Michael Sarahan </author>
############################################################################
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(cs344)
find_package(OpenCV REQUIRED)
find_package(CUDA REQUIRED)
link_libraries(${OpenCV_LIBS} )
set (EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/")
if(CUDA_FOUND)
# compared to class settings, we let NVidia's FindCUDA CMake detect
# whether to build x64. We tell it to support most devices, though,
# to make sure more people can easily run class code without knowing
# about this compiler argument
set(CUDA_NVCC_FLAGS "
-ccbin /usr/bin/clang;
-gencode;arch=compute_30,code=sm_30;
-gencode;arch=compute_35,code=sm_35;
-gencode;arch=compute_35,code=compute_35;
-gencode;arch=compute_20,code=sm_20;
-gencode;arch=compute_11,code=sm_11;
-gencode;arch=compute_12,code=sm_12;
-gencode;arch=compute_13,code=sm_13;")
# add -Wextra compiler flag for gcc compilations
if (UNIX)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler -Wextra")
set(CMAKE_CXX_FLAGS "-stdlib=libstdc++")
endif (UNIX)
# add debugging to CUDA NVCC flags. For NVidia's NSight tools.
set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG} "-G")
add_subdirectory (HW1)
add_subdirectory (HW2)
add_subdirectory (HW3)
add_subdirectory (HW4)
add_subdirectory (HW5)
add_subdirectory (HW6)
else(CUDA_FOUND)
message("CUDA is not installed on this system.")
endif()