include(CheckIncludeFileCXX)
include(CheckFunctionExists)
+#put all the libs and binaries in one place
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
CHECK_FUNCTION_EXISTS(fallocate CEPH_HAVE_FALLOCATE)
CHECK_FUNCTION_EXISTS(posix_fadvise HAVE_POSIX_FADVISE)
CHECK_FUNCTION_EXISTS(posix_fallocate HAVE_POSIX_FALLOCATE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/
DESTINATION ${PYTHON_INSTDIR})
+add_subdirectory(pybind)
+
## dencoder
set(dencoder_srcs
test/encoding/ceph_dencoder.cc
install(TARGETS ceph-authtool DESTINATION bin)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in
- ${CMAKE_BINARY_DIR}/ceph-coverage @ONLY)
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in
- ${CMAKE_BINARY_DIR}/ceph-debugpack @ONLY)
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in
- ${CMAKE_BINARY_DIR}/ceph @ONLY)
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-crush-location.in
- ${CMAKE_BINARY_DIR}/ceph-crush-location @ONLY)
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
- ${CMAKE_BINARY_DIR}/init-ceph @ONLY)
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph @ONLY)
install(PROGRAMS
- ${CMAKE_BINARY_DIR}/ceph
- ${CMAKE_BINARY_DIR}/ceph-debugpack
- ${CMAKE_BINARY_DIR}/ceph-coverage
- ${CMAKE_BINARY_DIR}/init-ceph
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph
${CMAKE_SOURCE_DIR}/src/ceph-run
${CMAKE_SOURCE_DIR}/src/vstart.sh
${CMAKE_SOURCE_DIR}/src/ceph-clsinfo
add_custom_target(cephfs_testing DEPENDS
vstart
rados
+ cython_modules
cephfs
cls_cephfs
ceph-fuse
# Developer mode, but in a cmake build dir instead of the src dir
lib_path = os.path.join(os.getcwd(), "src")
pybind_path = os.path.join(src_path, "src", "pybind")
- pythonlib_path = os.path.join(src_path, "src", get_pythonlib_dir())
+ pythonlib_path = os.path.join(os.getcwd(), "../src/pybind", get_pythonlib_dir())
respawn_in_path(lib_path, pybind_path, pythonlib_path)
sys.path.insert(0, os.path.join(MYDIR, pybind_path))
--- /dev/null
+set(CYTHON_MODULE_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cython_modules)
+
+add_subdirectory(rados)
+add_subdirectory(rbd)
+add_subdirectory(cephfs)
+
+add_custom_target(cython_modules ALL
+ DEPENDS cython_rados cython_cephfs cython_rbd)
--- /dev/null
+add_custom_target(cython_cephfs
+ COMMAND
+ LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/cephfs
+ CFLAGS=\"-I${CMAKE_SOURCE_DIR}/src -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/src/include -std=c++11\"
+ python ${CMAKE_SOURCE_DIR}/src/pybind/cephfs/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/cephfs
+ DEPENDS rados cephfs)
+
ext_modules = cythonize([
Extension("cephfs",
["cephfs.pyx"],
- libraries=["cephfs"]
+ libraries=["cephfs"],
+ language="c++"
)
], build_dir=os.environ.get("CYTHON_BUILD_DIR", None), include_path=[
os.path.join(os.path.dirname(__file__), "..", "rados")]
--- /dev/null
+add_custom_target(cython_rados
+ COMMAND
+ LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/rados
+ CFLAGS=\"-I${CMAKE_SOURCE_DIR}/src/include -std=c++11\"
+ python ${CMAKE_SOURCE_DIR}/src/pybind/rados/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/rados
+ DEPENDS rados)
+
ext_modules = cythonize([
Extension("rados",
["rados.pyx"],
- libraries=["rados"]
+ libraries=["rados"],
+ language="c++"
)
], build_dir=os.environ.get("CYTHON_BUILD_DIR", None)),
cmdclass={
--- /dev/null
+add_custom_target(cython_rbd
+ COMMAND
+ LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/rbd
+ CFLAGS=\"-I${CMAKE_SOURCE_DIR}/src/include -std=c++11\"
+ python ${CMAKE_SOURCE_DIR}/src/pybind/rbd/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/rbd
+ DEPENDS rbd)
+
ext_modules = cythonize([
Extension("rbd",
["rbd.pyx"],
- libraries=["rbd"]
+ libraries=["rbd"],
+ language="c++"
)
], build_dir=os.environ.get("CYTHON_BUILD_DIR", None), include_path=[
os.path.join(os.path.dirname(__file__), "..", "rados")]