2019-06-05 15:15:20 +00:00
|
|
|
# Propagate common variables via BuildInternals package.
|
|
|
|
set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
|
|
|
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" @BUILD_SHARED_LIBS@)
|
|
|
|
set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@)
|
|
|
|
set(INSTALL_CMAKE_NAMESPACE @INSTALL_CMAKE_NAMESPACE@)
|
|
|
|
set(QT_BUILD_INTERNALS_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
|
|
|
|
# Propagate the original install prefix, so that a developer building a child module can
|
|
|
|
# specify CMAKE_PREFIX_PATH for finding the Qt modules instead of CMAKE_INSTALL_PREFIX.
|
|
|
|
set(CMAKE_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@ CACHE PATH
|
|
|
|
"Install path prefix, prepended onto install directories." FORCE)
|
|
|
|
|
2020-04-30 15:00:13 +00:00
|
|
|
# Save the original install prefix in an additional variable.
|
|
|
|
# While CMAKE_INSTALL_PREFIX may be overridden in certain cases (like for standalone tests building
|
|
|
|
# or for singular qt-cmake-standalone-test usage), we still need the original qtbase install prefix
|
|
|
|
# to know where the shared libraries are located to inject them into PATH when running tests via
|
|
|
|
# ctest.
|
|
|
|
set(QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@ CACHE PATH
|
|
|
|
"Original install prefix specified when building qtbase." FORCE)
|
|
|
|
|
2019-06-05 15:15:20 +00:00
|
|
|
# Propagate developer builds to other modules via BuildInternals package.
|
|
|
|
if(@FEATURE_developer_build@)
|
|
|
|
set(FEATURE_developer_build ON CACHE BOOL "Developer build." FORCE)
|
|
|
|
endif()
|
2019-07-22 15:30:24 +00:00
|
|
|
|
|
|
|
# Propagate non-prefix builds.
|
|
|
|
set(QT_WILL_INSTALL @QT_WILL_INSTALL@ CACHE BOOL
|
|
|
|
"Boolean indicating if doing a Qt prefix build (vs non-prefix build)." FORCE)
|
Ugly fix for handling QT_SOURCE_TREE
QT_SOURCE_TREE is a variable that is set in qtbase/.qmake.conf.
In qtbase, it's used throughout various
projects to find cpp sources when building standalone tests (among
other things).
Everything works fine with qmake, because even if qmake is invoked
on the tests subfolder, qmake searches up the source directory tree
until it finds a .qmake.conf file, and uses that.
When building qttools with qmake, the qdoc project expects
to have a QT_SOURCE_TREE value, but it's not actually set in the
qttools/.qmake.conf file, so the generated include paths that use
that value are incorrect. Curiously the build still succeeds.
Now in CMake land we replaced QT_SOURCE_TREE with
CMAKE_SOURCE_DIR, but that does not work properly when doing a
standalone tests build, because the project in that case is the
tests one, and not the qtbase one, so configuration fails in a
developer build when trying to configure some private tests.
So far I've found that only qtbase actively uses this value.
A temporary fix is to save the qtbase source directory into a
QT_SOURCE_TREE variable inside the generated
BuildInternalsExtra.cmake file.
The pro2cmake script is changed to handle presence of QT_SOURCE_TREE
in a qrc file path. This is handled by finding the location of a
.qmake.conf file starting from the project file absolute path.
This is needed to stop the script from crashing when handling
the mimedatabase test projects for example.
The change also regenerates the relevant failing test projects, and
thus standalone tests (when doing developer builds aka private_tests
enabled) now configure and build successfully.
Change-Id: I15adc6f4ab6e3056c43ed850196204e2229c4d98
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-26 16:59:53 +00:00
|
|
|
|
|
|
|
set(QT_SOURCE_TREE "@QT_SOURCE_TREE@" CACHE PATH
|
|
|
|
"A path to the source tree of the previously configured QtBase project." FORCE)
|
2019-08-13 13:51:56 +00:00
|
|
|
|
2019-09-06 09:52:47 +00:00
|
|
|
# Propagate decision of building tests and examples to other repositories.
|
|
|
|
set(BUILD_TESTING @BUILD_TESTING@ CACHE BOOL "Build the testing tree.")
|
|
|
|
set(BUILD_EXAMPLES @BUILD_EXAMPLES@ CACHE BOOL "Build Qt examples")
|
2019-11-04 13:43:39 +00:00
|
|
|
set(QT_NO_MAKE_TESTS @QT_NO_MAKE_TESTS@ CACHE BOOL
|
|
|
|
"Should tests be built as part of the default 'all' target.")
|
|
|
|
set(QT_NO_MAKE_EXAMPLES @QT_NO_MAKE_EXAMPLES@ CACHE BOOL
|
|
|
|
"Should examples be built as part of the default 'all' target.")
|
2019-09-06 09:52:47 +00:00
|
|
|
|
2019-12-06 14:12:17 +00:00
|
|
|
# Propagate usage of ccache.
|
|
|
|
set(QT_USE_CCACHE @QT_USE_CCACHE@ CACHE BOOL "Enable the use of ccache")
|
|
|
|
|
2019-08-13 13:51:56 +00:00
|
|
|
# Extra set of exported variables
|
|
|
|
@QT_EXTRA_BUILD_INTERNALS_VARS@
|