the usual commands for compiling are
qmake -project
qmake name.pro
qmake
make
I need to enable after giving 'make' a 'make install' command so to do some actions.
Is it possible, and if yes, how do I enable it?:confused:
Printable View
the usual commands for compiling are
qmake -project
qmake name.pro
qmake
make
I need to enable after giving 'make' a 'make install' command so to do some actions.
Is it possible, and if yes, how do I enable it?:confused:
See the INSTALLS variable of a pro file.
I opened a pro file and it contained only
TEMPLATE
TARGET
DEPENDPATH
INCLUDEPATH
HEADERS
FORMS
SOURCES
RESOURCES
:(
actually, I found this that helped me a bit:
http://doc.qt.nokia.com/4.3/qmake-en....html#installs
and i put this into the Makefile(which is real, generated from real program and containing a lot of raws)I've placed a file to from/ and I want it to be copied to to/Code:
: documentation.path = to/ documentation.files = from/* INSTALLS += documentation ... ... ####### Install install: $(INSTALLS) uninstall: FORCE FORCE:
but when I give make install it says make: *** No rule to make target `documentation', needed by `install'. Stop.
What do I do wrong?
It doesn't work this way. documentation.files should point to a variable containing a list of files to copy (you can use wildcards). The files in question have to exist (at least by default) when qmake is called.
Can you make me a simple example of moving all files from 'from' to 'to' so to understand better? :eek:
Code:
FILESTOCOPY = from/* documentation.path = to documentation.from = FILESTOCOPY INSTALLS += documentation
Disclaimer: not tested...
Thank you, but still same error :/
Here is a working example:
Code:
FILESTOCOPY = f1 f2 f3 INSTRULE.path = /tmp INSTRULE.files = $$FILESTOCOPY INSTALLS += INSTRULE
That's the created Makefile (using your last answer):
output of make install:Code:
############################################################################# # Makefile for building: some-1 # Generated by qmake (2.01a) (Qt 4.7.0) on: Sat Oct 30 23:31:32 2010 # Project: some-1.0.pro # Template: app # Command: /usr/bin/qmake -o Makefile some-1.0.pro ############################################################################# ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. LINK = g++ LFLAGS = -Wl,-O1 LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread AR = ar cqs RANLIB = QMAKE = /usr/bin/qmake TAR = tar -cf COMPRESS = gzip -9f COPY = cp -f SED = sed COPY_FILE = $(COPY) COPY_DIR = $(COPY) -r STRIP = strip INSTALL_FILE = install -m 644 -p INSTALL_DIR = $(COPY_DIR) INSTALL_PROGRAM = install -m 755 -p DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p FILESTOCOPY = from/* INSTRULE.path = to/ INSTRULE.files = $$FILESTOCOPY INSTALLS += INSTRULE ... ... ... install: $(INSTALLS) uninstall: FORCE FORCE:
Code:
make: *** No rule to make target `INSTRULE', needed by `install'. Stop.
This works for me:
Code:
installfiles.files += a.a installfiles.files += b.b installfiles.files += c.c installfiles.path = /path/to/install/folder INSTALLS += installfiles
Where a.a, b.b, c.c are your files, whatever they are called.
Clean the build dir
Rerun qmake
rerun make
then do: make install
Thanks for your answer,
If I add what you told me without adding install: $(INSTALLS)
it outputs make: Nothing to be done for `install'.
If I add what you told me and I add install: $(INSTALLS)
it outputs make: *** No rule to make target `installfiles', needed by `install'. Stop.
Am I missing something?:confused:
You have to put those rules in the .pro file, not in the resulting Makefile.
I though it had to do with the makefile. Cool. Now it works :) You are very helpful :)