문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top