2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
|
|
|
|
2012-08-07 17:00:38 +00:00
|
|
|
!no_qt_module_warning:!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
|
|
|
|
QMAKE_ACTUAL_PRO_FILE = $$basename(_PRO_FILE_)
|
|
|
|
isEmpty(QMAKE_ACTUAL_PRO_FILE): QMAKE_ACTUAL_PRO_FILE=.pro
|
|
|
|
warning("You should probably load(qt_build_config) first in $$QMAKE_ACTUAL_PRO_FILE for $$TARGET, as the latter also load()s qt_module.")
|
|
|
|
message("Not doing so may lead to qt_module.prf overriding compiler/linker options in your .pro file.")
|
|
|
|
message("Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.")
|
|
|
|
unset(QMAKE_ACTUAL_PRO_FILE)
|
|
|
|
}
|
|
|
|
load(qt_build_config) # loads qmodule.pri if hasn't been loaded already
|
|
|
|
|
|
|
|
isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
|
2013-02-26 10:25:52 +00:00
|
|
|
isEmpty(VERSION): VERSION = $$MODULE_VERSION
|
|
|
|
isEmpty(VERSION): error("Module does not define version.")
|
2012-08-07 17:00:38 +00:00
|
|
|
|
|
|
|
# Compile as shared/DLL or static according to the option given to configure
|
2012-10-29 16:25:30 +00:00
|
|
|
# unless overridden. Host builds are always static
|
|
|
|
host_build|staticlib: CONFIG += static
|
2012-08-07 17:00:38 +00:00
|
|
|
|
2013-03-08 20:45:43 +00:00
|
|
|
host_build {
|
|
|
|
QT -= gui # no host module will ever use gui
|
|
|
|
force_bootstrap {
|
|
|
|
!build_pass: CONFIG += release
|
|
|
|
contains(QT, core(-private)?|xml) {
|
|
|
|
QT -= core core-private xml
|
|
|
|
QT += bootstrap-private
|
|
|
|
}
|
2013-03-25 14:57:01 +00:00
|
|
|
} else {
|
|
|
|
!build_pass:contains(QT_CONFIG, build_all): CONFIG += release
|
2013-03-08 20:45:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-07 17:00:38 +00:00
|
|
|
ucmodule = $$upper($$MODULE)
|
|
|
|
|
2012-11-29 21:22:42 +00:00
|
|
|
isEmpty(MODULE_INCNAME): MODULE_INCNAME = $$TARGET
|
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
internal_module: \
|
|
|
|
MODULE_DEPENDS = $$replace(QT, -private$, _private)
|
|
|
|
else: \
|
|
|
|
MODULE_DEPENDS = $$replace(QT, -private$, )
|
2012-09-03 10:19:39 +00:00
|
|
|
MODULE_DEPENDS = $$unique(MODULE_DEPENDS)
|
2012-08-07 17:00:38 +00:00
|
|
|
|
2012-08-30 11:46:14 +00:00
|
|
|
contains(TARGET, QtAddOn.*): \
|
|
|
|
MODULE_DEFINE = QT_ADDON_$${ucmodule}_LIB
|
|
|
|
else: \
|
|
|
|
MODULE_DEFINE = QT_$${ucmodule}_LIB
|
|
|
|
MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES
|
|
|
|
|
2013-01-28 20:07:14 +00:00
|
|
|
load(qt_module_pris)
|
2012-08-07 17:00:38 +00:00
|
|
|
|
2013-10-21 19:05:35 +00:00
|
|
|
INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes)
|
2012-08-07 17:00:38 +00:00
|
|
|
|
2012-10-29 16:25:30 +00:00
|
|
|
!no_module_headers: load(qt_module_headers)
|
2012-08-07 17:00:38 +00:00
|
|
|
|
|
|
|
#other
|
|
|
|
TEMPLATE = lib
|
2013-10-21 19:05:35 +00:00
|
|
|
DESTDIR = $$eval(QT.$${MODULE_ID}.libs)
|
|
|
|
win32:!wince*:!prefix_build: DLLDESTDIR = $$eval(QT.$${MODULE_ID}.bins)
|
2012-08-07 17:00:38 +00:00
|
|
|
|
|
|
|
CONFIG += qmake_cache target_qt
|
|
|
|
|
2012-11-30 20:07:47 +00:00
|
|
|
QMAKE_DOCS_TARGETDIR = qt$${MODULE}
|
2012-10-08 15:19:14 +00:00
|
|
|
|
2012-08-07 17:00:38 +00:00
|
|
|
# If Qt was configured with -debug-and-release then build the module the same way
|
2012-10-29 16:25:30 +00:00
|
|
|
# - unless this is a host library
|
|
|
|
!host_build:if(win32|mac):!macx-xcode {
|
2012-08-07 17:00:38 +00:00
|
|
|
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
|
|
|
|
contains(QT_CONFIG, build_all):CONFIG += build_all
|
|
|
|
}
|
|
|
|
|
|
|
|
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
|
|
|
|
|
|
|
|
QT += $$QT_FOR_PRIVATE
|
|
|
|
unset(QT_FOR_PRIVATE)
|
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!internal_module:CONFIG += create_cmake
|
2012-08-07 17:00:38 +00:00
|
|
|
|
|
|
|
contains(TARGET, QtAddOn.*): \
|
|
|
|
DEFINES += QT_BUILD_ADDON_$${ucmodule}_LIB
|
|
|
|
else: \
|
|
|
|
DEFINES += QT_BUILD_$${ucmodule}_LIB
|
|
|
|
|
2013-07-09 14:07:07 +00:00
|
|
|
# OS X and iOS frameworks
|
2013-02-15 18:28:28 +00:00
|
|
|
mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
|
2012-08-07 17:00:38 +00:00
|
|
|
#QMAKE_FRAMEWORK_VERSION = 4.0
|
2013-07-11 13:43:32 +00:00
|
|
|
CONFIG += lib_bundle sliced_bundle qt_framework
|
2013-08-30 21:14:40 +00:00
|
|
|
CONFIG -= qt_install_headers #no need to install these as well
|
2013-11-14 19:14:14 +00:00
|
|
|
!debug_and_release|!build_all|CONFIG(release, debug|release) {
|
2013-06-18 12:36:10 +00:00
|
|
|
FRAMEWORK_HEADERS.version = Versions
|
|
|
|
FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
|
|
|
|
FRAMEWORK_HEADERS.path = Headers
|
|
|
|
FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES
|
2013-06-28 08:48:31 +00:00
|
|
|
FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private
|
2013-06-28 09:07:44 +00:00
|
|
|
FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES
|
|
|
|
FRAMEWORK_QPA_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/qpa
|
|
|
|
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS FRAMEWORK_QPA_HEADERS
|
2012-08-07 17:00:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mac {
|
|
|
|
CONFIG += explicitlib
|
|
|
|
macx-g++ {
|
|
|
|
QMAKE_CFLAGS += -fconstant-cfstrings
|
|
|
|
QMAKE_CXXFLAGS += -fconstant-cfstrings
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFINES += QT_BUILDING_QT
|
|
|
|
win32 {
|
|
|
|
INCLUDEPATH += tmp
|
2012-10-16 02:45:16 +00:00
|
|
|
CONFIG += skip_target_version_ext
|
2013-12-29 16:14:20 +00:00
|
|
|
# If the code is really "unsafe" then it is unsafe on
|
|
|
|
# other platforms as well; so fixing these warnings just
|
|
|
|
# for MSVC builds, would clutter the code and wouldn't help
|
|
|
|
# in fixing issues that might exist on other platforms.
|
|
|
|
# Using the same functions across all supported platforms
|
|
|
|
# keeps the code clean and helps in writing code that is
|
|
|
|
# safe across all platforms.
|
|
|
|
DEFINES *= _CRT_SECURE_NO_WARNINGS
|
2014-04-14 15:51:41 +00:00
|
|
|
|
|
|
|
DEFINES += _USE_MATH_DEFINES
|
2012-08-07 17:00:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
aix-g++* {
|
|
|
|
QMAKE_CFLAGS += -mminimal-toc
|
|
|
|
QMAKE_CXXFLAGS += -mminimal-toc
|
|
|
|
}
|
|
|
|
|
2013-12-09 04:28:21 +00:00
|
|
|
sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:contains(QT_CONFIG, shared)) {
|
|
|
|
# If the compiler supports SSE2, enable it unconditionally in all of Qt shared libraries
|
|
|
|
# (and only the libraries). This is not expected to be a problem because:
|
|
|
|
# - on Windows, sharing of libraries is uncommon
|
|
|
|
# - on Mac OS X, all x86 CPUs already have SSE2 support (we won't even reach here)
|
|
|
|
# - on Linux, the dynamic loader can find the libraries on LIBDIR/sse2/
|
|
|
|
# The last guarantee does not apply to executables and plugins, so we can't enable for them.
|
|
|
|
QT_CPU_FEATURES.$$QT_ARCH += sse sse2
|
|
|
|
QMAKE_CFLAGS += $$QMAKE_CFLAGS_SSE2
|
|
|
|
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2
|
|
|
|
}
|
2014-01-16 18:41:11 +00:00
|
|
|
|
|
|
|
clang {
|
|
|
|
apple_clang_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
|
|
|
reg_clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
|
|
|
!lessThan(apple_clang_ver, "5.1")|!lessThan(reg_clang_ver, "3.4"): \
|
|
|
|
CONFIG += compiler_supports_fpmath
|
|
|
|
} else: gcc {
|
|
|
|
CONFIG += compiler_supports_fpmath
|
|
|
|
}
|
|
|
|
|
|
|
|
equals(QT_ARCH, i386):contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):compiler_supports_fpmath {
|
2013-12-09 04:28:21 +00:00
|
|
|
# Turn on SSE-based floating-point math
|
|
|
|
QMAKE_CFLAGS += -mfpmath=sse
|
|
|
|
QMAKE_CXXFLAGS += -mfpmath=sse
|
|
|
|
}
|
|
|
|
|
2013-03-04 09:16:42 +00:00
|
|
|
android: CONFIG += qt_android_deps
|
|
|
|
|
2012-08-07 17:00:38 +00:00
|
|
|
#install directives
|
|
|
|
load(qt_installs)
|
|
|
|
|
2014-04-14 15:51:41 +00:00
|
|
|
load(qt_targets)
|
|
|
|
load(qt_common)
|
|
|
|
|
2014-04-14 14:33:18 +00:00
|
|
|
# this builds on top of qt_common
|
2014-01-08 13:12:17 +00:00
|
|
|
unix|mingw {
|
2014-04-14 15:51:41 +00:00
|
|
|
CONFIG += create_pc
|
|
|
|
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
2014-04-14 15:32:23 +00:00
|
|
|
QMAKE_PKGCONFIG_LIBDIR = $$qt_libdir
|
2014-04-14 15:51:41 +00:00
|
|
|
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
|
|
|
|
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
|
2013-02-04 11:43:22 +00:00
|
|
|
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$section(VERSION, ., 0, 0) ")
|
2013-02-04 11:51:26 +00:00
|
|
|
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$section(VERSION, ., 0, 0))
|
2013-01-25 13:58:36 +00:00
|
|
|
for(i, MODULE_DEPENDS): \
|
2013-01-25 13:54:57 +00:00
|
|
|
QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$eval(QT.$${i}.MAJOR_VERSION))
|
2012-08-07 17:00:38 +00:00
|
|
|
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
|
|
|
|
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
|
2014-04-14 15:51:41 +00:00
|
|
|
QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
|
|
|
|
|
|
|
|
unix {
|
|
|
|
CONFIG += create_libtool explicitlib
|
2014-04-14 15:32:23 +00:00
|
|
|
QMAKE_LIBTOOL_LIBDIR = $$qt_libdir
|
2014-04-14 15:51:41 +00:00
|
|
|
QMAKE_LIBTOOL_INSTALL_REPLACE += lib_replace
|
|
|
|
}
|
2012-08-07 17:00:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE
|
|
|
|
DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS
|
|
|
|
DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code
|
|
|
|
DEFINES *= QT_USE_QSTRINGBUILDER
|
|
|
|
DEFINES *= QT_DEPRECATED_WARNINGS
|
|
|
|
|
2012-04-30 14:03:18 +00:00
|
|
|
win32 {
|
|
|
|
# On Windows, due to the way DLLs work, we need to export all functions,
|
|
|
|
# including the inlines
|
2012-09-12 15:51:35 +00:00
|
|
|
DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x040800
|
2012-04-30 14:03:18 +00:00
|
|
|
} else {
|
|
|
|
# On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API
|
|
|
|
DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050000
|
|
|
|
}
|
|
|
|
|
2012-08-07 17:00:38 +00:00
|
|
|
TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end
|