What is the best solution to build several CDT C++ projects from the command line? The projects have references and so it is not possible to just build single projects.
相关问题
- Eclipse and Mylyn : how to disable grey files in t
- Installing Pydev for Eclipse throws error
- Error in Scala Compiler: java.lang.AssertionError:
- How to remove unused imports using Eclipse and not
- Assume/switch role in aws toolkit for eclipse 2.0
相关文章
- selenium+eclipse 打开网页时报错
- Eclipse failing to open
- Eclipse how can I indent C++ preprocessor macros
- Why is FindBugs ignoring my check for null?
- Eclipse cleanup - what are the “.index” files - ca
- Compile and build with single command line Java (L
- Eclipse plugin to find out unused methods in a cla
- Spring NamespaceHandler issue when launching Maven
This feature has been added in CDT 6 (Final build due June 15th 2009). You can download the final release candidate from builds page: download.eclipse.org/tools/cdt/builds/6.0.0/.
Using a release of Eclipse 3.5 + CDT 6, you can import, build and clean-build projects and the workspace using the following options sent to Eclipse at the command line:
On Windows, use
eclipsec.exe
instead ofeclipse.exe
to have build output written to stdout/stderr and so that the call blocks until completion.The '-application' switch instructs Eclipse to run the CDT headless builder rather than starting the workbench. The other switches can be used individually or together. This means you can checkout a project using a shell script of your own, '-import' it into a workspace, and '-build' it using the Managedbuilder's headless builder.
Use the '-data' switch to specify the workspace to use, which can be an empty temporary directory, see the runtime documentation for other switches supported by the platform runtime: help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
See bug 186847 comment 24 and onwards for more detail on the committed functionality.
Pre CDT 6 you could use the JDT's AptBuilder (included with classic Eclipse, for example).
This lets you build an already configured workspace. So you: checkout your source, configure a workspace which points to the checked-out projects. Your automated build scripts can then update the checkouts and run the AptBuilder without needing to start the GUI.
Headless build with the manage builder is currently not supported, see bug 186847 - CDT internal builder does not support automated command line builds.
If you use the unmanaged (make) builder, then you already have Makefiles that you can use from the command line.
If you created a Make project under CDT you can just use your favorite shell and execute make in all the projects dirs.
We do this in our existing build.
Put a makefile in all your external references and your toplevel project. In your "all" rule, have it run: make -C ./externalref1 make -C ./externalref2 etc
we actually define the external dependencies in a variable: EXT_DEP = externalref1 externalref2 then use the subst (substitute) command to kick off all the sub-makes using the correct call.