Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
a31bd73a
Commit
a31bd73a
authored
9 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
python: properly build and install with cmake and autotools
parent
45d8817e
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
CMakeLists.txt
+8
-0
8 additions, 0 deletions
CMakeLists.txt
configure.ac
+9
-1
9 additions, 1 deletion
configure.ac
python/CMakeLists.txt
+11
-0
11 additions, 0 deletions
python/CMakeLists.txt
python/Makefile.am
+1
-1
1 addition, 1 deletion
python/Makefile.am
python/setup.py.in
+20
-5
20 additions, 5 deletions
python/setup.py.in
with
49 additions
and
7 deletions
CMakeLists.txt
+
8
−
0
View file @
a31bd73a
cmake_minimum_required
(
VERSION 2.8.6
)
cmake_minimum_required
(
VERSION 2.8.6
)
project
(
opendht
)
project
(
opendht
)
set
(
opendht_VERSION_MAJOR 0
)
set
(
opendht_VERSION_MINOR 1
)
set
(
opendht_VERSION
${
opendht_VERSION_MAJOR
}
.
${
opendht_VERSION_MINOR
}
)
set
(
PACKAGE_VERSION
${
opendht_VERSION
}
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
)
...
@@ -78,6 +82,10 @@ if (OPENDHT_TOOLS)
...
@@ -78,6 +82,10 @@ if (OPENDHT_TOOLS)
add_subdirectory
(
tools
)
add_subdirectory
(
tools
)
endif
()
endif
()
if
(
OPENDHT_PYTHON
)
add_subdirectory
(
python
)
endif
()
install
(
TARGETS opendht opendht-static DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
TARGETS opendht opendht-static DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
DIRECTORY include DESTINATION
${
CMAKE_INSTALL_PREFIX
}
)
install
(
DIRECTORY include DESTINATION
${
CMAKE_INSTALL_PREFIX
}
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/opendht.pc DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/opendht.pc DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
This diff is collapsed.
Click to expand it.
configure.ac
+
9
−
1
View file @
a31bd73a
...
@@ -80,7 +80,15 @@ AC_ARG_ENABLE([tools], AS_HELP_STRING([--disable-tools],[Disable tools (CLI DHT
...
@@ -80,7 +80,15 @@ AC_ARG_ENABLE([tools], AS_HELP_STRING([--disable-tools],[Disable tools (CLI DHT
AM_CONDITIONAL(ENABLE_TOOLS, test x$build_tools == xyes)
AM_CONDITIONAL(ENABLE_TOOLS, test x$build_tools == xyes)
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])])
AM_COND_IF([USE_CYTHON], [AC_CONFIG_FILES([python/Makefile])])
dnl Configure setup.py if we build the python module
AM_COND_IF([USE_CYTHON], [
AC_SUBST(CURRENT_SOURCE_DIR, ".")
AC_SUBST(CURRENT_BINARY_DIR, ".")
AC_SUBST(PROJECT_SOURCE_DIR, "..")
AC_SUBST(PROJECT_BINARY_DIR, "../src/.libs")
AC_CONFIG_FILES([python/Makefile python/setup.py])
])
AC_CONFIG_FILES([Makefile
AC_CONFIG_FILES([Makefile
src/Makefile
src/Makefile
...
...
This diff is collapsed.
Click to expand it.
python/CMakeLists.txt
0 → 100644
+
11
−
0
View file @
a31bd73a
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
}
)"
)
This diff is collapsed.
Click to expand it.
python/Makefile.am
+
1
−
1
View file @
a31bd73a
...
@@ -11,7 +11,7 @@ clean-local:
...
@@ -11,7 +11,7 @@ clean-local:
rm
-rf
$(
builddir
)
/build
$(
builddir
)
/
*
.so
rm
-rf
$(
builddir
)
/build
$(
builddir
)
/
*
.so
install
:
install
:
$(
PYTHON
)
setup.py
install
$(
PYTHON
)
setup.py
install
--prefix
=
$(
PYTHON_PREFIX
)
rm
-rf
$(
builddir
)
/build
rm
-rf
$(
builddir
)
/build
endif
endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
python/setup.py
→
python/setup.py
.in
+
20
−
5
View file @
a31bd73a
...
@@ -26,17 +26,32 @@ from Cython.Build import cythonize
...
@@ -26,17 +26,32 @@ from Cython.Build import cythonize
from Cython.Distutils import build_ext
from Cython.Distutils import build_ext
setup(name="opendht",
setup(name="opendht",
version
=
"
0.1
"
,
version="
@PACKAGE_VERSION@
",
description
=
"
C
ython
generated
wrapper for opendht
"
,
description="
P
ython wrapper for opendht",
author
=
"
Guillaume Roguez
"
,
author="
Adrien Béraud,
Guillaume Roguez",
license="GPLv3",
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 },
cmdclass = { 'build_ext' : build_ext },
ext_modules = cythonize(Extension(
ext_modules = cythonize(Extension(
"opendht",
"opendht",
[
"
opendht.pyx
"
],
["@CURRENT_SOURCE_DIR@/opendht.pyx"],
include_dirs = ['@PROJECT_SOURCE_DIR@/include'],
language="c++",
language="c++",
extra_compile_args=["-std=c++11"],
extra_compile_args=["-std=c++11"],
extra_link_args=["-std=c++11"],
extra_link_args=["-std=c++11"],
libraries
=
[
"
opendht
"
]
libraries=["opendht"],
library_dirs = ['@CURRENT_BINARY_DIR@', '@PROJECT_BINARY_DIR@']
))
))
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment