From: Kefu Chai Date: Sat, 28 May 2016 09:09:37 +0000 (+0800) Subject: cmake: add the autoconf path variables back X-Git-Tag: v11.0.0~358^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce942bd619e542103d116deb694cc4b05f78f42f;p=ceph.git cmake: add the autoconf path variables back * partially revert 7a602ec. * the directory variables created by automake, like "prefix", "bindir", and "libdir", are used for generating configuration_file() for substitution, and they should have the same names with ones from autotools. * also fix the ${pkglibdir}, it should be the ${libdir}/${PACKAGE}. so the plugins are not installed into ${libdir}, in which the installed shared objects are supposed to be shared with other applications. * install shared libraries into ${CMAKE_INSTALL_LIBDIR} instead of ${prefix}/lib. this complies to what ceph.spec.in requires: ceph.spec.in expects the shared libraries to be installed into ${_libdir}, and ${_libdir} is /usr/lib64 on an amd64 machine. Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 985dfd703a11..808eb4bcb369 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,10 +2,19 @@ include(GetGitRevisionDescription) enable_language(C ASM) include(GNUInstallDirs) +# for erasure and compressor plugins +set(CMAKE_INSTALL_PKGLIBDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}) +# to be compatible with configure_files shared with autoconfig +set(bindir ${CMAKE_INSTALL_BINDIR}) +set(sbindir ${CMAKE_INSTALL_SBINDIR}) +set(libdir ${CMAKE_INSTALL_LIBDIR}) +set(sysconfdir ${CMAKE_INSTALL_SYSCONFDIR}) +set(pkgdatadir ${CMAKE_INSTALL_DATADIR}) +set(datadir ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) set(prefix ${CMAKE_INSTALL_PREFIX}) add_definitions("-DCEPH_LIBDIR=\"${CMAKE_INSTALL_LIBDIR}\"") -add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_LIBDIR}\"") +add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_PKGLIBDIR}\"") add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE") set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/yasm-wrapper)