big_gie
big_gie

Reputation: 3009

Installing files using qmake: how to get the executable too?

I'm building my app with qmake.

my project.pro file looks something like:

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += [all source files]
HEADERS += [all headers]

After a build, I want "make install" to copy everything required in a subfolder, so I added the following:

package.path = $${OUT_PWD}/package
package.files += myapp.exe myapp.ini [other dlls]
package.CONFIG = no_check_exist
INSTALLS += package

I cannot have in any way my compiled binary to be copied alongside; I prefixed it with $$OBJECTS_DIR/ and others, but I can't find the right variable containing the path to the build directory!

It seems these variables are meant as a way to change qmake's behaviour, for example to change the build directory. I don't want to change it; I want to access it!

Is there any other variable I could use? Basically, I want to put in "package.files" the full path to the compiled executable binary.

Thanks!

Upvotes: 4

Views: 2455

Answers (1)

jwernerny
jwernerny

Reputation: 7048

qmake puts the complied executable (or library) in the location pointed to by DESTDIR. Usually, when I want to put the binary and support files, I will set DESTDIR to the location I want to install stuff, then set any INSTALLS.path to DESTDIR.

DESTDIR = $${OUT_PWD}/package

package.path = $${DESTDIR}
package.files += myapp.exe myapp.ini [other dlls]
package.CONFIG = no_check_exist
INSTALLS += package

Upvotes: 1

Related Questions