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