Sat, 22 Jan 2022 17:15:14 +0100
add iterator interface + linked list iterator
1 set(sources
2 utils.c
3 allocator.c
4 linked_list.c
5 tree.c
6 buffer.c
7 )
8 set(headers
9 cx/utils.h
10 cx/allocator.h
11 cx/iterator.h
12 cx/list.h
13 cx/linked_list.h
14 cx/tree.h
15 cx/buffer.h
16 )
18 add_library(ucx SHARED ${sources})
19 add_library(ucx_static STATIC ${sources})
21 target_include_directories(ucx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
22 target_include_directories(ucx_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
24 set_target_properties(ucx PROPERTIES SOVERSION 4 VERSION 4.0.0)
25 set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
27 # it is sufficient to specify the headers for one of the targets
28 set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")
30 include(GNUInstallDirs)
31 install(TARGETS ucx ucx_static
32 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
33 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
34 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)