diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-08-12 19:04:42 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-08-19 04:26:26 +0000 |
commit | 15bf5ef8b8e4299b14626690c359baa14819cd35 (patch) | |
tree | d274f2e3a7d246ec912aad2daecb98d79305cf29 /mkspecs | |
parent | 36ca32dbb92cf8782f78caddad554aca698b786c (diff) |
Add method to encapsulate dependencies to external libraries
Adding an entry that represents an external library to the
QT_USE[_PRIVATE] variable will cause qmake to lookup the
required compiler/linker flags from the configuration system,
and add them to the module that is being compiled.
Change-Id: I309aa2749ddf4fab13ab8fdd26e8ab2123719ea8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/default_post.prf | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index e7e9a5bd87..edc3cac7ba 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -116,6 +116,29 @@ c++11|c++14|c++1z { unset(cxxstd) } +suffix = +for(ever) { + QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix}) + for(name, QMAKE_USE$${suffix}) { + nu = $$upper($$name) + CONFIG(debug, debug|release): \ + libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG) + else: \ + libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE) + libs += $$eval(QMAKE_LIBS_$$nu) + cflags = $$eval(QMAKE_CFLAGS_$${nu}) + + isEmpty(libs):isEmpty(cflags): \ + error("Library '$$name' is not defined.") + + LIBS$${suffix} += $$libs + QMAKE_CFLAGS += $$cflags + QMAKE_CXXFLAGS += $$cflags + } + !isEmpty(suffix): break() + suffix = "_PRIVATE" +} + !precompile_header: SOURCES += $$NO_PCH_SOURCES QMAKE_INCDIR += $$QMAKE_INCDIR_POST |