adds install target for cmake builds

Fri, 27 Dec 2019 11:48:55 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 27 Dec 2019 11:48:55 +0100
changeset 377
2099a3aff61e
parent 376
028039652b86
child 378
952c2df7e7ac

adds install target for cmake builds

CMakeLists.txt file | annotate | diff | comparison | revisions
src/CMakeLists.txt file | annotate | diff | comparison | revisions
     1.1 --- a/CMakeLists.txt	Fri Dec 20 14:44:50 2019 +0100
     1.2 +++ b/CMakeLists.txt	Fri Dec 27 11:48:55 2019 +0100
     1.3 @@ -1,4 +1,4 @@
     1.4 -cmake_minimum_required(VERSION 3.15)
     1.5 +cmake_minimum_required(VERSION 3.10)
     1.6  project(ucx VERSION 2.1 DESCRIPTION "UAP Common Extensions")
     1.7  
     1.8  # Configuration
     2.1 --- a/src/CMakeLists.txt	Fri Dec 20 14:44:50 2019 +0100
     2.2 +++ b/src/CMakeLists.txt	Fri Dec 27 11:48:55 2019 +0100
     2.3 @@ -14,6 +14,22 @@
     2.4          ucx.c
     2.5          utils.c
     2.6  )
     2.7 +set(headers
     2.8 +        ucx/allocator.h
     2.9 +        ucx/array.h
    2.10 +        ucx/avl.h
    2.11 +        ucx/buffer.h
    2.12 +        ucx/list.h
    2.13 +        ucx/logging.h
    2.14 +        ucx/map.h
    2.15 +        ucx/mempool.h
    2.16 +        ucx/properties.h
    2.17 +        ucx/stack.h
    2.18 +        ucx/string.h
    2.19 +        ucx/test.h
    2.20 +        ucx/ucx.h
    2.21 +        ucx/utils.h
    2.22 +)
    2.23  
    2.24  add_library(ucx SHARED ${sources})
    2.25  add_library(ucx_static STATIC ${sources})
    2.26 @@ -23,3 +39,12 @@
    2.27  
    2.28  set_target_properties(ucx PROPERTIES SOVERSION 3 VERSION 3.1.0)
    2.29  set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
    2.30 +
    2.31 +# it is sufficient to specify the headers for one of the targets
    2.32 +set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")
    2.33 +
    2.34 +include(GNUInstallDirs)
    2.35 +install(TARGETS ucx ucx_static
    2.36 +        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    2.37 +        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    2.38 +        PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)
    2.39 \ No newline at end of file

mercurial