diff options
author | Kefu Chai <kchai@redhat.com> | 2016-06-01 07:38:05 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2016-06-01 17:50:05 +0200 |
commit | bbf51e15621ab1261f22e5ec8e53df10a0018566 (patch) | |
tree | 4c2a1e4e6126a32b75af1d20f265c08de044969f /src/pybind/CMakeLists.txt | |
parent | cmake: install compressor plugins into ${pkglibdir/compressor (diff) | |
download | ceph-bbf51e15621ab1261f22e5ec8e53df10a0018566.tar.xz ceph-bbf51e15621ab1261f22e5ec8e53df10a0018566.zip |
cmake: install cython modules
* fix CYTHON_ADD_MODULE() macro. because python_add_module() offered by
FindPythonLibs.cmake creates a target with name of ${name}, which conflicts
with existing targets like "rbd" or "rados". so we can not reuse the
name in ${name}.pyx. and instead, we should specify the target name
explicitly.
* add distutils_install_cython_module() function to build and install
cython modules.
* we can split build and install of cython module, but the install phase
always tries to build the module. so keep it this way. will look at it
later on.
* move the variables initializations into the Distutils.cmake module.
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/pybind/CMakeLists.txt')
-rw-r--r-- | src/pybind/CMakeLists.txt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pybind/CMakeLists.txt b/src/pybind/CMakeLists.txt index 6a4ba94ebd0..9acea1db921 100644 --- a/src/pybind/CMakeLists.txt +++ b/src/pybind/CMakeLists.txt @@ -1,9 +1,7 @@ +find_package(Cython REQUIRED) +include(Distutils) + set(CYTHON_MODULE_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cython_modules) -get_property(compiler_launcher GLOBAL PROPERTY RULE_LAUNCH_COMPILE) -get_property(link_launcher GLOBAL PROPERTY RULE_LAUNCH_LINK) -set(PY_CC \"${compiler_launcher} ${CMAKE_C_COMPILER}\") -set(PY_CXX \"${compiler_launcher} ${CMAKE_CXX_COMPILER}\") -set(PY_LDSHARED \"${link_launcher} ${CMAKE_C_COMPILER} -shared\") add_subdirectory(rados) add_subdirectory(rbd) |