src/CMakeLists.txt

Mon, 18 Apr 2022 14:35:41 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 18 Apr 2022 14:35:41 +0200
changeset 522
b91c50d023f4
parent 503
a89857072ace
child 549
d7f0b5a9a985
permissions
-rw-r--r--

add [[maybe_unused]] attributed to params of mocked function

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