From my own experience using tax return software for capital gain/loss calculation you enter the purchase price and number of share plus the date purchased and sold. You then pay/get credit for 50% of the capital gain/loss based on the Adjusted Cost Base (ACB).
Here's a link that is a good reference tool if you have to work it out manually.
http://www.milliondollarjourney.com/calculating-your-adjusted-cost-base-acb.htm
Wrt. owning shares in multiple accounts this article helps explain that it is the stock you own via buying and selling that counts, not the number of non-registered accounts they come from. You have to calculate the ACB based on all the respective accounts.
http://www.adjustedcostbase.ca/CanadianMoneySaver_Know_Your_ACBs.pdf
Regards
Max