Frage

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 root
  • C:\myproject\wscript: Waf build script
  • C:\myproject\source: Source code
  • C:\myproject\project\eclipse: Eclipse Workspace
  • C:\myproject\project\eclipse\myproject: Eclipse Project

Waf 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?

War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top