-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (53 loc) · 1.34 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
cmake_minimum_required(VERSION 3.1)
project(cdata)
set(CMAKE_C_STANDARD 99)
set(CMAKE_BUILD_TYPE Debug)
# cdata source files
set(cdata_SOURCES
src/cdata.h
src/array.h
src/array.c
src/list.h
src/list.c
src/map.h
src/map.c
src/types.h
src/types.c
src/hash.h
src/hash.c
src/sort.h
src/sort.c
src/set.h
src/set.c
src/queue.h
src/queue.c
src/minheap.h
src/minheap.c
src/compare.h
src/compare.c
src/stack.h
src/stack.c
)
# add cdata library
add_library(cdata STATIC ${cdata_SOURCES})
# link math library on unix systems, MSVC has it included
if (UNIX)
target_link_libraries(cdata m)
endif (UNIX)
include_directories(src)
# add test executables
add_executable(arraytest src/test/array_test.c)
add_executable(listtest src/test/list_test.c)
add_executable(maptest src/test/map_test.c)
add_executable(settest src/test/set_test.c)
add_executable(queuetest src/test/queue_test.c)
add_executable(minheaptest src/test/minheap_test.c)
add_executable(stacktest src/test/stack_test.c)
# link tests with the cdata library
target_link_libraries(arraytest cdata)
target_link_libraries(listtest cdata)
target_link_libraries(maptest cdata)
target_link_libraries(settest cdata)
target_link_libraries(queuetest cdata)
target_link_libraries(minheaptest cdata)
target_link_libraries(stacktest cdata)