]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add the autoconf path variables back
authorKefu Chai <kchai@redhat.com>
Sat, 28 May 2016 09:09:37 +0000 (17:09 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 1 Jun 2016 15:49:46 +0000 (23:49 +0800)
* 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 <kchai@redhat.com>
src/CMakeLists.txt

index 985dfd703a11bf17d8d57f2b68dbb62d791a1c3f..808eb4bcb369415d53a11ac73176bda69a1814d7 100644 (file)
@@ -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)