src/CMakeLists.txt

Sun, 23 Oct 2022 16:57:10 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 23 Oct 2022 16:57:10 +0200
changeset 597
8b48126671cf
parent 576
ba0c4ff6698e
child 599
6536a9a75b71
permissions
-rw-r--r--

#217 cover cx_strcat macro

set(sources
        utils.c
        allocator.c
        string.c
        list.c
        linked_list.c
        tree.c
        buffer.c
        hash_key.c
        hash_map.c
        basic_mempool.c
)
set(headers
        cx/common.h
        cx/utils.h
        cx/string.h
        cx/allocator.h
        cx/iterator.h
        cx/list.h
        cx/linked_list.h
        cx/tree.h
        cx/buffer.h
        cx/map.h
        cx/hash_key.h
        cx/hash_map.h
        cx/mempool.h
        cx/basic_mempool.h
        )

add_library(ucx SHARED ${sources})
add_library(ucx_static STATIC ${sources})

target_include_directories(ucx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(ucx_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

set_target_properties(ucx PROPERTIES SOVERSION 4 VERSION 4.0.0)
set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})

# it is sufficient to specify the headers for one of the targets
set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")

include(GNUInstallDirs)
install(TARGETS ucx ucx_static
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
        PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)

mercurial