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 {
|
2015-10-26 11:38:50 +00:00
|
|
|
!build_pass:contains(QT_CONFIG, release_tools): CONFIG += release
|
2013-03-08 20:45:43 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-19 15:53:50 +00:00
|
|
|
CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework): \
|
2015-11-19 15:50:16 +00:00
|
|
|
CONFIG += lib_bundle
|
2015-11-11 16:59:18 +00:00
|
|
|
|
2015-06-05 15:45:47 +00:00
|
|
|
CONFIG += relative_qt_rpath # Qt libraries should be relocatable
|
|
|
|
|
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)
|
2015-11-10 19:39:25 +00:00
|
|
|
contains(MODULE_DEPENDS, $$MODULE): \
|
|
|
|
error("$$TARGET depends on itself.")
|
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
|
|
|
|
2012-12-22 21:12:02 +00:00
|
|
|
load(qt_common)
|
|
|
|
!no_module_headers: load(qt_module_headers)
|
2015-11-18 16:19:46 +00:00
|
|
|
load(qt_module_pris)
|
|
|
|
|
2012-12-22 21:12:02 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2015-12-02 12:36:41 +00:00
|
|
|
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
|
2012-08-07 17:00:38 +00:00
|
|
|
|
|
|
|
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
|
2015-11-19 15:50:16 +00:00
|
|
|
lib_bundle {
|
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-11-11 16:59:18 +00:00
|
|
|
CONFIG += sliced_bundle
|
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
|
|
|
|
}
|
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 {
|
|
|
|
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
|
2015-10-19 21:52:10 +00:00
|
|
|
else: \
|
|
|
|
CONFIG += absolute_library_soname
|
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
|
|
|
|
}
|
|
|
|
|
2015-10-22 18:31:58 +00:00
|
|
|
android: CONFIG += qt_android_deps no_linker_version_script
|
|
|
|
|
2015-11-10 16:24:53 +00:00
|
|
|
!header_module:unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!no_linker_version_script:!static {
|
2015-06-02 18:10:22 +00:00
|
|
|
verscript = $$OUT_PWD/$${TARGET}.version
|
|
|
|
QMAKE_LFLAGS += $${QMAKE_LFLAGS_VERSION_SCRIPT}$$verscript
|
|
|
|
|
|
|
|
internal_module {
|
|
|
|
verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API { *; };"
|
|
|
|
} else {
|
2015-06-02 18:42:07 +00:00
|
|
|
verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API {" \
|
2016-01-02 20:55:14 +00:00
|
|
|
" qt_private_api_tag*;"
|
|
|
|
for(header, SYNCQT.PRIVATE_HEADER_FILES): \
|
|
|
|
verscript_content += " @FILE:$${_PRO_FILE_PWD_}/$$header@"
|
|
|
|
verscript_content += "};"
|
2015-06-02 18:42:07 +00:00
|
|
|
|
2015-06-02 18:10:22 +00:00
|
|
|
current = Qt_$$QT_MAJOR_VERSION
|
2015-06-02 18:42:07 +00:00
|
|
|
verscript_content += "$$current { *; };"
|
2015-09-18 02:04:42 +00:00
|
|
|
isEmpty(QT_NAMESPACE): tag_symbol = qt_version_tag
|
|
|
|
else: tag_symbol = qt_version_tag_$$QT_NAMESPACE
|
|
|
|
|
|
|
|
for(i, 0..$$QT_MINOR_VERSION) {
|
2015-06-02 18:10:22 +00:00
|
|
|
previous = $$current
|
|
|
|
current = Qt_$${QT_MAJOR_VERSION}.$$i
|
2015-09-18 02:04:42 +00:00
|
|
|
equals(i, $$QT_MINOR_VERSION): verscript_content += "$$current { $$tag_symbol; } $$previous;"
|
|
|
|
else: verscript_content += "$$current {} $$previous;"
|
2015-06-02 18:10:22 +00:00
|
|
|
}
|
2015-06-02 18:42:07 +00:00
|
|
|
|
2016-01-02 20:55:14 +00:00
|
|
|
# Add a post-processing step to replace the @FILE:filename@
|
|
|
|
verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $${verscript}.in > $@
|
2015-06-02 18:42:07 +00:00
|
|
|
verscriptprocess.target = $$verscript
|
|
|
|
for(header, SYNCQT.PRIVATE_HEADER_FILES): \
|
|
|
|
verscriptprocess.depends += $${_PRO_FILE_PWD_}/$$header
|
2016-01-02 20:55:14 +00:00
|
|
|
verscriptprocess.depends += $${verscript}.in
|
2015-06-02 18:42:07 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += verscriptprocess
|
|
|
|
PRE_TARGETDEPS += $$verscript
|
|
|
|
verscript = $${verscript}.in
|
2015-06-02 18:10:22 +00:00
|
|
|
}
|
|
|
|
write_file($$verscript, verscript_content)|error("Aborting.")
|
|
|
|
unset(current)
|
|
|
|
unset(previous)
|
|
|
|
unset(verscript)
|
|
|
|
unset(verscript_content)
|
|
|
|
}
|
|
|
|
|
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
|
2015-11-19 15:50:16 +00:00
|
|
|
!internal_module:!lib_bundle:if(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
|
2015-12-10 16:26:20 +00:00
|
|
|
}
|
|
|
|
!lib_bundle:unix {
|
|
|
|
CONFIG += create_libtool
|
|
|
|
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
|
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
|