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.
|
|
|
|
#
|
|
|
|
|
2013-02-15 17:15:18 +00:00
|
|
|
load(resolve_config)
|
|
|
|
|
Rewrite qmake's exclusive-build feature
We used to compute the default exclusive build directory, eg 'debug', at
configure time, and then set OBJECTS_DIR, MOC_DIR, etc to include this
hard-coded default exclusive build directory. We then had to run a post-
process step where we replaced the 'debug' part with the current actual
exclusive build pass, eg 'release', resulting in long-standing bugs such
as QTBUG-491 where we end up replacing parts of the build output dirs
that were not part of the original exclusive build directory.
We now set the OBJECTS_DIR, MOC_DIR, etc defaults in configure like
before, but they do not include any exclusive-build information. The
exclusive build directory is handled as a separate step in default_post
where we adjust all entries in QMAKE_DIR_REPLACE to be exclusive
directories.
For backwards compatibility the new exclusive build behavior is only
enabled for variables named by QMAKE_DIR_REPLACE_SANE, which for Qt
itself applies globally to everything but DESTDIR, and for libs and
tools also applies to DESTDIR. The reason for leaving out DESTDIR in
the general case is because many tests and examples assume the old
behavior for DESTDIR. A side effect of including all the other
variables for Qt libs and tools is that the PCH output dir will be
uniformly set, which has been an issue on Windows in the past.
The addExclusiveBuilds function now takes two or more arguments,
each argument being the key for an exclusive build, which can be
customized eg. using $$key.{name,target,dir_affix}. Passing more
than two arguments results in three/four/etc-way exclusive builds,
eg debug/release/profile. Exclusive builds can also be combined, eg
static/shared + debug/release by making two calls to the function.
We also handle individual targets of combined exclusive builds,
eg static/shared + debug/release, meaning it is possible to run
'make debug' to build both static-debug and shared-debug.
Task-number: QTBUG-491
Change-Id: I02841dbbd065ac07d413dfb45cfcfe4c013674ac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-08 17:41:16 +00:00
|
|
|
exclusive_builds: load(exclusive_builds_post)
|
|
|
|
|
2012-07-12 09:16:53 +00:00
|
|
|
QMAKE_RESOLVED_TARGET = $$absolute_path($$DESTDIR, $$OUT_PWD)/
|
2011-07-05 14:15:52 +00:00
|
|
|
|
|
|
|
win32 {
|
|
|
|
contains(TEMPLATE, .*lib) {
|
2012-11-01 21:57:33 +00:00
|
|
|
!skip_target_version_ext:isEmpty(TARGET_VERSION_EXT):!isEmpty(VERSION) {
|
2011-07-05 14:15:52 +00:00
|
|
|
TARGET_VERSION_EXT = $$section(VERSION, ., 0, 0)
|
|
|
|
}
|
2011-09-16 06:14:03 +00:00
|
|
|
static:TARGET_EXT = .lib
|
|
|
|
else:TARGET_EXT = .dll
|
2011-07-05 14:15:52 +00:00
|
|
|
} else {
|
|
|
|
TARGET_EXT = .exe
|
|
|
|
}
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}$${TARGET_VERSION_EXT}$${TARGET_EXT}
|
|
|
|
} else {
|
2016-04-12 22:24:09 +00:00
|
|
|
contains(TEMPLATE, .*lib):!if(plugin:no_plugin_name_prefix): LIBPREFIX = lib
|
2011-07-05 14:15:52 +00:00
|
|
|
|
2013-03-02 14:46:37 +00:00
|
|
|
mac {
|
2011-07-05 14:15:52 +00:00
|
|
|
equals(TEMPLATE, lib) {
|
2016-08-18 10:16:33 +00:00
|
|
|
plugin:plugin_bundle {
|
|
|
|
!isEmpty(QMAKE_PLUGIN_BUNDLE_NAME): \
|
|
|
|
plugin_target = $$QMAKE_PLUGIN_BUNDLE_NAME
|
|
|
|
else: \
|
|
|
|
plugin_target = $$TARGET
|
2020-04-07 19:08:12 +00:00
|
|
|
isEmpty(QMAKE_BUNDLE_EXTENSION): \
|
|
|
|
plugin_ext = .plugin
|
|
|
|
else: \
|
|
|
|
plugin_ext = $$QMAKE_BUNDLE_EXTENSION
|
|
|
|
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${plugin_target}$${plugin_ext}
|
2016-08-18 10:16:33 +00:00
|
|
|
!shallow_bundle: \
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Contents/MacOS/$${TARGET}
|
|
|
|
else: \
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}$${TARGET}
|
|
|
|
} else: !plugin:lib_bundle {
|
2016-04-07 03:36:45 +00:00
|
|
|
!isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME): \
|
|
|
|
framework_target = $$QMAKE_FRAMEWORK_BUNDLE_NAME
|
|
|
|
else: \
|
|
|
|
framework_target = $$TARGET
|
2020-04-07 19:08:12 +00:00
|
|
|
isEmpty(QMAKE_BUNDLE_EXTENSION): \
|
|
|
|
framework_ext = .framework
|
|
|
|
else: \
|
|
|
|
framework_ext = $$QMAKE_BUNDLE_EXTENSION
|
|
|
|
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${framework_target}$${framework_ext}
|
2016-04-07 03:36:45 +00:00
|
|
|
!shallow_bundle {
|
2020-07-22 13:44:43 +00:00
|
|
|
framework_version = $$QMAKE_FRAMEWORK_VERSION
|
|
|
|
isEmpty(framework_version):framework_version = $$section(VERSION, ., 0, 0)
|
|
|
|
isEmpty(framework_version):framework_version = A
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Versions/$${framework_version}/$${TARGET}
|
2016-04-07 03:36:45 +00:00
|
|
|
} else {
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/$${TARGET}
|
|
|
|
}
|
2011-07-05 14:15:52 +00:00
|
|
|
} else {
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}
|
|
|
|
!plugin {
|
|
|
|
TEMP_VERSION = $$section(VERSION, ., 0, 0)
|
|
|
|
isEmpty(TEMP_VERSION):TEMP_VERSION = 1
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}.$${TEMP_VERSION}
|
|
|
|
}
|
2011-09-16 06:14:03 +00:00
|
|
|
static:QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}.$${QMAKE_EXTENSION_STATICLIB}
|
|
|
|
else:QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}.$${QMAKE_EXTENSION_SHLIB}
|
2011-07-05 14:15:52 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
app_bundle {
|
2016-04-07 03:36:45 +00:00
|
|
|
!isEmpty(QMAKE_APPLICATION_BUNDLE_NAME): \
|
|
|
|
app_target = $$QMAKE_APPLICATION_BUNDLE_NAME
|
|
|
|
else: \
|
|
|
|
app_target = $$TARGET
|
|
|
|
QMAKE_RESOLVED_BUNDLE = $${QMAKE_RESOLVED_TARGET}$${app_target}.app
|
|
|
|
!shallow_bundle: \
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/Contents/MacOS/$${TARGET}
|
|
|
|
else: \
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_BUNDLE}/$${TARGET}
|
2011-07-05 14:15:52 +00:00
|
|
|
} else {
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
equals(TEMPLATE, lib) {
|
2011-09-16 06:14:03 +00:00
|
|
|
static {
|
2015-09-29 10:44:30 +00:00
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_STATICLIB}
|
2015-07-07 11:51:10 +00:00
|
|
|
} else: plugin|unversioned_libname {
|
2015-09-29 10:44:30 +00:00
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_SHLIB}
|
2011-07-05 14:15:52 +00:00
|
|
|
} else {
|
|
|
|
TEMP_VERSION = $$VERSION
|
|
|
|
isEmpty(TEMP_VERSION):TEMP_VERSION = 1.0.0
|
2015-09-29 10:44:30 +00:00
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_SHLIB}.$${TEMP_VERSION}
|
2011-07-05 14:15:52 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unset(TARGET_EXT)
|
|
|
|
unset(LIBPREFIX)
|
|
|
|
unset(TEMP_VERSION)
|
|
|
|
|