mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-21 18:28:20 +08:00
mdbx-cmake: refine installation.
Change-Id: I085aba06b957eb1a0e9ce24791bcb5bcc496a609
This commit is contained in:
parent
84323a8a4c
commit
df4057db6f
@ -167,7 +167,7 @@ if(MDBX_BUILD_SHARED_LIBRARY)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# static library used for tools, to avoid rpath/dll-path troubles
|
# static library used for tools, to avoid rpath/dll-path troubles
|
||||||
add_library(mdbx-static STATIC EXCLUDE_FROM_ALL mdbx.c mdbx.h)
|
add_library(mdbx-static STATIC mdbx.c mdbx.h)
|
||||||
set_target_properties(mdbx-static PROPERTIES
|
set_target_properties(mdbx-static PROPERTIES
|
||||||
C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON
|
C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON
|
||||||
PUBLIC_HEADER mdbx.h)
|
PUBLIC_HEADER mdbx.h)
|
||||||
@ -197,20 +197,112 @@ endforeach()
|
|||||||
|
|
||||||
# installation
|
# installation
|
||||||
if(MDBX_BUILD_SHARED_LIBRARY)
|
if(MDBX_BUILD_SHARED_LIBRARY)
|
||||||
install(TARGETS mdbx EXPORT libmdbx
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
LIBRARY DESTINATION lib COMPONENT runtime
|
install(TARGETS mdbx EXPORT libmdbx
|
||||||
PUBLIC_HEADER DESTINATION include
|
RUNTIME
|
||||||
INCLUDES DESTINATION include COMPONENT devel)
|
DESTINATION bin
|
||||||
|
COMPONENT runtime
|
||||||
|
LIBRARY
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT runtime
|
||||||
|
OBJECTS
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
PUBLIC_HEADER
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel
|
||||||
|
INCLUDES
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel)
|
||||||
|
else()
|
||||||
|
install(TARGETS mdbx EXPORT libmdbx
|
||||||
|
RUNTIME
|
||||||
|
DESTINATION bin
|
||||||
|
COMPONENT runtime
|
||||||
|
LIBRARY
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT runtime
|
||||||
|
NAMELINK_COMPONENT devel
|
||||||
|
OBJECTS
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
PUBLIC_HEADER
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel
|
||||||
|
INCLUDES
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS mdbx-static EXPORT libmdbx
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
LIBRARY DESTINATION lib COMPONENT runtime
|
install(TARGETS mdbx-static EXPORT libmdbx EXCLUDE_FROM_ALL
|
||||||
OBJECTS DESTINATION lib/static COMPONENT devel
|
RUNTIME
|
||||||
ARCHIVE DESTINATION lib/static COMPONENT devel
|
DESTINATION bin
|
||||||
PUBLIC_HEADER DESTINATION include
|
COMPONENT runtime
|
||||||
INCLUDES DESTINATION include COMPONENT devel)
|
LIBRARY
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT runtime
|
||||||
|
OBJECTS
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
PUBLIC_HEADER
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel
|
||||||
|
INCLUDES
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel)
|
||||||
|
else()
|
||||||
|
install(TARGETS mdbx-static EXPORT libmdbx EXCLUDE_FROM_ALL
|
||||||
|
RUNTIME
|
||||||
|
DESTINATION bin
|
||||||
|
COMPONENT runtime
|
||||||
|
LIBRARY
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT runtime
|
||||||
|
NAMELINK_COMPONENT devel
|
||||||
|
OBJECTS
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
PUBLIC_HEADER
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel
|
||||||
|
INCLUDES
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS mdbx_chk mdbx_stat mdbx_copy mdbx_dump mdbx_load
|
install(
|
||||||
RUNTIME DESTINATION bin COMPONENT runtime)
|
TARGETS
|
||||||
|
mdbx_chk
|
||||||
|
mdbx_stat
|
||||||
|
mdbx_copy
|
||||||
|
mdbx_dump
|
||||||
|
mdbx_load
|
||||||
|
RUNTIME
|
||||||
|
DESTINATION bin
|
||||||
|
COMPONENT runtime)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
man1/mdbx_chk.1
|
||||||
|
man1/mdbx_stat.1
|
||||||
|
man1/mdbx_copy.1
|
||||||
|
man1/mdbx_dump.1
|
||||||
|
man1/mdbx_load.1
|
||||||
|
DESTINATION man/man1
|
||||||
|
COMPONENT doc)
|
||||||
|
|
||||||
cmake_policy(POP)
|
cmake_policy(POP)
|
||||||
|
@ -120,13 +120,6 @@ if(CC_HAS_VISIBILITY)
|
|||||||
target_compile_options(mdbx PRIVATE "-fvisibility=hidden")
|
target_compile_options(mdbx PRIVATE "-fvisibility=hidden")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS mdbx
|
|
||||||
LIBRARY DESTINATION lib COMPONENT runtime
|
|
||||||
RUNTIME DESTINATION bin COMPONENT runtime
|
|
||||||
ARCHIVE DESTINATION lib/static COMPONENT devel
|
|
||||||
PUBLIC_HEADER DESTINATION include
|
|
||||||
INCLUDES DESTINATION include COMPONENT devel)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# library build info (used in library version output)
|
# library build info (used in library version output)
|
||||||
@ -226,11 +219,50 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/elements/config.h.in"
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/elements/config.h" ESCAPE_QUOTES)
|
"${CMAKE_CURRENT_SOURCE_DIR}/elements/config.h" ESCAPE_QUOTES)
|
||||||
add_definitions(-DMDBX_CONFIG_H="config.h")
|
add_definitions(-DMDBX_CONFIG_H="config.h")
|
||||||
|
|
||||||
install(TARGETS mdbx EXPORT libmdbx
|
# installation
|
||||||
LIBRARY DESTINATION lib COMPONENT runtime
|
if(MDBX_BUILD_SHARED_LIBRARY)
|
||||||
OBJECTS DESTINATION lib/static COMPONENT devel
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
ARCHIVE DESTINATION lib/static COMPONENT devel
|
install(TARGETS mdbx EXPORT libmdbx
|
||||||
PUBLIC_HEADER DESTINATION include
|
RUNTIME
|
||||||
INCLUDES DESTINATION include COMPONENT devel)
|
DESTINATION bin
|
||||||
|
COMPONENT runtime
|
||||||
|
LIBRARY
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT runtime
|
||||||
|
OBJECTS
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
PUBLIC_HEADER
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel
|
||||||
|
INCLUDES
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel)
|
||||||
|
else()
|
||||||
|
install(TARGETS mdbx EXPORT libmdbx
|
||||||
|
RUNTIME
|
||||||
|
DESTINATION bin
|
||||||
|
COMPONENT runtime
|
||||||
|
LIBRARY
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT runtime
|
||||||
|
NAMELINK_COMPONENT devel
|
||||||
|
OBJECTS
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION lib
|
||||||
|
COMPONENT devel
|
||||||
|
PUBLIC_HEADER
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel
|
||||||
|
INCLUDES
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT devel)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(tools)
|
add_subdirectory(tools)
|
||||||
|
@ -31,9 +31,6 @@ foreach(TOOL ${MDBX_TOOLS})
|
|||||||
set_target_properties(${TOOL} PROPERTIES
|
set_target_properties(${TOOL} PROPERTIES
|
||||||
C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON
|
C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON
|
||||||
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
|
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
|
||||||
|
|
||||||
install(TARGETS ${TOOL} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COMPONENT mdbx)
|
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../man1/${TOOL}.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1 COMPONENT mdbx)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(LIB_MATH)
|
if(LIB_MATH)
|
||||||
@ -41,5 +38,23 @@ if(LIB_MATH)
|
|||||||
target_link_libraries(mdbx_stat ${LIB_MATH})
|
target_link_libraries(mdbx_stat ${LIB_MATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS mdbx_chk mdbx_stat mdbx_copy mdbx_dump mdbx_load
|
install(
|
||||||
RUNTIME DESTINATION bin COMPONENT runtime)
|
TARGETS
|
||||||
|
mdbx_chk
|
||||||
|
mdbx_stat
|
||||||
|
mdbx_copy
|
||||||
|
mdbx_dump
|
||||||
|
mdbx_load
|
||||||
|
RUNTIME
|
||||||
|
DESTINATION bin
|
||||||
|
COMPONENT runtime)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
../man1/mdbx_chk.1
|
||||||
|
../man1/mdbx_stat.1
|
||||||
|
../man1/mdbx_copy.1
|
||||||
|
../man1/mdbx_dump.1
|
||||||
|
../man1/mdbx_load.1
|
||||||
|
DESTINATION man/man1
|
||||||
|
COMPONENT doc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user