FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


softwaredevtips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
softwaredevtips [2019/02/13 17:53]
dtscbs
softwaredevtips [2019/03/08 15:17] (current)
dtscbs
Line 2: Line 2:
 ===== Software Hints and Tips ===== ===== Software Hints and Tips =====
  
-==== New Ubuntu Install ====+Directions for installing a [[WindowsDeveEnvironment|Windows Development Environment]].
  
-The standard install ​for Linux development is Ubuntu 16.04 LTS. This can be downloaded from [[http://​releases.ubuntu.com/​16.04/​|Ubuntu ​16.04 LTS]]. A virtual machine can be created using [[https://​www.vmware.com/​products/​workstation-player.html | VMWare Player]]. After installing VMWare Player and Ubuntu, ​ You will have to install the following packages to develop software on the VM.+Directions ​for installing a [[UbuntuDeveEnvironment|Ubuntu ​Development Environment]].
  
-  * git +Directions for installing a [[RaspberryPiDeveEnvironment|Raspberry PI Development Environment]].
-  * cmake +
-  * gcc +
-  * g++ +
-  * python +
-  * vim (or the editor of your choice) +
- +
-<​code>​ +
-sudo apt-get update +
-sudo apt-get install git cmake vim +
-sudo apt-get install gcc g++ +
-sudo apt-get install python +
-</​code>​ +
- +
-==== Updating GCC on Ubuntu 16.04 LTS ==== +
- +
-Our builds on windows and Git bash use GCC version 7.3.  Ubuntu ships with GCC version 5.4. In order to standardize the development environments we should upgrade GCC to match Windows build. ​ To do this, execute the following steps: +
- +
-<​code>​ +
-sudo add-apt-repository ppa:​ubuntu-toolchain-r/​test +
-sudo apt-get update +
-sudo apt-get install gcc-7 g++-7 +
-</​code>​+
  
 ==== Adding a custom build step to CMAKE ==== ==== Adding a custom build step to CMAKE ====
- 
  
 This tells you how to add a custom build step to a CMAKE based project. If, foir example, you need to force a script to run before the project builds. There is a difference between how you do this for Windows and Linux. Below is the way the revision information is updated before the project is build This tells you how to add a custom build step to a CMAKE based project. If, foir example, you need to force a script to run before the project builds. There is a difference between how you do this for Windows and Linux. Below is the way the revision information is updated before the project is build
Line 44: Line 21:
     COMMENT "​Updating revision information"​     COMMENT "​Updating revision information"​
 ) )
- 
 ELSE() ELSE()
 add_custom_target( add_custom_target(
Line 70: Line 46:
 {{:​eclipseprebuild.png?​400|}} {{:​eclipseprebuild.png?​400|}}
  
 +==== Adding a custom build step to Qt Creator ====
 +
 +There is a way to add a custom build step with the GUI. However, this is saved in the xyz.pro.user file. This file is for per-user customization and shouldn'​t be checked into the repository. There is a way to create a "​default"​ pro-user file but that isn't really the best solution to this problem. If the project is up to date, it will not get the latest revision information and force the build based on that.  A better solution is to use the following in the .pro file:
 +
 +
 +<​code>​
 +# Update revision information
 +PRE_TARGETDEPS += git_rev_data.h
 +QMAKE_EXTRA_TARGETS += revisionTarget
 +revisionTarget.target = git_rev_data.h
 +win32: revisionTarget.commands = cd $$PWD && python.exe $$PWD/​git-revision.py -o $$PWD/​inc/​git_rev_data.h
 +else:  revisionTarget.commands = python $$PWD/​git-revision.py -o $$PWD/​inc/​git_rev_data.h
 +revisionTarget.depends = FORCE
 +</​code>​
 +
 +A couple of notes:
  
 +1) You MUST use the CD in the "​.commands"​ line. If you do not, you will not change into the proper sub-module directory. This will prevent GIT from grabbing the latest revision information.
  
 +2) You MUST use && despite what you read on the internet. Several examples exist there but they use <​code>​ cd $$xyz; </​code>​ Notice the semi-colon. This will not work. You will get errors telling you the path is incorrect, etc.
softwaredevtips.1550080417.txt.gz · Last modified: 2019/02/13 17:53 by dtscbs