diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..f26d6731 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.3) +project(cfclient) +find_package(catkin REQUIRED) +catkin_package() +catkin_python_setup() +install(PROGRAMS bin/cfclient bin/cfheadless + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) diff --git a/package.xml b/package.xml new file mode 100644 index 00000000..db1f1746 --- /dev/null +++ b/package.xml @@ -0,0 +1,25 @@ + + + + cfclient + 2014.04.9001 + Bitcraze Cazyflie nano quadcopter client + + https://github.com/mchenryc/crazyflie_clients_python + GPL + + Bitcraze team + Chadwick McHenry + + + + + + + catkin + rospy + + diff --git a/setup.py b/setup.py index 3267fdc3..e9eed505 100644 --- a/setup.py +++ b/setup.py @@ -42,13 +42,8 @@ setup_args=dict( scripts=['bin/cfclient', 'bin/cfheadless']) -with open(os.path.join(os.path.dirname(__file__), - "lib", - "cfclient", - "version.py"), "w") as versionpy: - versionpy.write("VERSION='{}'".format(VERSION)) - -setup(name='cfclient', +#Initial parameters +setup_args=dict(name='cfclient', description='Bitcraze Cazyflie nano quadcopter client', version=VERSION, author='Bitcraze team', @@ -83,6 +78,24 @@ glob.glob('lib/cfclient/*.png'))], **setup_args) +#Fetch values from package.xml when using catkin +import os +if os.getenv('CATKIN_TEST_RESULTS_DIR'): + from catkin_pkg.python_setup import generate_distutils_setup + #Delete keys which should not match catkin packaged variant + for k in ('version', 'url'): + setup_args.pop(k, None) + setup_args=generate_distutils_setup(**setup_args) + +#Write a temp file to pass version into script +with open(os.path.join(os.path.dirname(__file__), + "lib", + "cfclient", + "version.py"), "w") as versionpy: + versionpy.write("VERSION='{}'".format(VERSION)) + +setup(**setup_args) + os.remove(os.path.join(os.path.dirname(__file__), "lib", "cfclient",