# HG changeset patch # User Mike Becker # Date 1577443735 -3600 # Node ID 2099a3aff61ef4a2edcf542c868995ca36343d30 # Parent 028039652b863e0367eac1a4da6c8d1d35e54972 adds install target for cmake builds diff -r 028039652b86 -r 2099a3aff61e CMakeLists.txt --- a/CMakeLists.txt Fri Dec 20 14:44:50 2019 +0100 +++ b/CMakeLists.txt Fri Dec 27 11:48:55 2019 +0100 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.10) project(ucx VERSION 2.1 DESCRIPTION "UAP Common Extensions") # Configuration diff -r 028039652b86 -r 2099a3aff61e src/CMakeLists.txt --- a/src/CMakeLists.txt Fri Dec 20 14:44:50 2019 +0100 +++ b/src/CMakeLists.txt Fri Dec 27 11:48:55 2019 +0100 @@ -14,6 +14,22 @@ ucx.c utils.c ) +set(headers + ucx/allocator.h + ucx/array.h + ucx/avl.h + ucx/buffer.h + ucx/list.h + ucx/logging.h + ucx/map.h + ucx/mempool.h + ucx/properties.h + ucx/stack.h + ucx/string.h + ucx/test.h + ucx/ucx.h + ucx/utils.h +) add_library(ucx SHARED ${sources}) add_library(ucx_static STATIC ${sources}) @@ -23,3 +39,12 @@ set_target_properties(ucx PROPERTIES SOVERSION 3 VERSION 3.1.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) \ No newline at end of file