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)
|
|
|
|
isEmpty(VERSION):VERSION = $$QT_VERSION
|
|
|
|
|
|
|
|
# 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
|
|
|
!static:!shared {
|
|
|
|
contains(QT_CONFIG, static): \
|
|
|
|
CONFIG += static
|
|
|
|
else: \
|
|
|
|
CONFIG += shared
|
|
|
|
}
|
|
|
|
|
|
|
|
ucmodule = $$upper($$MODULE)
|
|
|
|
|
2012-11-29 21:22:42 +00:00
|
|
|
isEmpty(MODULE_INCNAME): MODULE_INCNAME = $$TARGET
|
|
|
|
|
2012-08-07 17:00:38 +00:00
|
|
|
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
|
|
|
|
|
2012-10-23 20:15:43 +00:00
|
|
|
load(qt_build_paths)
|
2012-10-24 13:03:49 +00:00
|
|
|
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri
|
2012-08-07 17:00:38 +00:00
|
|
|
|
|
|
|
!build_pass {
|
|
|
|
|
|
|
|
# Create a module .pri file
|
2012-12-13 11:31:02 +00:00
|
|
|
unix:!static: \
|
|
|
|
module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]"
|
|
|
|
else: \
|
|
|
|
module_rpath =
|
2012-08-07 17:00:38 +00:00
|
|
|
!isEmpty(QT_FOR_PRIVATE) {
|
|
|
|
contains(QT_FOR_PRIVATE, .*-private$):error("QT_FOR_PRIVATE may not contain *-private.")
|
|
|
|
module_privdep = "QT.$${MODULE}.private_depends = $$QT_FOR_PRIVATE"
|
|
|
|
} else {
|
|
|
|
module_privdep =
|
|
|
|
}
|
|
|
|
static: \
|
|
|
|
module_build_type = "QT.$${MODULE}.module_config = staticlib"
|
|
|
|
else:mac:contains(QT_CONFIG, qt_framework): \
|
|
|
|
module_build_type = "QT.$${MODULE}.module_config = lib_bundle"
|
|
|
|
else: \
|
|
|
|
module_build_type =
|
|
|
|
!isEmpty(MODULE_CONFIG): \
|
|
|
|
module_config = "QT.$${MODULE}.CONFIG = $$MODULE_CONFIG"
|
|
|
|
else: \
|
|
|
|
module_config =
|
2012-10-29 16:25:30 +00:00
|
|
|
!no_module_headers {
|
2012-11-29 21:22:42 +00:00
|
|
|
MODULE_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME"
|
2012-11-28 15:17:29 +00:00
|
|
|
MODULE_PRIVATE_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \
|
|
|
|
\$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME"
|
2012-10-29 16:25:30 +00:00
|
|
|
}
|
2012-08-07 17:00:38 +00:00
|
|
|
MODULE_PRI_CONT = \
|
|
|
|
"QT.$${MODULE}.VERSION = $${VERSION}" \
|
|
|
|
"QT.$${MODULE}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
|
|
|
|
"QT.$${MODULE}.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \
|
|
|
|
"QT.$${MODULE}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
|
|
|
|
"" \
|
|
|
|
"QT.$${MODULE}.name = $$TARGET" \
|
|
|
|
"QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \
|
2012-10-29 16:25:30 +00:00
|
|
|
"QT.$${MODULE}.includes = $$MODULE_INCLUDES" \
|
|
|
|
"QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" \
|
2012-08-07 17:00:38 +00:00
|
|
|
"QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \
|
2012-10-25 21:32:09 +00:00
|
|
|
"QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \
|
2012-12-13 11:31:02 +00:00
|
|
|
$$module_rpath \
|
2012-08-07 17:00:38 +00:00
|
|
|
"QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \
|
2012-10-15 20:23:13 +00:00
|
|
|
"QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \
|
|
|
|
"QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE" \
|
2012-08-07 17:00:38 +00:00
|
|
|
"QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
|
|
|
|
$$module_privdep \
|
|
|
|
$$module_build_type \
|
|
|
|
$$module_config \
|
|
|
|
"QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting
|
|
|
|
"" \
|
|
|
|
"QT_CONFIG += $$MODULE" # this is obsolete, but some code still depends on it
|
|
|
|
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
|
|
|
|
|
|
|
|
} # !build_pass
|
|
|
|
|
|
|
|
load(qt_module_fwdpri)
|
|
|
|
|
2012-10-29 17:32:04 +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
|
|
|
|
DESTDIR = $$eval(QT.$${MODULE}.libs)
|
|
|
|
win32:!wince*:exists($$[QT_INSTALL_PREFIX]/.qmake.cache): DLLDESTDIR = $$eval(QT.$${MODULE}.bins)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
|
|
|
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
|
|
|
|
contains(QT_CONFIG, largefile):CONFIG += largefile
|
|
|
|
contains(QT_CONFIG, separate_debug_info):CONFIG += separate_debug_info
|
|
|
|
contains(QT_CONFIG, separate_debug_info_nocopy):CONFIG += separate_debug_info_nocopy
|
|
|
|
contains(QT_CONFIG, c++11):CONFIG += c++11
|
|
|
|
|
|
|
|
#mac frameworks
|
|
|
|
mac:!static:contains(QT_CONFIG, qt_framework) {
|
|
|
|
#QMAKE_FRAMEWORK_VERSION = 4.0
|
|
|
|
CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
|
|
|
|
CONFIG(release, debug|release) {
|
|
|
|
!debug_and_release|build_pass {
|
|
|
|
CONFIG -= qt_install_headers #no need to install these as well
|
|
|
|
FRAMEWORK_HEADERS.version = Versions
|
|
|
|
FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
|
|
|
|
FRAMEWORK_HEADERS.path = Headers
|
|
|
|
}
|
|
|
|
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2012-08-07 17:00:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
aix-g++* {
|
|
|
|
QMAKE_CFLAGS += -mminimal-toc
|
|
|
|
QMAKE_CXXFLAGS += -mminimal-toc
|
|
|
|
}
|
|
|
|
|
|
|
|
#install directives
|
|
|
|
load(qt_installs)
|
|
|
|
|
|
|
|
unix|win32-g++* {
|
|
|
|
CONFIG += create_pc
|
|
|
|
QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
|
2012-12-05 20:33:02 +00:00
|
|
|
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
|
|
|
|
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
|
2012-08-07 17:00:38 +00:00
|
|
|
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
2012-12-05 20:52:49 +00:00
|
|
|
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
|
|
|
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
|
|
|
|
else: \
|
|
|
|
rplbase = $$[QT_INSTALL_PREFIX/get]
|
|
|
|
include_replace.match = $$rplbase/include
|
2012-08-07 17:00:38 +00:00
|
|
|
include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
|
2012-12-05 20:52:49 +00:00
|
|
|
lib_replace.match = $$rplbase/lib
|
2012-08-07 17:00:38 +00:00
|
|
|
lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
|
2012-12-05 19:54:09 +00:00
|
|
|
QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace
|
2012-08-07 17:00:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unix {
|
|
|
|
CONFIG += create_libtool explicitlib
|
|
|
|
QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
|
|
|
|
QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
|
|
|
|
QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
|
|
|
|
}
|
|
|
|
|
|
|
|
unix|win32-g++* {
|
|
|
|
for(i, QT):QMAKE_PKGCONFIG_REQUIRES += $$eval(QT.$${i}.name)
|
|
|
|
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
|
|
|
|
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# Provides useful info normally only contained in the internal .qmake.cache file
|
|
|
|
qt_conf.name = qt_config
|
|
|
|
qt_conf.variable = CONFIG
|
|
|
|
QMAKE_PKGCONFIG_VARIABLES += qt_conf
|
|
|
|
|
|
|
|
load(qt_targets)
|
|
|
|
|
|
|
|
win32:DEFINES+=_USE_MATH_DEFINES
|
|
|
|
|