PDA

View Full Version : qmake corba CustomBuildTool



mcarter
17th October 2011, 19:36
Qt 4.7.2

I have been using a makefile to build my qt code with some of our corba code. To help with building across multiple platforms, I decided to convert to using qmake. I was able to create a .pro file for my code and a corba.pri (inserted below) file for the corba related qmake functionality.


# corba work
# global defaults
isEmpty(CORBA_DIR):CORBA_DIR = .

# a slight issue with multi-core building that hopefully can be resolved
# by specifying just the Client code in the pre-target dependencies so both
# Client and Server code are generated first
for(idl, CORBA_IDLS):PRE_TARGETDEPS += $$CORBA_DIR/$$replace( idl, ".idl", "C.cpp" )

# setup idl compiler
IDL_COMPILER = "$$(ACE_ROOT)/bin/tao_idl"

# setup idl compiler flags
IDL_FLAGS += -I$$(TAO_ROOT)/include
for(i,IDL_DIR):IDL_FLAGS += $$join(i,,-I,)
# allow IDL_FLAGS to be used in Makefile for additional idl options
IDL_FLAGS += $(IDL_FLAGS)

# setup include path (and vpath)
INCLUDEPATH += $$(ACE_ROOT) $$(ACE_ROOT)/include
INCLUDEPATH += $$(TAO_ROOT) $$(TAO_ROOT)/orbsvcs
INCLUDEPATH += $$IDL_DIR $$CORBA_DIR
VPATH += $$IDL_DIR

# setup libraries . . . order makes a difference
LIBS += -L$$(ACE_ROOT)/lib -L$$(TAO_ROOT)/lib
LIBS += -lTAO_CosNaming -lTAO_Messaging -lTAO_Valuetype
LIBS += -lTAO_CodecFactory -lTAO_PI -lTAO_AnyTypeCode
LIBS += -lTAO_PortableServer
LIBS += -lTAO -lACE

# since qmake cannot have multiple outputs need Client and Server versions
# Client
corbaC.CONFIG = no_link
corbaC.dependency_type = TYPE_C
corbaC.commands = $$IDL_COMPILER -o $$CORBA_DIR $$IDL_FLAGS ${QMAKE_FILE_NAME}
corbaC.input = CORBA_IDLS
corbaC.output = $$CORBA_DIR/${QMAKE_FILE_BASE}C.cpp
corbaC.clean = $$CORBA_DIR/${QMAKE_FILE_BASE}C.cpp \
$$CORBA_DIR/${QMAKE_FILE_BASE}C.h \
$$CORBA_DIR/${QMAKE_FILE_BASE}C.inl
corbaC.variable_out = SOURCES
silent:corbaC.commands = @echo $$IDL_COMPILER ${QMAKE_FILE_IN} && $$corbaC.commands
QMAKE_EXTRA_COMPILERS += corbaC
# Server
corbaS.CONFIG = no_link
corbaS.dependency_type = TYPE_C
corbaS.commands = $$IDL_COMPILER -o $$CORBA_DIR $$IDL_FLAGS ${QMAKE_FILE_NAME}
corbaS.input = CORBA_IDLS
corbaS.output = $$CORBA_DIR/${QMAKE_FILE_BASE}S.cpp
corbaS.clean = $$CORBA_DIR/${QMAKE_FILE_BASE}S.cpp \
$$CORBA_DIR/${QMAKE_FILE_BASE}S.h \
$$CORBA_DIR/${QMAKE_FILE_BASE}S.inl
corbaS.variable_out = SOURCES
silent:corbaS.commands = @echo $$IDL_COMPILER ${QMAKE_FILE_IN} && $$corbaS.commands
QMAKE_EXTRA_COMPILERS += corbaS

The corba generation and build process works fine under Linux and Mac. I am having an issue in Windows. I am using the Qt add-in v1.1.9 for VS2008 to generate the project data from the .pro file. What seems to be happening is that the corba commands are being used to generated the .cpp and related files . . . and thats it. "Compiling" the corba files just creates the cpp/h source from idl files. The corba files, along with the moc files, are listed in the 'Generated Files' tree. Looking at the generated .vcproj file, I do not see a CustomBuildTool section for the corba files. I see that the MOC has the necessary foo to build and compile the moc_ files. Does the add-in allow QMAKE_EXTRA_COMPILERS to generate CustomBuildTool configurations?