Sat, 05 Nov 2022 17:50:04 +0100
add compare functions
1 set(sources
2 utils.c
3 allocator.c
4 string.c
5 list.c
6 linked_list.c
7 tree.c
8 buffer.c
9 hash_key.c
10 hash_map.c
11 basic_mempool.c
12 printf.c
13 compare.c
14 )
15 set(headers
16 cx/common.h
17 cx/utils.h
18 cx/string.h
19 cx/allocator.h
20 cx/iterator.h
21 cx/list.h
22 cx/linked_list.h
23 cx/tree.h
24 cx/buffer.h
25 cx/map.h
26 cx/hash_key.h
27 cx/hash_map.h
28 cx/mempool.h
29 cx/basic_mempool.h
30 cx/printf.h
31 cx/compare.h
32 )
34 add_library(ucx SHARED ${sources})
35 add_library(ucx_static STATIC ${sources})
37 target_include_directories(ucx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
38 target_include_directories(ucx_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
40 set_target_properties(ucx PROPERTIES SOVERSION 4 VERSION 4.0.0)
41 set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
43 # it is sufficient to specify the headers for one of the targets
44 set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")
46 include(GNUInstallDirs)
47 install(TARGETS ucx ucx_static
48 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
49 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
50 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)