How to select QMake TEMPLATE = lib installation directory / folder?

24 Views Asked by At

How to option QtCreator QMake to select where to install TEMPLATE=lib ?

If I use "TEMPLATE=lib" it installs in undesired (Linux) folder.

Asked Mrs Google, she does not know how to select library installation folder.

1

There are 1 best solutions below

0
Karmo On

There are two methods I have used.

  1. Modify the target.path in the PROJECT_NAME.pro file. If you create a library project in Qt Creator then by default the .pro file should have something like:
# Default rules for deployment.
unix {
    target.path = /usr/lib
}
!isEmpty(target.path): INSTALLS += target

You can replace the /usr/lib with any other directory on your system.

  1. Use the INSTALL_ROOT environmental variable the set the "root" to a different directory. For example, if INSTALL_ROOT=/home/user/deploy (and in the .pro file there is still target.path = /usr/lib) then make install will deploy the result to /home/user/deploy/usr/lib.

Note you can set environmental variables in Qt Creator Project mode under the Build Environment settings.