Sat, 05 Nov 2022 17:17:17 +0100
#222 add printf-like 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 )
14 set(headers
15 cx/common.h
16 cx/utils.h
17 cx/string.h
18 cx/allocator.h
19 cx/iterator.h
20 cx/list.h
21 cx/linked_list.h
22 cx/tree.h
23 cx/buffer.h
24 cx/map.h
25 cx/hash_key.h
26 cx/hash_map.h
27 cx/mempool.h
28 cx/basic_mempool.h
29 cx/printf.h
30 )
32 add_library(ucx SHARED ${sources})
33 add_library(ucx_static STATIC ${sources})
35 target_include_directories(ucx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
36 target_include_directories(ucx_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
38 set_target_properties(ucx PROPERTIES SOVERSION 4 VERSION 4.0.0)
39 set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
41 # it is sufficient to specify the headers for one of the targets
42 set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")
44 include(GNUInstallDirs)
45 install(TARGETS ucx ucx_static
46 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
47 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
48 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)