I wrote a wrapper script that sets the proper working directory.
C:\myproject\project\eclipse\waf.cmd@ECHO OFF
CD ..\..\..
python waf %*
In Eclipse I set Build command to ${WorkspaceDirPath}/waf.cmd
.
Domanda
I am trying to set up a C++ project in Eclipse (on Windows) that uses Waf to build. My Eclipse workspace and my source files are in different directories.
C:\myproject
: Project rootC:\myproject\wscript
: Waf build scriptC:\myproject\source
: Source codeC:\myproject\project\eclipse
: Eclipse WorkspaceC:\myproject\project\eclipse\myproject
: Eclipse ProjectWaf must be executed from the directory that contains wscript
.
In my project properties, under C/C++ Build
, my Build command should be python waf
. I created a temporary script at C:\myproject\temp.cmd
just containing pwd
, and set the Build command to ..\..\..\temp.cmd
in order to confirm what the working directory is. The build console shows C:\myproject\project\eclipse\myproject
when I run the build.
How can I change this so that it will show C:\myproject
?
Soluzione
I wrote a wrapper script that sets the proper working directory.
C:\myproject\project\eclipse\waf.cmd@ECHO OFF
CD ..\..\..
python waf %*
In Eclipse I set Build command to ${WorkspaceDirPath}/waf.cmd
.
Altri suggerimenti
In C/C++ Build
you can set Build directory
. Enter C:\myproject
there. The build command must be in your PATH for it to work.