src/CMakeLists.txt

Thu, 23 Dec 2021 15:20:50 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 23 Dec 2021 15:20:50 +0100
changeset 481
eef025d82a34
parent 470
e5a4de4f1e03
child 483
929016224c3c
permissions
-rw-r--r--

add several new linked list functions

* cx_linked_list_insert()
* cx_linked_list_insert_chain()
* cx_linked_list_link()
* cx_linked_list_unlink()

Also uses the most general function wherever possible.

set(sources
        allocator.c
        linked_list.c
        tree.c
)
set(headers
        cx/allocator.h
        cx/list.h
        cx/linked_list.h
        cx/tree.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