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
|
SET(BUILD_SHARED_LIBS ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE ON)
SET(CUDA_GENERATED_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/build)
#SET(CUDA_GENERATED_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build)
ADD_DEFINITIONS(
${DICT_HW_DEFINITIONS}
)
CUDA_INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}
)
INCLUDE_DIRECTORIES(
${DICT_HW_INCLUDE_DIRS}
)
SET(HEADERS
dict_hw.h
normxcorr_hw.cu.h
normxcorr_hw_kernel.cu.h
local_sum.cu.h
local_sum_kernel.cu.h
normxcorr_hw.h
normxcorr_hw_msg.h
dict_image.h
helpers.h
hw_sched.h
hw_thread.h
)
SET(hst_cuda_SRCS
dict_hw.cu
validate.cpp
dict_image.cpp
normxcorr_hw_msg.cpp
hw_sched.c
hw_thread.c
${HEADERS}
)
# c option is ignored by nvcc 2.2?
CUDA_ADD_LIBRARY(dict_hw ${hst_cuda_SRCS})
CUDA_ADD_CUFFT_TO_TARGET(dict_hw)
TARGET_LINK_LIBRARIES(dict_hw ${DICT_HW_LIBRARIES})
#EXCLUDE_FROM_ALL
if (WIN32)
ADD_EXECUTABLE(dict_hw_test
dict_hw_test.cpp
dict_hw.h
win/getopt_long.c
win/getopt.h
)
else ()
ADD_EXECUTABLE(dict_hw_test
dict_hw_test.cpp
dict_hw.h
)
endif ()
TARGET_LINK_LIBRARIES(dict_hw_test dict_hw)
# Add a special target to clean nvcc generated files.
#CUDA_BUILD_CLEAN_TARGET()
# clean extra files
#FILE(GLOB EXTRA_BUILD_FILES "dict_hw.linkinfo")
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES dict_hw.linkinfo)
|