src/CMakeLists.txt

Fri, 27 May 2022 13:25:42 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 27 May 2022 13:25:42 +0200
changeset 558
9b767b07602c
parent 549
d7f0b5a9a985
child 563
69a83fad8a35
permissions
-rw-r--r--

add convenience function to make keys from strings

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

mercurial