Silverfrost Forums

Welcome to our forums

Using build macros in .ftn95p projects

23 Jul 2014 3:01 #14353

Hi,

I have FTN95 projects which reference the outputs of other projects during linking. When I add a reference in the solution explorer under the project, the hard coded path is put in the .ftn95p, like this;

'References'
{
    'D:\\\\Code\\\\Developer Sandbox\\\\SATURN\\\\GLib\\\\Debug\\\\Win32\\\\GLib.lib'
    {
    'CopyLocal' = 'T'
    'ProjectRef' = '{00BD355F-B7A3-4F88-AEDA-9699F2F5550A}|GLib\\\\GLib.ftn95p'
    'IsProject' = 'T'
    'IsSTDCALL' = ''
    'ExcludeFromBuild' = ''
    'ReferenceName' = 'D:\\\\Code\\\\Developer Sandbox\\\\SATURN\\\\GLib\\\\Debug\\\\Win32\\\\GLib.lib'
    'ReferencePath' = 'D:\\\\Code\\\\Developer Sandbox\\\\SATURN\\\\GLib\\\\Debug\\\\Win32\\\\GLib.lib'
    }

However, this is not maintainable as this code is checked into source control. Other developers do not necessary have the same workspace mappings as I do. Also, the exact path changes depending on the build (i.e. debug or release). In C# (.csproj) projects, you would use build macros as described here: http://msdn.microsoft.com/en-us/library/c02as0cs.aspx. Unfortunately the following does not work;

'References'
{
    '$(SolutionDir)GLib\\\\$(Configuration)\\\\$(Platform)\\\\GLib.lib'
    {
    'CopyLocal' = 'T'
    'ProjectRef' = '{AA0B4B19-90CE-4BA3-A271-77402EF8EAEA}|GLib\\\\GLib.ftn95p'
    'IsProject' = 'T'
    'IsSTDCALL' = ''
    'ExcludeFromBuild' = ''
    'ReferenceName' = '$(SolutionDir)GLib\\\\$(Configuration)\\\\$(Platform)\\\\GLib.lib'
    'ReferencePath' = '$(SolutionDir)GLib\\\\$(Configuration)\\\\$(Platform)\\\\GLib.lib'
    }

How would I generalise this so that hard coded paths are not used?

26 Jul 2014 11:31 #14369

If you are using Plato then there is an option to 'Use relative path for project files'. See Tools menu under Options->Environment->General.

Please login to reply.