forked from shiva/libdict
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
69 lines (59 loc) · 1.58 KB
/
Copy pathCMakeLists.txt
File metadata and controls
69 lines (59 loc) · 1.58 KB
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
cmake_minimum_required(VERSION 2.8)
set(_ECLIPSE_VERSION 4.5)
project(libdict)
enable_language(C)
add_definitions(-std=c11)
set(LIBDICT_SOURCES
src/dict.c
src/hashtable.c
src/hashtable2.c
src/hashtable_common.c
src/hb_tree.c
src/pr_tree.c
src/rb_tree.c
src/skiplist.c
src/sp_tree.c
src/tr_tree.c
src/tree_common.c
src/wb_tree.c
)
include_directories(include)
include_directories(src)
add_library(dict STATIC ${LIBDICT_SOURCES})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
set_target_properties(dict PROPERTIES COMPILE_FLAGS "-fPIC")
endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
set_target_properties(dict PROPERTIES PREFIX "lib")
#[[
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
find_package(CUnit REQUIRED)
enable_testing()
add_executable(dict_test unit_tests.c)
target_include_directories(dict_test PRIVATE ${CUNIT_INCLUDE_DIRS})
target_link_libraries (dict_test dict)
target_link_libraries(dict_test ${CUNIT_LIBRARIES})
add_test(
NAME dict_test
COMMAND dict_test
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
]]
add_library(dict_shared SHARED ${LIBDICT_SOURCES})
set(PUBLIC_HEADERS
include/dict.h
include/hashtable.h
include/hashtable2.h
include/hb_tree.h
include/pr_tree.h
include/rb_tree.h
include/skiplist.h
include/sp_tree.h
include/tr_tree.h
include/wb_tree.h
)
set_target_properties(dict_shared PROPERTIES
PUBLIC_HEADER "${PUBLIC_HEADERS}"
)
install(TARGETS dict_shared
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)