Mon, 29 Aug 2022 20:54:42 +0200
first proposal for the string header
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 )
13 set(headers
14 cx/common.h
15 cx/utils.h
16 cx/string.h
17 cx/allocator.h
18 cx/iterator.h
19 cx/list.h
20 cx/linked_list.h
21 cx/tree.h
22 cx/buffer.h
23 cx/map.h
24 cx/hash_key.h
25 cx/hash_map.h
26 cx/mempool.h
27 cx/basic_mempool.h
28 )
30 add_library(ucx SHARED ${sources})
31 add_library(ucx_static STATIC ${sources})
33 target_include_directories(ucx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
34 target_include_directories(ucx_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
36 set_target_properties(ucx PROPERTIES SOVERSION 4 VERSION 4.0.0)
37 set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
39 # it is sufficient to specify the headers for one of the targets
40 set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")
42 include(GNUInstallDirs)
43 install(TARGETS ucx ucx_static
44 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
45 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
46 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)