Skip to content
Snippets Groups Projects
Commit bae11dbd authored by Chadwick McHenry's avatar Chadwick McHenry
Browse files

adding ROS files

parent 9b835b2a
No related branches found
No related tags found
No related merge requests found
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})
<?xml version="1.0"?>
<package>
<!-- Changed the name to cfclient to avoid '_', as, when installed,
python converts them to '-' which are not allowed in catkin pkgs.
This prevents get_distribution from working, and retriving version
as specified in setup.py -->
<name>cfclient</name>
<version>2014.04.9001</version>
<description>Bitcraze Cazyflie nano quadcopter client</description>
<url type="website">https://github.com/mchenryc/crazyflie_clients_python</url>
<license>GPL</license>
<author email="contact@bitcraze.se">Bitcraze team</author>
<maintainer email="mchenryc@gmail.com">Chadwick McHenry</maintainer>
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- Use test_depend for packages you need only for testing: -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
</package>
...@@ -42,13 +42,8 @@ else: ...@@ -42,13 +42,8 @@ else:
setup_args=dict( setup_args=dict(
scripts=['bin/cfclient', 'bin/cfheadless']) scripts=['bin/cfclient', 'bin/cfheadless'])
with open(os.path.join(os.path.dirname(__file__), #Initial parameters
"lib", setup_args=dict(name='cfclient',
"cfclient",
"version.py"), "w") as versionpy:
versionpy.write("VERSION='{}'".format(VERSION))
setup(name='cfclient',
description='Bitcraze Cazyflie nano quadcopter client', description='Bitcraze Cazyflie nano quadcopter client',
version=VERSION, version=VERSION,
author='Bitcraze team', author='Bitcraze team',
...@@ -83,6 +78,24 @@ setup(name='cfclient', ...@@ -83,6 +78,24 @@ setup(name='cfclient',
glob.glob('lib/cfclient/*.png'))], glob.glob('lib/cfclient/*.png'))],
**setup_args) **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__), os.remove(os.path.join(os.path.dirname(__file__),
"lib", "lib",
"cfclient", "cfclient",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment