[QUOTE=camel;30002]You can build that using extra targets, i.e. you should be able to embedd it directly into the project2.pro...could look something like this:
makeproject.target = WHATEVER_THAT_MAKEFILE_PRODUCES
makeproject.commands = make NAME_OF_MAKEFILE
makeproject.depends = WHICH_FILES_THE_TARGET_DEPENDS_ON
QMAKE_EXTRA_TARGETS += makeproject
PRE_TARGETDEPS += makeproject
makeproject.target = WHATEVER_THAT_MAKEFILE_PRODUCES
makeproject.commands = make NAME_OF_MAKEFILE
makeproject.depends = WHICH_FILES_THE_TARGET_DEPENDS_ON
QMAKE_EXTRA_TARGETS += makeproject
PRE_TARGETDEPS += makeproject
To copy to clipboard, switch view to plain text mode
I tried something like this but there is some problem.
First the path where my project is present
raj
|
|
cmb
|
|-->source //This is a directory
|
|-->cryp //This is another directory
|
|-->cmb.pro //This is what I'll give to command prompt
so the path on my system is /raj/cmb/. Inside cmb directory there is source, cryp directory and a project file cmb.pro
Now I have put this information to cmb.pro
TEMPLATE = subdirs
SUBDIRS = \
cryp \
source
# install
sources.path = source/
INSTALLS += sources
TEMPLATE = subdirs
SUBDIRS = \
cryp \
source
# install
sources.path = source/
INSTALLS += sources
To copy to clipboard, switch view to plain text mode
Inside source directory there is a source.pro which contains
TEMPLATE = app
LANGUAGE = C++
CONFIG += qt warn_on debug
unix:LIBS += -lXext -lm
unix:LIBS += ../cryp/libcryp.a
DEFINES += SYNSUP_GUI
INCLUDEPATH += . ./common
INCLUDEPATH += ../cryp
HEADERS += atomgroup.h \
SOURCES += atomgroup.cpp \
FORMS = dlg/SynsupOptionsDlgData.ui \
win32:TMAKE_CFLAGS = -TP
win32:TMAKE_CXXFLAGS = -GX
win32:RC_FILE = chemedit.rc
CONFIG += non_threaded
TARGET = cmbedit
# install
target.path = ../source
sources.files = $$SOURCES $$HEADERS source.pro
sources.path = ../source
INSTALLS += target sources
TEMPLATE = app
LANGUAGE = C++
CONFIG += qt warn_on debug
unix:LIBS += -lXext -lm
unix:LIBS += ../cryp/libcryp.a
DEFINES += SYNSUP_GUI
INCLUDEPATH += . ./common
INCLUDEPATH += ../cryp
HEADERS += atomgroup.h \
SOURCES += atomgroup.cpp \
FORMS = dlg/SynsupOptionsDlgData.ui \
win32:TMAKE_CFLAGS = -TP
win32:TMAKE_CXXFLAGS = -GX
win32:RC_FILE = chemedit.rc
CONFIG += non_threaded
TARGET = cmbedit
# install
target.path = ../source
sources.files = $$SOURCES $$HEADERS source.pro
sources.path = ../source
INSTALLS += target sources
To copy to clipboard, switch view to plain text mode
Inside cryp directory there is a cryp.pro which contains.
makeproject.target = libcryp.a
makeproject.commands = make GNUmakefile
makeproject.depends = ../source/cmbedit
QMAKE_EXTRA_TARGETS += makeproject
PRE_TARGETDEPS += makeproject
makeproject.target = libcryp.a
makeproject.commands = make GNUmakefile
makeproject.depends = ../source/cmbedit
QMAKE_EXTRA_TARGETS += makeproject
PRE_TARGETDEPS += makeproject
To copy to clipboard, switch view to plain text mode
Some explanation
libcryp.a is static library which is created from GNUMakefile.
GNUmakefile is the name of the makefile inside cryp directory.
../source/cmbedit--->here cmbedit is the name of the executable which is
produced after linking with libcryp.a.
source is a directory.
I get this error
[raj@fedora4 cmb]# qmake cmb.pro
[raj@fedora4 cmb]# make
cd cryp && make -f Makefile
make[1]: Entering directory
`raj/cmb/cryp'
make[1]: *** No rule to make target `makeproject', needed by `cryp'. Stop.
make[1]: Leaving directory
`raj/cmb/cryp'
make: *** [sub-cryp] Error 2
[raj@fedora4 cmb]#
Bookmarks