Working with a single codebase for Windows and Linux [message #192806] |
Thu, 07 June 2007 03:53  |
Eclipse User |
|
|
|
Originally posted by: objectivedynamics.homail.com
I'm currently working on a project which will target both Linux and Windows.
For a number of reasons, We're using Eclipse/CDT for the linux builds and
Microsoft Visual Studio for the Windows builds.
Now, ideally, I'd like to keep the sources separate from build files,
project files etc so in the following tree structure, the Eclipse workspace
would only contain project settings, make files etc. Similarly the Visual
Studio workspace would only hold .sln and .vcproj files.
Finally, all source would be below the inc and source folders.
root
|
|----Eclipse workspace
|
|----Visual Studio workspaces
|
|----inc
|
|----src
No, MSVC has no problem at all working with this kind of structure - it will
let me reference source files anywhere on my file system.
However, I can't seem to find a way of having Eclipse/CDT let me do the same
thing. Or at least, not a way that I find acceptable.
The nearest thing I've found is to set up *links* from within the Eclipse
workspace to the files in inc and src. The problem with this is that when I
create a link within Eclipse, it seems to use an absolute path to link to
the source file e.g.
c:\somplace\someproject\src\foo.cpp
This creates havoc when the project is located on a different drive. Has
anyone got any suggestions as to how this can be achieved?
TIA,
MikeB
|
|
|
Re: Working with a single codebase for Windows and Linux [message #192830 is a reply to message #192806] |
Thu, 07 June 2007 06:48   |
Eclipse User |
|
|
|
Originally posted by: claudius.link.gmail.com
I am not sure if this is what you meant by "links" from within Eclipse.
In the Project properties (at least in CDT 4.0.0 RC2)
C/C++ General -> Paths and Symbols -> Source location
choosing "Create / link folder" looks like it should do
what you want.
But there seems to be a bug. The "Variables.." button shows
no variables and you can't use them either (I tried ${workspace_loc})
In the "Library paths" tab it is possible to use variables.
MikeB wrote:
> I'm currently working on a project which will target both Linux and Windows.
> For a number of reasons, We're using Eclipse/CDT for the linux builds and
> Microsoft Visual Studio for the Windows builds.
>
> Now, ideally, I'd like to keep the sources separate from build files,
> project files etc so in the following tree structure, the Eclipse workspace
> would only contain project settings, make files etc. Similarly the Visual
> Studio workspace would only hold .sln and .vcproj files.
> Finally, all source would be below the inc and source folders.
>
> root
> |
> |----Eclipse workspace
> |
> |----Visual Studio workspaces
> |
> |----inc
> |
> |----src
>
> No, MSVC has no problem at all working with this kind of structure - it will
> let me reference source files anywhere on my file system.
>
> However, I can't seem to find a way of having Eclipse/CDT let me do the same
> thing. Or at least, not a way that I find acceptable.
> The nearest thing I've found is to set up *links* from within the Eclipse
> workspace to the files in inc and src. The problem with this is that when I
> create a link within Eclipse, it seems to use an absolute path to link to
> the source file e.g.
> c:\somplace\someproject\src\foo.cpp
>
> This creates havoc when the project is located on a different drive. Has
> anyone got any suggestions as to how this can be achieved?
>
> TIA,
> MikeB
>
>
|
|
|
|
Re: Working with a single codebase for Windows and Linux [message #193074 is a reply to message #192830] |
Tue, 12 June 2007 05:07  |
Eclipse User |
|
|
|
Originally posted by: objectivedynamics.homail.com
"Claudius Link" <claudius.link@gmail.com> wrote in message
news:4667E291.1030007@gmail.com...
> In the Project properties (at least in CDT 4.0.0 RC2)
> C/C++ General -> Paths and Symbols -> Source location
> choosing "Create / link folder" looks like it should do
> what you want.
> But there seems to be a bug. The "Variables.." button shows
> no variables and you can't use them either (I tried ${workspace_loc})
I think I misunderstood your reply to me. I downloaded CDT 4.0.0 RC3 and
looked into your suggestions. You were right - it *does* do just what I
want - I'm not too bothered about the possible bug in its support for
variables.
Rgds,
MikeB
|
|
|
Powered by
FUDForum. Page generated in 0.02870 seconds