optimized python setup

This commit is contained in:
Gert-Jan Rozing 2019-08-26 12:00:09 +02:00
parent b5f0e61ccf
commit 492d83d0d3
No known key found for this signature in database
GPG Key ID: 8FAC2AA4BFE8A306
2 changed files with 29 additions and 1 deletions

View File

@ -130,7 +130,11 @@ install(FILES ${man_3_SRC}
find_package(Python COMPONENTS Interpreter QUIET)
if(Python_FOUND)
install(CODE "execute_process(COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py install)")
configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/setup.py.in
${CMAKE_CURRENT_BINARY_DIR}/setup.py
)
install(CODE "execute_process(${Python_EXECUTABLE} setup.py install)")
endif()
#
#install(CODE "execute_process(COMMAND ldconfig)")

24
cmake/setup.py.in Normal file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
from distutils.core import setup
setup(name='pigpio',
version='1.44',
author='joan',
author_email='joan@abyz.me.uk',
maintainer='joan',
maintainer_email='joan@abyz.me.uk',
url='http://abyz.me.uk/rpi/pigpio/python.html',
description='Raspberry Pi GPIO module',
long_description='Raspberry Pi Python module to access the pigpio daemon',
download_url='http://abyz.me.uk/rpi/pigpio/pigpio.zip',
license='unlicense.org',
py_modules=['pigpio'],
keywords=['raspberrypi', 'gpio',],
classifiers=[
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
package_dir={ '': '${CMAKE_CURRENT_SOURCE_DIR}'}
)