mdbx-cmake: add installation.

Change-Id: Ie2f67e51ddaf9444b3c0a817cd5f8e7e37ec8d0e
This commit is contained in:
Leonid Yuriev 2019-12-03 03:21:37 +03:00
parent 94d90d87db
commit d1e2749337
3 changed files with 28 additions and 0 deletions

View File

@ -195,4 +195,22 @@ foreach(TOOL mdbx_chk mdbx_copy mdbx_stat mdbx_dump mdbx_load)
target_link_libraries(${TOOL} mdbx-static)
endforeach()
# installation
if(MDBX_BUILD_SHARED_LIBRARY)
install(TARGETS mdbx EXPORT libmdbx
LIBRARY DESTINATION lib COMPONENT runtime
PUBLIC_HEADER DESTINATION include
INCLUDES DESTINATION include COMPONENT devel)
endif()
install(TARGETS mdbx-static EXPORT libmdbx
LIBRARY DESTINATION lib COMPONENT runtime
OBJECTS DESTINATION lib/static COMPONENT devel
ARCHIVE DESTINATION lib/static COMPONENT devel
PUBLIC_HEADER DESTINATION include
INCLUDES DESTINATION include COMPONENT devel)
install(TARGETS mdbx_chk mdbx_stat mdbx_copy mdbx_dump mdbx_load
RUNTIME DESTINATION bin COMPONENT runtime)
cmake_policy(POP)

View File

@ -226,4 +226,11 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/elements/config.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/elements/config.h" ESCAPE_QUOTES)
add_definitions(-DMDBX_CONFIG_H="config.h")
install(TARGETS mdbx EXPORT libmdbx
LIBRARY DESTINATION lib COMPONENT runtime
OBJECTS DESTINATION lib/static COMPONENT devel
ARCHIVE DESTINATION lib/static COMPONENT devel
PUBLIC_HEADER DESTINATION include
INCLUDES DESTINATION include COMPONENT devel)
add_subdirectory(tools)

View File

@ -40,3 +40,6 @@ if(LIB_MATH)
target_link_libraries(mdbx_chk ${LIB_MATH})
target_link_libraries(mdbx_stat ${LIB_MATH})
endif()
install(TARGETS mdbx_chk mdbx_stat mdbx_copy mdbx_dump mdbx_load
RUNTIME DESTINATION bin COMPONENT runtime)