optimized python setup
authorGert-Jan Rozing <gert.rozing@myestro.de>
Mon, 26 Aug 2019 10:00:09 +0000 (12:00 +0200)
committerGert-Jan Rozing <gert.rozing@myestro.de>
Mon, 26 Aug 2019 10:00:09 +0000 (12:00 +0200)
CMakeLists.txt
cmake/setup.py.in [new file with mode: 0644]

index 393e38f47ffaaf33e0372252f35fd864f1c22fa3..face0310f49358bab73faefffc2ffeac4550ab01 100644 (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)")
diff --git a/cmake/setup.py.in b/cmake/setup.py.in
new file mode 100644 (file)
index 0000000..a5913a2
--- /dev/null
@@ -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}'}
+     )
+