mdbx-cmake: use GNUInstallDirs variables for all cases.

Resolves https://github.com/erthink/libmdbx/issues/209.
This commit is contained in:
Leonid Yuriev 2021-06-17 16:59:40 +03:00
parent 581ca4fdf4
commit d47864dedf
2 changed files with 23 additions and 22 deletions

View File

@ -681,6 +681,7 @@ img
impl impl
IMPLIB IMPLIB
inblock inblock
INCLUDEDIR
indx indx
INDXSIZE INDXSIZE
ini ini

View File

@ -670,34 +670,34 @@ endif()
# mdbx-shared-lib installation # mdbx-shared-lib installation
if(NOT DEFINED MDBX_DLL_INSTALL_DESTINATION) if(NOT DEFINED MDBX_DLL_INSTALL_DESTINATION)
if(WIN32) if(WIN32)
set(MDBX_DLL_INSTALL_DESTINATION bin) set(MDBX_DLL_INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR})
else() else()
set(MDBX_DLL_INSTALL_DESTINATION lib) set(MDBX_DLL_INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif() endif()
endif() endif()
if(MDBX_BUILD_SHARED_LIBRARY) if(MDBX_BUILD_SHARED_LIBRARY)
if(CMAKE_VERSION VERSION_LESS 3.12) if(CMAKE_VERSION VERSION_LESS 3.12)
install(TARGETS mdbx EXPORT libmdbx install(TARGETS mdbx EXPORT libmdbx
LIBRARY DESTINATION ${MDBX_DLL_INSTALL_DESTINATION} COMPONENT runtime LIBRARY DESTINATION ${MDBX_DLL_INSTALL_DESTINATION} COMPONENT runtime
OBJECTS DESTINATION lib COMPONENT devel OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
ARCHIVE DESTINATION lib COMPONENT devel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
PUBLIC_HEADER DESTINATION include COMPONENT devel PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel
INCLUDES DESTINATION include COMPONENT devel) INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
else() else()
install(TARGETS mdbx EXPORT libmdbx install(TARGETS mdbx EXPORT libmdbx
LIBRARY DESTINATION ${MDBX_DLL_INSTALL_DESTINATION} COMPONENT runtime LIBRARY DESTINATION ${MDBX_DLL_INSTALL_DESTINATION} COMPONENT runtime
NAMELINK_COMPONENT devel NAMELINK_COMPONENT devel
OBJECTS DESTINATION lib COMPONENT devel OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
ARCHIVE DESTINATION lib COMPONENT devel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
PUBLIC_HEADER DESTINATION include COMPONENT devel PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel
INCLUDES DESTINATION include COMPONENT devel) INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
endif() endif()
endif(MDBX_BUILD_SHARED_LIBRARY) endif(MDBX_BUILD_SHARED_LIBRARY)
# mdbx-tools installation # mdbx-tools installation
if(MDBX_BUILD_TOOLS) if(MDBX_BUILD_TOOLS)
if(NOT DEFINED MDBX_TOOLS_INSTALL_DESTINATION) if(NOT DEFINED MDBX_TOOLS_INSTALL_DESTINATION)
set(MDBX_TOOLS_INSTALL_DESTINATION bin) set(MDBX_TOOLS_INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR})
endif() endif()
install( install(
TARGETS TARGETS
@ -712,7 +712,7 @@ if(MDBX_BUILD_TOOLS)
COMPONENT runtime) COMPONENT runtime)
if(MDBX_INSTALL_MANPAGES) if(MDBX_INSTALL_MANPAGES)
if(NOT DEFINED MDBX_MAN_INSTALL_DESTINATION) if(NOT DEFINED MDBX_MAN_INSTALL_DESTINATION)
set(MDBX_MAN_INSTALL_DESTINATION man/man1) set(MDBX_MAN_INSTALL_DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif() endif()
install( install(
FILES FILES
@ -731,19 +731,19 @@ endif(MDBX_BUILD_TOOLS)
if(MDBX_INSTALL_STATIC) if(MDBX_INSTALL_STATIC)
if(CMAKE_VERSION VERSION_LESS 3.12) if(CMAKE_VERSION VERSION_LESS 3.12)
install(TARGETS mdbx-static EXPORT libmdbx install(TARGETS mdbx-static EXPORT libmdbx
LIBRARY DESTINATION lib COMPONENT devel LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
OBJECTS DESTINATION lib COMPONENT devel OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
ARCHIVE DESTINATION lib COMPONENT devel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
PUBLIC_HEADER DESTINATION include COMPONENT devel PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel
INCLUDES DESTINATION include COMPONENT devel) INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
else() else()
install(TARGETS mdbx-static EXPORT libmdbx install(TARGETS mdbx-static EXPORT libmdbx
LIBRARY DESTINATION lib COMPONENT devel LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
NAMELINK_COMPONENT devel NAMELINK_COMPONENT devel
OBJECTS DESTINATION lib COMPONENT devel OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
ARCHIVE DESTINATION lib COMPONENT devel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
PUBLIC_HEADER DESTINATION include COMPONENT devel PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel
INCLUDES DESTINATION include COMPONENT devel) INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
endif() endif()
endif(MDBX_INSTALL_STATIC) endif(MDBX_INSTALL_STATIC)