My very simple X.pro
file looks like this:
TEMPLATE = lib
CONFIG += c++14 warn_on
HEADERS += x.hpp
target_headers.path = $$[QT_SYSROOT]/usr/include/
target_headers.files = x.hpp
INSTALLS += target_headers
target_libs.path = $$[QT_SYSROOT]/usr/lib/
target_libs.files = libX.so \
libX.so.1 \
libX.so.1.0 \
libX.so.1.0.0
target_libs.CONFIG += no_check_exist
INSTALLS += target_libs
The header file x.hpp
can be left empty.
So, when I do
qmake
make
make install
the header gets installed in /usr/include/
, library in /usr/lib/
.
This works fine when I use 32-bit compiler, since the libraries are supposed to be installed in /usr/lib/
, but it is not fine when I use the 64-bit compiler, because the library should go to /usr/lib64/
.
So, how do change the pro file, to configure where my library goes? Is there a way to detect whether a build is using 32bit or 64bit compiler?
Also, this is going to create 4 copies of the library, and not copy the links. How to fix that?