src/CMakeLists.txt

Tue, 05 Oct 2021 12:19:19 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 05 Oct 2021 12:19:19 +0200
changeset 463
92721c8f9db3
parent 424
2d6f6cb24132
child 469
0458bff0b1cd
permissions
-rw-r--r--

change src dir of Doxygen to only include header files

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