-
Notifications
You must be signed in to change notification settings - Fork 286
/
CMakeLists.txt
78 lines (65 loc) · 1.82 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 2.6)
project(cudaSift)
set(cudaSift_VERSION_MAJOR 2)
set(cudaSift_VERSION_MINOR 0)
set(cudaSift_VERSION_PATCH 0)
set(CPACK_PACKAGE_VERSION_MAJOR "${cudaSift_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${cudaSift_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${cudaSift_VERSION_PATCH}")
set(CPACK_GENERATOR "ZIP")
include(CPack)
find_package(OpenCV REQUIRED)
find_package(CUDA)
if (NOT CUDA_FOUND)
message(STATUS "CUDA not found. Project will not be built.")
endif(NOT CUDA_FOUND)
if (WIN32)
set(EXTRA_CXX_FLAGS "/DVERBOSE /D_CRT_SECURE_NO_WARNINGS ")
list(APPEND CUDA_NVCC_FLAGS "-arch=sm_35;--compiler-options;-O2;-DVERBOSE")
endif()
if (UNIX)
if (APPLE)
set(EXTRA_CXX_FLAGS "-DVERBOSE -msse2")
list(APPEND CUDA_NVCC_FLAGS "-arch=sm_35;--compiler-options;-O2;-DVERBOSE")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -msse2 ")
list(APPEND CUDA_NVCC_FLAGS "-lineinfo;-ccbin;/usr/bin/gcc-6;--compiler-options;-O2;-D_FORCE_INLINES;-DVERBOSE_NOT")
endif()
endif()
set(cuda_sources
cudaImage.cu
cudaImage.h
cudaSiftH.cu
cudaSiftH.h
matching.cu
cudaSiftD.h
cudaSift.h
cudautils.h
)
set(sources
geomFuncs.cpp
mainSift.cpp
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
)
#SET(CUDA_SEPARABLE_COMPILATION ON)
cuda_add_executable(cudasift ${cuda_sources} ${sources} OPTIONS -arch=sm_35)
#cuda_add_executable(l2net l2netD.cu OPTIONS -arch=sm_35)
set_target_properties(cudasift PROPERTIES
COMPILE_FLAGS "${EXTRA_CXX_FLAGS}"
)
target_link_libraries(cudasift ${CUDA_cudadevrt_LIBRARY} ${OpenCV_LIBS})
# /usr/local/cuda/lib64/libcudadevrt.a ${OpenCV_LIBS}
#)
install(FILES
${cuda_sources}
${sources}
cudaSiftD.cu
CMakeLists.txt
Copyright.txt
DESTINATION .
)
install(FILES data/left.pgm data/righ.pgm
DESTINATION data
)