-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
148 lines (114 loc) · 4.03 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
cmake_minimum_required(VERSION 3.0.0)
set(ENABLE_CUDA_FOR_T_PIC TRUE)
set(ENABLE_CUDA_FOR_T_MATRIX TRUE)
set(BUILD_MAIN_TEST FALSE)
set(BUILD_SVG_TEST FALSE)
set(BUILD_HTTP_TEST FALSE)
set(BUILD_HTTP_CLIENT_TEST FALSE)
set(BUILD_HTTP_SERVER_TEST FALSE)
set(BUILD_SOCK_TEST FALSE)
set(BUILD_SIMULATION_TEST FALSE)
set(BUILD_LOAD_DLL_TEST FALSE)
set(BUILD_PIC_TEST FALSE)
set(BUILD_MATRIX_TEST FALSE)
set(BUILD_CONTINOOUS_HEAP_TEST FALSE)
set(BUILD_CONTINOOUS_RBTREE_TEST FALSE)
set(BUILD_JSON_TEST FALSE)
set(BUILD_META_TEST TRUE)
if(MINGW)
project(t_extended VERSION 0.1.0 LANGUAGES C CXX)
else()
project(t_extended VERSION 0.1.0 LANGUAGES C CXX CUDA)
FIND_PACKAGE(CUDA REQUIRED)
INCLUDE_DIRECTORIES( ${CUDA_INCLUDE_DIRS})
link_directories(${CUDA_INCLUDE_DIRS}/../lib/x64)
endif()
set(CMAKE_CXX_STANDARD 17)
include_directories(${PROJECT_SOURCE_DIR}/tcx_standalone)
include_directories(${PROJECT_SOURCE_DIR}/tcx_continuous_container)
include_directories(${PROJECT_SOURCE_DIR}/tcx_net)
# ----------------- targets -----------------
# main debug/development test
if(BUILD_MAIN_TEST)
add_executable(t_main_test main.cpp)
endif()
# svg test
if(BUILD_SVG_TEST)
add_executable(t_svg_test examples/svg_test.cpp)
endif()
# http test
if(BUILD_HTTP_TEST)
add_executable(t_http_test examples/http_test.cpp)
target_link_libraries(t_http_test ws2_32)
endif()
# very easy http get test
if(BUILD_HTTP_CLIENT_TEST)
add_executable(http_client_test examples/http_client_test.cpp)
target_link_libraries(http_client_test ws2_32)
endif()
# http server test
if(BUILD_HTTP_SERVER_TEST)
add_executable(http_server_test examples/http_server_test.cpp)
target_link_libraries(http_server_test ws2_32)
endif()
# socket wrapper functions test
if(BUILD_SOCK_TEST)
add_executable(t_sock_test examples/socket_test.cpp)
target_link_libraries(t_sock_test ws2_32)
endif()
# simulation module test
if(BUILD_SIMULATION_TEST)
add_executable(sim_test examples/sim_test.cpp)
endif()
# load cuda dll test
if(BUILD_LOAD_DLL_TEST)
add_executable(load_dll_test examples/load_dll_test.cpp)
endif()
if(BUILD_PIC_TEST)
if(MSVC)
if(ENABLE_CUDA_FOR_T_PIC)
aux_source_directory(${PROJECT_SOURCE_DIR}/tcx_pic/cu_src SRC)
aux_source_directory(${PROJECT_SOURCE_DIR}/tcx_pic/common SRC)
add_executable(cuda_pic_test examples/cuda_pic_test.cpp ${SRC})
target_include_directories(cuda_pic_test PUBLIC ${PROJECT_SOURCE_DIR}/tcx_pic/include)
set_target_properties(cuda_pic_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_property(TARGET cuda_pic_test PROPERTY CUDA_ARCHITECTURES OFF)
else()
aux_source_directory(${PROJECT_SOURCE_DIR}/tcx_pic/cpp_src SRC)
aux_source_directory(${PROJECT_SOURCE_DIR}/tcx_pic/common SRC)
add_executable(cuda_pic_test examples/cuda_pic_test.cpp ${SRC})
target_include_directories(cuda_pic_test PUBLIC ${PROJECT_SOURCE_DIR}/tcx_pic/include)
endif()
elseif(MINGW)
aux_source_directory(${PROJECT_SOURCE_DIR}/tcx_pic/cpp_src SRC)
aux_source_directory(${PROJECT_SOURCE_DIR}/tcx_pic/common SRC)
add_executable(cuda_pic_test examples/cuda_pic_test.cpp ${SRC})
target_include_directories(cuda_pic_test PUBLIC ${PROJECT_SOURCE_DIR}/tcx_pic/include)
endif()
endif()
if(BUILD_MATRIX_TEST)
if(MSVC)
if(ENABLE_CUDA_FOR_T_MATRIX)
add_executable(cuda_matrix_test examples/cuda_matrix_test.cpp ${PROJECT_SOURCE_DIR}/tcx_pic/cu_src/t_matrix.cu)
target_include_directories(cuda_matrix_test PUBLIC ${PROJECT_SOURCE_DIR}/tcx_pic/include)
set_target_properties(cuda_matrix_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_property(TARGET cuda_matrix_test PROPERTY CUDA_ARCHITECTURES OFF)
endif()
endif()
endif()
if(BUILD_CONTINOOUS_HEAP_TEST)
add_executable(continuous_heap_test
examples/continuous_heap_test.c
${PROJECT_SOURCE_DIR}/tcx_continuous_container/t_continuous_heap.c)
endif()
# if(BUILD_CONTINOOUS_RBTREE_TEST)
# add_executable(continuous_rbtree_test
# examples/continuous_rbtree_test.c
# ${PROJECT_SOURCE_DIR}/tcx_continuous_container/t_continuous_rbtree.c)
# endif()
if(BUILD_JSON_TEST)
add_executable(json_test examples/json_test.cpp)
endif()
if(BUILD_META_TEST)
add_executable(meta_test examples/meta_test.cpp)
endif()