From 492d83d0d34a20f6e697cdaba1a12429fb12dcde Mon Sep 17 00:00:00 2001 From: Gert-Jan Rozing Date: Mon, 26 Aug 2019 12:00:09 +0200 Subject: [PATCH] optimized python setup --- CMakeLists.txt | 6 +++++- cmake/setup.py.in | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cmake/setup.py.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 393e38f..face031 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)") diff --git a/cmake/setup.py.in b/cmake/setup.py.in new file mode 100644 index 0000000..a5913a2 --- /dev/null +++ b/cmake/setup.py.in @@ -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}'} + ) +