python: properly build and install with cmake and autotools

This commit is contained in:
Adrien Béraud committed 2015-08-31 20:33:59 +02:00
1 parent 45d8817e32
commit a31bd73a6d
5 files changed
+49 -7

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
set(CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
configure_file(setup.py.in setup.py)
add_custom_target(python ALL
COMMAND python3 setup.py build
DEPENDS opendht opendht_cpp.pxd opendht.pyx)
install(CODE "execute_process(COMMAND python3 setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+1 -1
View File
@@ -11,7 +11,7 @@ clean-local:
rm -rf $(builddir)/build $(builddir)/*.so
install:
$(PYTHON) setup.py install
$(PYTHON) setup.py install --prefix=$(PYTHON_PREFIX)
rm -rf $(builddir)/build
endif
+20 -5
View File
@@ -26,17 +26,32 @@ from Cython.Build import cythonize
from Cython.Distutils import build_ext
setup(name="opendht",
version="0.1",
description="Cython generated wrapper for opendht",
author="Guillaume Roguez",
version="@PACKAGE_VERSION@",
description="Python wrapper for opendht",
author="Adrien Béraud, Guillaume Roguez",
license="GPLv3",
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Distributed Computing',
'Topic :: System :: Networking'
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
cmdclass = { 'build_ext' : build_ext },
ext_modules = cythonize(Extension(
"opendht",
["opendht.pyx"],
["@CURRENT_SOURCE_DIR@/opendht.pyx"],
include_dirs = ['@PROJECT_SOURCE_DIR@/include'],
language="c++",
extra_compile_args=["-std=c++11"],
extra_link_args=["-std=c++11"],
libraries=["opendht"]
libraries=["opendht"],
library_dirs = ['@CURRENT_BINARY_DIR@', '@PROJECT_BINARY_DIR@']
))
)