From: Kefu Chai Date: Mon, 4 Jul 2016 03:26:28 +0000 (+0800) Subject: cmake: refactor distutils_install_module to follow the pattern of distutils_install_c... X-Git-Tag: ses5-milestone5~503^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c5fb822dd22cf561c4e574d9407c1a895618a2a;p=ceph.git cmake: refactor distutils_install_module to follow the pattern of distutils_install_cython_module Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake index 7394ac6ce83..bebd43d6b5d 100644 --- a/cmake/modules/Distutils.cmake +++ b/cmake/modules/Distutils.cmake @@ -52,16 +52,14 @@ endfunction(distutils_add_cython_module) function(distutils_install_cython_module name) install(CODE " + set(options --prefix=${CMAKE_INSTALL_PREFIX}) if(DEFINED ENV{DESTDIR}) if(EXISTS /etc/debian_version) - set(options --install-layout=deb) - else() - set(options --prefix=/usr) + list(APPEND options --install-layout=deb) endif() - set(root --root=\$ENV{DESTDIR}) + list(APPEND options --root=\$ENV{DESTDIR}) else() - set(options \"--prefix=${CMAKE_INSTALL_PREFIX}\") - set(root --root=/) + list(APPEND options --root=/) endif() execute_process( COMMAND env @@ -69,7 +67,7 @@ function(distutils_install_cython_module name) CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\" ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose - install \${options} \${root} --verbose + install \${options} --verbose --single-version-externally-managed --record /dev/null WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\" RESULT_VARIABLE install_res)