support for PREFIX added to qskconfig.pri

This commit is contained in:
Uwe Rathmann 2021-06-24 09:35:15 +02:00
parent 9cd20ff160
commit a713d402df
2 changed files with 20 additions and 11 deletions

View File

@ -10,19 +10,22 @@ layout: docs
=== Building the QSkinny repository
In this chapter we will write a simple QSkinny application on Linux from scratch. As a prerequisite, a recent Qt version (>= 5.6) should be available and the directory of its `qmake` binary in the current `$PATH`. The we can build the QSkinny repository with the following commands:
In this chapter we will write a simple QSkinny application on Linux from scratch.
As a prerequisite, a recent Qt version (>= 5.6) should be available and the directory of
its `qmake` binary in the current `$PATH`.
Then we can build and install QSkinny to `/opt/qskinny` with the following commands:
[source,xml]
....
cd /home/user/dev/
git clone https://github.com/uwerat/qskinny.git
cd qskinny
qmake
PREFIX=/opt/qskinny qmake
make
sudo make install
....
This will produce the libraries `libqskinny.so` and others in the `qskinny/lib` directory. Optionally we could install the libraries to `/usr/local` via `make install`; for now we will use the ones from the local build at `/home/user/dev/qskinny/lib`. If you checked out the repository in another directory, you will have to adapt the include and library paths used below.
=== Compiling our first app
As a next step, we need to write our app. Let's start with a simple `main.cpp` file in a directory `myapp`:
@ -46,7 +49,6 @@ int main( int argc, char* argv[] )
For now this will just create an empty window (the `QskWindow`) without any controls.
Next, we need to create a `myapp.pro` file in our `myapp` directory.
Assuming, that qskinny had been installed to "/opt/qskinny":
.myapp.pro
[source,xml]

View File

@ -8,6 +8,12 @@ QSK_VER_MIN = 0
QSK_VER_PAT = 0
QSK_VERSION = $${QSK_VER_MAJ}.$${QSK_VER_MIN}.$${QSK_VER_PAT}
# trying the PREFIX environment variable first
QSK_INSTALL_PREFIX = $$(PREFIX)
isEmpty( QSK_INSTALL_PREFIX ) {
QSK_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX]
unix {
@ -17,6 +23,7 @@ unix {
win32 {
QSK_INSTALL_PREFIX = C:/Qskinny-$${QSK_VERSION}
}
}
QSK_INSTALL_DOCS = $${QSK_INSTALL_PREFIX}/doc
QSK_INSTALL_HEADERS = $${QSK_INSTALL_PREFIX}/include