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
|
2014-05-12 00:41:40 +00:00
|
|
|
QMAKE_CFLAGS += $$QMAKE_CFLAGS_SPLIT_SECTIONS
|
|
|
|
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SPLIT_SECTIONS
|
2013-03-08 20:45:43 +00:00
|
|
|
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
|
|
|
|
|
2015-04-15 10:35:41 +00:00
|
|
|
load(qt_build_paths)
|
2012-08-07 17:00:38 +00:00
|
|
|
|
2015-05-05 16:16:00 +00:00
|
|
|
header_module {
|
2015-04-15 10:35:41 +00:00
|
|
|
TEMPLATE = aux
|
|
|
|
CONFIG += force_qt # Needed for the headers_clean tests.
|
|
|
|
} else {
|
|
|
|
TEMPLATE = lib
|
|
|
|
}
|
2015-04-15 11:59:39 +00:00
|
|
|
DESTDIR = $$MODULE_BASE_OUTDIR/lib
|
2015-06-03 15:04:53 +00:00
|
|
|
win32:!wince:!prefix_build: DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
|
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
|
|
|
|
2015-04-15 10:35:41 +00:00
|
|
|
load(qt_module_pris)
|
2012-12-22 21:12:02 +00:00
|
|
|
load(qt_common)
|
|
|
|
|
|
|
|
!no_module_headers: load(qt_module_headers)
|
|
|
|
INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes)
|
|
|
|
|
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) {
|
2014-11-13 13:20:32 +00:00
|
|
|
# Set the CFBundleIdentifier prefix for Qt frameworks
|
|
|
|
QMAKE_TARGET_BUNDLE_PREFIX = org.qt-project
|
2012-08-07 17:00:38 +00:00
|
|
|
#QMAKE_FRAMEWORK_VERSION = 4.0
|
2015-04-27 16:20:04 +00:00
|
|
|
CONFIG += sliced_bundle qt_framework
|
2015-05-05 16:16:00 +00:00
|
|
|
header_module {
|
2015-04-27 16:20:04 +00:00
|
|
|
CONFIG += bundle
|
|
|
|
QMAKE_BUNDLE_EXTENSION = .framework
|
|
|
|
QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.lib
|
|
|
|
} else {
|
|
|
|
CONFIG += lib_bundle
|
|
|
|
}
|
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
|
2014-09-29 11:22:05 +00:00
|
|
|
FRAMEWORK_PRIVATE_HEADERS.version = Versions
|
2013-06-18 12:36:10 +00:00
|
|
|
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
|
2014-09-29 11:22:05 +00:00
|
|
|
FRAMEWORK_QPA_HEADERS.version = Versions
|
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
|
|
|
|
}
|
2014-08-07 11:04:48 +00:00
|
|
|
|
|
|
|
contains(QT_CONFIG, rpath): \
|
|
|
|
QMAKE_SONAME_PREFIX = @rpath
|
2012-08-07 17:00:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
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-11-28 13:00:07 +00:00
|
|
|
host_build: \
|
|
|
|
QMAKE_PKGCONFIG_LIBDIR = $$[QT_HOST_LIBS]
|
|
|
|
else: \
|
|
|
|
QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
|
2014-04-14 15:51:41 +00:00
|
|
|
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
|
|
|
|
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
|
2014-08-29 14:45:15 +00:00
|
|
|
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
|
|
|
|
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
|
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-11-28 13:00:07 +00:00
|
|
|
pclib_replace.match = $$lib_replace.match
|
|
|
|
!isEmpty(lib_replace.replace): \
|
|
|
|
pclib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR
|
|
|
|
pclib_replace.CONFIG = path
|
|
|
|
QMAKE_PKGCONFIG_INSTALL_REPLACE += pclib_replace
|
2014-04-14 15:51:41 +00:00
|
|
|
|
|
|
|
unix {
|
|
|
|
CONFIG += create_libtool explicitlib
|
2014-11-28 13:00:07 +00:00
|
|
|
host_build: \
|
|
|
|
QMAKE_LIBTOOL_LIBDIR = $$[QT_HOST_LIBS]
|
|
|
|
else: \
|
|
|
|
QMAKE_LIBTOOL_LIBDIR = "=$$[QT_INSTALL_LIBS/raw]"
|
|
|
|
ltlib_replace.match = $$lib_replace.match
|
|
|
|
!isEmpty(lib_replace.replace): \
|
|
|
|
ltlib_replace.replace = $$QMAKE_LIBTOOL_LIBDIR
|
|
|
|
ltlib_replace.CONFIG = path
|
|
|
|
QMAKE_LIBTOOL_INSTALL_REPLACE += ltlib_replace
|
2014-04-14 15:51:41 +00:00
|
|
|
}
|
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
|
|
|
|
}
|
|
|
|
|
2015-02-25 15:00:58 +00:00
|
|
|
TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX) # Do this towards the end
|