Custom Build Step not firing [message #222335] |
Tue, 19 August 2008 12:57  |
Eclipse User |
|
|
|
Originally posted by: alan_krzywicki.avid.com
I've setup a custom build step associated with a header file and I never
see the build step run.
I'm building a project with QT and need to use the QT MOC command to
create an associated file. I did actually have this working, then I need
to setup the project again, so I re-imported the exiting project into a
new one.
For the custom build step I have it set to "Apply Custom Build Step .... "
the "Additional Input file name(s)" is blank
the "Output file name(s)" is blank
the command line appears to be setup as necessary, see makefile below
and I have some text in the Description field.
When rebuild the project I never see the text from the Description field,
and the output file is not created. I tried the verbose switch and I
still do not see any custom build step actions. It is as if it is being
completely ignored. The same is true if run the makefile directly.
Here is a copy of the makefile, the custom build step is at the bottom.
(Eclipse platform 3.4, C++ CDT 5.0)
# Add inputs and outputs from these tool invocations to the build
variables
CPP_SRCS += \
../TestQT.cpp \
../main.cpp
OBJS += \
/TestQT.o \
/main.o
CPP_DEPS += \
/TestQT.d \
/main.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -D__APPLE__ -I/usr/local/Trolltech/Qt-4.4.1/include -O0 -g3 -Wall -c
-fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
: ../TestQT.h ../${ProjDirPath}/TestQT.h
@echo 'Building file: $<'
@echo 'Create MOC file from TestQt.h'
/usr/local/Trolltech/Qt-4.4.1/bin/moc
/Users/krzy/Projects/Learning/Eclipse1/TestQT.h -o
/Users/krzy/Projects/Learning/Eclipse1/Qt_moc_files/TestQT_m oc.cpp
@echo 'Finished building: $<'
@echo ' '
|
|
|
|
Re: Custom Build Step not firing [message #222422 is a reply to message #222335] |
Thu, 21 August 2008 13:33  |
Eclipse User |
|
|
|
Originally posted by: alan_krzywicki.avid.com
... and my solution is ...
1st .. you need to have an output specified, Fill in the "Output file
name(s)" I was hoping to get away without this, but in reality it would
case the build to recreate the moc file each time. Without it is just
never seems to fire the custom build step.
2nd .. the .cpp moc file needs to be in the same directory as the header.
Eclipse seems to choke if the output moc file is in a subdirectory. The
make files don't get created correctly.
3rd ... (and I don't know if this is 100% necessary) I excluded the
created moc file from the project. but eclipse still builds it. (oh the
irony) I exclude it just to keep track of what is actually include for
source code control.
|
|
|
Powered by
FUDForum. Page generated in 0.03358 seconds