Custom build steps for QT ui and moc file [message #812260] |
Sat, 03 March 2012 13:56 |
Hauke Krüger Messages: 7 Registered: March 2012 |
Junior Member |
|
|
Hi,
I have just turned to Eclipse from Visual Studio. Now, I would want to compile the MS VC source code using Eclipse. Compiling and linking *.cpp and *.h files works pretty good but in the next step I want to use QT and hence UIC and MOC to generate some *cpp/*.h code in a CUSTOM BUILD STEP.
On Visual Studio, I define a custom build step with the following entries (example for UIC):
Description="Uic'ing "$(InputPath)" to produce "$(InputDir)\ui_$(InputName)".h" CommandLine=""$(QT_DIR)"\bin\uic.exe "$(InputPath)" -o "$(InputDir)\ui_$(InputName)".h
Outputs=""$(InputDir)\ui_$(InputName)".h"
In Eclipse, I can import the *.ui file to my project. Then I can right click on the *.ui file to setup the properties for a custom build step as I did in Visual Studio. Finally, I select "Settings->Build Steps" to enter very similar entries in the Eclipse/CDT control window:
Output File Names: $(InputDir)\ui_$(InputName)".h
Command: \usr\bin\uic.exe "$(InputPath)" -o "$(InputDir)\ui_$(InputName)".h
Description: Uic'ing "$(InputPath)" to produce "$(InputDir)\ui_$(InputName)".h
Once finished with this procedure, nothing happens when I try to execute the custom build step. This is how I try to envoke the custom build steps:
Variant a) Right clicking the *.ui file, I can see the "Build Selected File(s)" option but it is inactive and can hence not be clicked (Build Automatically is disabled).
Variant b) Building the complete project: The custom build step is not executed as part of the make process. I would expect at least some hint that anything related to the defined custom build step happens, presumably followed by an error message due to the VS variables such as "InputName", but this is not the case.
So, what is the trick to execute this custom build step? Which build variables such as InputName/InputPath in Visual Studio are defined in Eclipse? What do I have to do to "activate" my custom build steps?
Thanks for any help and best regards,
HK
|
|
|
|
|
|
|
|
|
|
Re: Custom build steps for QT ui and moc file [message #815480 is a reply to message #814614] |
Wed, 07 March 2012 18:19 |
Hauke Krüger Messages: 7 Registered: March 2012 |
Junior Member |
|
|
Hi,
thank you again for your help!
I did as you said (I created another new workspace with a C++ project):
1) Add *.ui to my project
2) Right-click on the *.ui file, "add custom build step", Output filename as you said, command as you said.
3) I managed to create the make target. I was confused to give this make target a name, I used "uifiles"
4) I opened the subdir.mk and found the entry for my ui-file!
5) I finally found the Outline View and did as you said.
6) Afterwards, I also could "make" the new target (hence, everything is good up to here).
7) I get a "NullPointerException".
8 ) I quit Eclipse and restarted Eclipse
9) My workspace is broken, all modifcations have gone.
In the outline view, I also got the Java callstack:
java.lang.NullPointerException
at org.eclipse.cdt.managedbuilder.internal.core.AdditionalInput.needsRebuild(AdditionalInput.java:336)
at org.eclipse.cdt.managedbuilder.internal.core.InputType.needsRebuild(InputType.java:1619)
at org.eclipse.cdt.managedbuilder.internal.core.Tool.needsRebuild(Tool.java:3307)
at org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration.needsRebuild(ResourceConfiguration.java:854)
at org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration.setRebuildState(ResourceConfiguration.java:869)
at org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration.addTool(ResourceConfiguration.java:495)
at org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration.<init>(ResourceConfiguration.java:119)
at org.eclipse.cdt.managedbuilder.internal.core.Configuration.<init>(Configuration.java:419)
at org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider.load(ConfigurationDataProvider.java:366)
at org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider.loadConfiguration(ConfigurationDataProvider.java:541)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.loadData(CProjectDescriptionManager.java:1115)
at org.eclipse.cdt.internal.core.settings.model.CConfigurationDescriptionCache.loadData(CConfigurationDescriptionCache.java:95)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescription.loadDatas(CProjectDescription.java:196)
at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.loadProjectDescription(XmlProjectDescriptionStorage.java:486)
at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.getProjectDescription(XmlProjectDescriptionStorage.java:231)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescriptionInternal(CProjectDescriptionManager.java:416)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:398)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:393)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:386)
at org.eclipse.cdt.make.ui.MakeContentProvider.getSourceEntries(MakeContentProvider.java:400)
at org.eclipse.cdt.make.ui.MakeContentProvider.getChildren(MakeContentProvider.java:103)
at org.eclipse.cdt.make.ui.MakeContentProvider.hasChildren(MakeContentProvider.java:169)
at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2127)
at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer.java:588)
at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2153)
at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2835)
at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:852)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:834)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:808)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:782)
at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:753)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalInitializeTree(AbstractTreeViewer.java:1533)
at org.eclipse.jface.viewers.TreeViewer.internalInitializeTree(TreeViewer.java:833)
at org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractTreeViewer.java:1517)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1443)
at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1404)
at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1510)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)
at org.eclipse.cdt.make.ui.views.MakeView.createPartControl(MakeView.java:144)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActive(WorkbenchPage.java:4317)
at org.eclipse.ui.internal.WorkbenchPage$18.runWithException(WorkbenchPage.java:3359)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
at org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1600)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2609)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Hint for 5) I do not remember the error message but due to 6)-9), I can not reproduce it.
Do you also see the problem with the corrupted workspace? I have tested this on Linux and Windows, in both cases, workspace is corrupt once editing the custom build steps. This seems to be the most problematic issue now..
Best regards
Hauke
[Updated on: Wed, 07 March 2012 18:36] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04026 seconds