From d47864dedf5f33a5721cf4668c138825770cc0ef Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 17 Jun 2021 16:59:40 +0300 Subject: [PATCH] mdbx-cmake: use `GNUInstallDirs` variables for all cases. Resolves https://github.com/erthink/libmdbx/issues/209. --- .github/actions/spelling/expect.txt | 1 + CMakeLists.txt | 44 ++++++++++++++--------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 61ea4fb9..a8284d57 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -681,6 +681,7 @@ img impl IMPLIB inblock +INCLUDEDIR indx INDXSIZE ini diff --git a/CMakeLists.txt b/CMakeLists.txt index dfff4a37..a36c0ba8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -670,34 +670,34 @@ endif() # mdbx-shared-lib installation if(NOT DEFINED MDBX_DLL_INSTALL_DESTINATION) if(WIN32) - set(MDBX_DLL_INSTALL_DESTINATION bin) + set(MDBX_DLL_INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) else() - set(MDBX_DLL_INSTALL_DESTINATION lib) + set(MDBX_DLL_INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() endif() if(MDBX_BUILD_SHARED_LIBRARY) if(CMAKE_VERSION VERSION_LESS 3.12) install(TARGETS mdbx EXPORT libmdbx LIBRARY DESTINATION ${MDBX_DLL_INSTALL_DESTINATION} COMPONENT runtime - OBJECTS DESTINATION lib COMPONENT devel - ARCHIVE DESTINATION lib COMPONENT devel - PUBLIC_HEADER DESTINATION include COMPONENT devel - INCLUDES DESTINATION include COMPONENT devel) + OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel) else() install(TARGETS mdbx EXPORT libmdbx LIBRARY DESTINATION ${MDBX_DLL_INSTALL_DESTINATION} 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) + OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel) endif() endif(MDBX_BUILD_SHARED_LIBRARY) # mdbx-tools installation if(MDBX_BUILD_TOOLS) if(NOT DEFINED MDBX_TOOLS_INSTALL_DESTINATION) - set(MDBX_TOOLS_INSTALL_DESTINATION bin) + set(MDBX_TOOLS_INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() install( TARGETS @@ -712,7 +712,7 @@ if(MDBX_BUILD_TOOLS) COMPONENT runtime) if(MDBX_INSTALL_MANPAGES) if(NOT DEFINED MDBX_MAN_INSTALL_DESTINATION) - set(MDBX_MAN_INSTALL_DESTINATION man/man1) + set(MDBX_MAN_INSTALL_DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() install( FILES @@ -731,19 +731,19 @@ endif(MDBX_BUILD_TOOLS) if(MDBX_INSTALL_STATIC) if(CMAKE_VERSION VERSION_LESS 3.12) install(TARGETS mdbx-static EXPORT libmdbx - LIBRARY DESTINATION lib COMPONENT devel - OBJECTS DESTINATION lib COMPONENT devel - ARCHIVE DESTINATION lib COMPONENT devel - PUBLIC_HEADER DESTINATION include COMPONENT devel - INCLUDES DESTINATION include COMPONENT devel) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel) else() install(TARGETS mdbx-static EXPORT libmdbx - LIBRARY DESTINATION lib COMPONENT devel + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel NAMELINK_COMPONENT devel - OBJECTS DESTINATION lib COMPONENT devel - ARCHIVE DESTINATION lib COMPONENT devel - PUBLIC_HEADER DESTINATION include COMPONENT devel - INCLUDES DESTINATION include COMPONENT devel) + OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel) endif() endif(MDBX_INSTALL_STATIC)