diff options
author | Matt Fischer <matt.fischer@garmin.com> | 2013-04-08 17:07:13 -0500 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-10 19:39:53 +0200 |
commit | d37dc75116aeb55971ab44c84e8f10ed18b8a5aa (patch) | |
tree | 33d1f5a1374e5e15201be2009b21f6b528e022d9 | |
parent | cd2a51a66f52767c20e80361033c573651b3a08d (diff) |
Improve support for <MODULE>_PATH options
Several modules, including DBus, MySQL, and OpenSSL have
configure options of the form <MODULE>_PATH, which is used
on Windows (where pkg-config is not present) to specify the
locations of third-party libraries. These switches had been
implemented by adding extra variables which were referenced
in .pro files, to add the appropriate compiler and linker
switches. This is undesirable because it means there are
two independent paths for adding the switches to the build,
which can get out of sync with each other, and indeed this
had happened for some of the DBus tools.
To remedy the situation, all three of the switches were
reworked so that they added values directly to the principal
variables that are used in the project files. This reduces
maintenance, by ensuring that the pkg-config and non-pkg-config
paths appear the same to the rest of the build system.
Change-Id: Iae342f1d14b79fbcfef9fe38aadc803ad3141799
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r-- | src/dbus/dbus.pro | 4 | ||||
-rw-r--r-- | src/network/ssl/ssl.pri | 6 | ||||
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.pri | 9 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 24 |
4 files changed, 19 insertions, 24 deletions
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 2e4119ba93..c5afe8c4d2 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -3,9 +3,7 @@ QT = core-private CONFIG += link_pkgconfig MODULE_CONFIG = dbusadaptors dbusinterfaces -!isEmpty(DBUS_PATH) { - INCLUDEPATH += $$DBUS_PATH/include - QMAKE_LIBDIR += $$DBUS_PATH/lib +!contains(QT_LIBS_DBUS, .*dbus-1.*) { win32:CONFIG(debug, debug|release):QT_LIBS_DBUS += -ldbus-1d else:QT_LIBS_DBUS += -ldbus-1 } diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index f5afb43759..1d8c8e1ab7 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -41,11 +41,7 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { LIBS_PRIVATE += $$OPENSSL_LIBS_RELEASE } + QMAKE_CXXFLAGS += $$OPENSSL_CFLAGS LIBS_PRIVATE += $$OPENSSL_LIBS windows:LIBS += -lcrypt32 - - !isEmpty(OPENSSL_PATH) { - INCLUDEPATH += $$OPENSSL_PATH/include - QMAKE_LIBDIR += $$OPENSSL_PATH/lib - } } diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri index 50f49ca548..3cfb6144a1 100644 --- a/src/sql/drivers/mysql/qsql_mysql.pri +++ b/src/sql/drivers/mysql/qsql_mysql.pri @@ -1,10 +1,8 @@ HEADERS += $$PWD/qsql_mysql_p.h SOURCES += $$PWD/qsql_mysql.cpp -!isEmpty(MYSQL_PATH) { - INCLUDEPATH += $$MYSQL_PATH/include - QMAKE_LIBDIR += $$MYSQL_PATH/lib -} +QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL +LIBS += $$QT_LFLAGS_MYSQL unix { isEmpty(QT_LFLAGS_MYSQL) { @@ -12,9 +10,6 @@ unix { use_libmysqlclient_r:LIBS += -lmysqlclient_r else:LIBS += -lmysqlclient } - } else { - LIBS += $$QT_LFLAGS_MYSQL - QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL } } else { !contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS += -llibmysql diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index fb8f8b8b71..fa8456e447 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -988,7 +988,7 @@ void Configure::parseCmdLine() } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_RELEASE=")) { opensslLibsRelease = configCmdLine.at(i); } else if (configCmdLine.at(i).startsWith("OPENSSL_PATH=")) { - opensslPath = QDir::fromNativeSeparators(configCmdLine.at(i)); + opensslPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1)); } else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) { psqlLibs = configCmdLine.at(i); } else if (configCmdLine.at(i).startsWith("SYBASE=")) { @@ -996,9 +996,9 @@ void Configure::parseCmdLine() } else if (configCmdLine.at(i).startsWith("SYBASE_LIBS=")) { sybaseLibs = configCmdLine.at(i); } else if (configCmdLine.at(i).startsWith("DBUS_PATH=")) { - dbusPath = QDir::fromNativeSeparators(configCmdLine.at(i)); + dbusPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1)); } else if (configCmdLine.at(i).startsWith("MYSQL_PATH=")) { - mysqlPath = QDir::fromNativeSeparators(configCmdLine.at(i)); + mysqlPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1)); } else if (configCmdLine.at(i).startsWith("ZLIB_LIBS=")) { zlibLibs = QDir::fromNativeSeparators(configCmdLine.at(i)); } @@ -2811,13 +2811,19 @@ void Configure::generateOutputVars() } else if (opensslLibs.isEmpty()) { qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); } - if (!opensslPath.isEmpty()) - qmakeVars += opensslPath; + if (!opensslPath.isEmpty()) { + qmakeVars += QString("OPENSSL_CFLAGS += -I%1/include").arg(opensslPath); + qmakeVars += QString("OPENSSL_LIBS += -L%1/lib").arg(opensslPath); + } + } + if (dictionary[ "DBUS" ] != "no" && !dbusPath.isEmpty()) { + qmakeVars += QString("QT_CFLAGS_DBUS = -I%1/include").arg(dbusPath); + qmakeVars += QString("QT_LIBS_DBUS = -L%1/lib").arg(dbusPath); + } + if (dictionary[ "SQL_MYSQL" ] != "no" && !mysqlPath.isEmpty()) { + qmakeVars += QString("QT_CFLAGS_MYSQL = -I%1/include").arg(mysqlPath); + qmakeVars += QString("QT_LFLAGS_MYSQL = -L%1/lib").arg(mysqlPath); } - if (dictionary[ "DBUS" ] != "no" && !dbusPath.isEmpty()) - qmakeVars += dbusPath; - if (dictionary[ "SQL_MYSQL" ] != "no" && !mysqlPath.isEmpty()) - qmakeVars += mysqlPath; if (!psqlLibs.isEmpty()) qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1); if (!zlibLibs.isEmpty()) |