From a713d402df1e81767f07807142937268618f06fe Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 24 Jun 2021 09:35:15 +0200 Subject: [PATCH] support for PREFIX added to qskconfig.pri --- ...03-writing-your-first-application.asciidoc | 12 +++++++----- features/qskconfig.pri | 19 +++++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/tutorials/03-writing-your-first-application.asciidoc b/doc/tutorials/03-writing-your-first-application.asciidoc index 74ef69d8..86a880c7 100644 --- a/doc/tutorials/03-writing-your-first-application.asciidoc +++ b/doc/tutorials/03-writing-your-first-application.asciidoc @@ -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] diff --git a/features/qskconfig.pri b/features/qskconfig.pri index 141c64f8..bb79ee5f 100644 --- a/features/qskconfig.pri +++ b/features/qskconfig.pri @@ -8,14 +8,21 @@ QSK_VER_MIN = 0 QSK_VER_PAT = 0 QSK_VERSION = $${QSK_VER_MAJ}.$${QSK_VER_MIN}.$${QSK_VER_PAT} -QSK_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] +# trying the PREFIX environment variable first -unix { - QSK_INSTALL_PREFIX = /usr/local/qskinny-$${QSK_VERSION} -} +QSK_INSTALL_PREFIX = $$(PREFIX) -win32 { - QSK_INSTALL_PREFIX = C:/Qskinny-$${QSK_VERSION} +isEmpty( QSK_INSTALL_PREFIX ) { + + QSK_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] + + unix { + QSK_INSTALL_PREFIX = /usr/local/qskinny-$${QSK_VERSION} + } + + win32 { + QSK_INSTALL_PREFIX = C:/Qskinny-$${QSK_VERSION} + } } QSK_INSTALL_DOCS = $${QSK_INSTALL_PREFIX}/doc