An historic Greenock building which has been part of the town for more than 100 years is to be transformed into an outdoor activities base and community hub.