From c2833b1a009bc7c382b30d94109b9b7a25a404a6 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 23 Feb 2017 16:42:37 +0100 Subject: Introduce module providers If a dependency is not found, we now search for a matching module provider that can generate one for us. We also provide a generic fall-back provider which uses pkg-config to locate the dependency (but could be extended to incorporate other methods in the future). This is the most important part of this change for practical purposes, as it makes hundreds of popular libraries available for use in qbs projects without users having to write any boilerplate code. In a future patch, a module provider could also be used to implement the functionality of the qtprofilesetup library, relieving users of the need to create a profile for building Qt applications. [ChangeLog] The Depends item now falls back to pkg-config to locate dependencies whose names do not correspond to a qbs module. Fixes: QBS-1107 Change-Id: Ifd4f05c237cf58cd9fe707c3da648d3dbb33e82b Reviewed-by: Leena Miettinen Reviewed-by: Joerg Bornemann --- doc/howtos.qdoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/howtos.qdoc') diff --git a/doc/howtos.qdoc b/doc/howtos.qdoc index 7ef1fc086..a2595cffd 100644 --- a/doc/howtos.qdoc +++ b/doc/howtos.qdoc @@ -41,6 +41,7 @@ \li \l{How do I make sure my generated sources are getting compiled?} \li \l{How do I run my autotests?} \li \l{How do I create a module for a third-party library?} + \li \l{How do I build against libraries that provide pkg-config files?} \li \l{How do I create application bundles and frameworks on iOS, macOS, tvOS, and watchOS?} \li \l{How do I apply C/C++ preprocessor macros to only a subset of the files in my product?} \li \l{How do I make the state of my Git repository available to my source files?} @@ -315,6 +316,20 @@ static library; see the \l{How do I make my app build against my library?} section for an example. + \section1 How do I build against libraries that provide pkg-config files? + + Just add a \l Depends item that matches the name of the pkg-config module, and \QBS + will automatically employ \l{https://www.freedesktop.org/wiki/Software/pkg-config}{pkg-config} + to find the headers and libraries if no matching \QBS module can be found. For instance, + to build against the OpenSSL library, you would write this: + \code + Depends { name: "openssl" } + \endcode + That's it. The pkg-config behavior can be fine-tuned via the \l pkgconfig module, + but normally you will not need to pull it in explicitly. + + Internally, this functionality is implemented via \l {Module Providers} + \section1 How do I apply C/C++ preprocessor macros to only a subset of the files in my product? Use a \l{Group} item to define a subset of project files. To add -- cgit v1.2.3