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