Bug 3191 - Support relative paths with project in subdirectory
Summary: Support relative paths with project in subdirectory
Status: NEW
Alias: None
Product: MPC
Classification: Unclassified
Component: MPC (show other bugs)
Version: unspecified
Hardware: All All
: P3 enhancement
Assignee: Chris Cleeland
URL:
Depends on:
Blocks:
 
Reported: 2008-01-10 05:25 CST by Johnny Willemsen
Modified: 2008-03-31 11:21 CDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johnny Willemsen 2008-01-10 05:25:57 CST
Enhancement need with response of Chad, storing this publicly

> Taking the examples\Log_Msg directory, I now create:
> examples\Log_Msg\Log_Msg_Test_Ostream\.wrproject
>
> And I am now generating the include paths, but I do get:
> <stringAttribute value="-I..\.."/>
>
> This is not ok, it should be ..\..\.. because of the fact that the project
> is now one directory deeper. Any idea how we could solve this nicely?

Hmm... this is a tough one.  The only thing I can think of is for your project
creator to override the 'relative' subroutine.  Something similar to this:

sub relative {
  my($self, $value, $expand_template, $scope) = @_;

  if (defined $value) {
    $value = $self->SUPER::relative($value, $expand_template, $scope);

    ## Add code here to fix the value(s).  $value may or may not be an array
  }

  return $value;
}
Comment 1 Johnny Willemsen 2008-03-31 11:21:24 CDT
Something also found to be caused of this issue

MPC file:
project(*Server) : aceexe {
  exename = server
  recursive_includes += $(ACE_ROOT)/ace
}

combined with -recursive_includes this leads to (independent of forward or backward slashes in ACE_ROOT):

C:\ACE\latest\ACE_wrappers\MPCt>set ACE_ROOT=c:/ACE/latest/ACE_wrappers

C:\ACE\latest\ACE_wrappers\MPCt>perl %ACE_ROOT%\bin\mwc.pl -type wb26 -noreldefs
Using .../latest/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
Generating 'wb26' output using default input
WARNING: Unable to expand ACE_ROOT.
Generation Time: 0s

And in the generated .wrproject I do get:
            <listAttribute key="BLD::Info|Incl|PPC604gnu">
                <stringAttribute value="-I$(WIND_BASE)/target/h"/>
                <stringAttribute value="-I$(WIND_BASE)/target/h/wrn/coreip"/>
                <stringAttribute value="-I$(ACE_ROOT)"/>
                <stringAttribute value="-I$(ACE_ROOT)/ace"/>
            </listAttribute>

See that the recursive_includes is not done, because without -noreldefs I do get:

            <listAttribute key="BLD::Info|Incl|PPC604gnu">
                <stringAttribute value="-I$(WIND_BASE)/target/h"/>
                <stringAttribute value="-I$(WIND_BASE)/target/h/wrn/coreip"/>
                <stringAttribute value="-I.."/>
                <stringAttribute value="-I../ace"/>
                <stringAttribute value="-I../ace/.svn"/>
                <stringAttribute value="-I../ace/.svn/prop-base"/>
                <stringAttribute value="-I../ace/.svn/props"/>
                <stringAttribute value="-I../ace/.svn/text-base"/>
                <stringAttribute value="-I../ace/.svn/tmp"/>
                <stringAttribute value="-I../ace/.svn/tmp/prop-base"/>
                <stringAttribute value="-I../ace/.svn/tmp/props"/>
                <stringAttribute value="-I../ace/.svn/tmp/text-base"/>

And much more lines.