2018-10-24 13:20:27 +00:00
|
|
|
## QtPlatform Target:
|
2019-02-11 10:34:35 +00:00
|
|
|
add_library(Platform INTERFACE)
|
|
|
|
add_library(Qt::Platform ALIAS Platform)
|
|
|
|
target_include_directories(Platform
|
2018-10-24 13:20:27 +00:00
|
|
|
INTERFACE
|
2020-01-15 22:01:16 +00:00
|
|
|
$<BUILD_INTERFACE:${QT_PLATFORM_DEFINITION_DIR_ABSOLUTE}>
|
2020-08-06 07:56:58 +00:00
|
|
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
2020-01-15 22:01:16 +00:00
|
|
|
$<INSTALL_INTERFACE:${QT_PLATFORM_DEFINITION_DIR}>
|
2018-10-24 13:20:27 +00:00
|
|
|
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}>
|
|
|
|
)
|
2019-02-11 10:34:35 +00:00
|
|
|
target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS})
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
|
2019-06-04 13:19:00 +00:00
|
|
|
# When building on android we need to link against the logging library
|
2019-06-03 16:39:28 +00:00
|
|
|
# in order to satisfy linker dependencies. Both of these libraries are part of
|
|
|
|
# the NDK.
|
|
|
|
if (ANDROID)
|
2019-06-04 13:19:00 +00:00
|
|
|
target_link_libraries(Platform INTERFACE log)
|
2019-06-03 16:39:28 +00:00
|
|
|
endif()
|
|
|
|
|
2020-02-17 08:54:59 +00:00
|
|
|
qt_enable_msvc_cplusplus_define(Platform INTERFACE)
|
|
|
|
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}")
|
|
|
|
qt_path_join(__GlobalConfig_build_dir ${QT_CONFIG_BUILD_DIR} ${__GlobalConfig_path_suffix})
|
|
|
|
qt_path_join(__GlobalConfig_install_dir ${QT_CONFIG_INSTALL_DIR} ${__GlobalConfig_path_suffix})
|
2019-07-03 14:40:01 +00:00
|
|
|
set(__GlobalConfig_install_dir_absolute "${__GlobalConfig_install_dir}")
|
CMake: Make build system of installed Qt more relocatable
Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way.
The following story inspired this change.
If a user wants to build a Qt repo into a different install prefix
than the usual Qt one, this will fail configuration because we
look for various things like syncqt, qdoc, etc relative to
CMAKE_INSTALL_PREFIX, which will now point to a different location
where none of the above tools are located.
The intent for such a use case is to support building Qt packages with
Conan, which sets a random install prefix when configuring a repo.
The idea is to derive the qt prefix dynamically from the
QtBuildInternals package location. Essentially it's a reverse relative
path from the QtBuildInternalsConfig.cmake file to the install prefix
that was specified when initially configuring qtbase.
Once the dynamic prefix is computed (so we know where the possibly
relocated Qt is), we can find tools like syncqt and qdoc.
This is an initial attempt to support a use case like that.
More design work will probably needed in case if tools / libs need to
be found in a location different than the Qt install prefix (so
support for multiple install prefixes / search paths).
An example of such a case would be when building qtdeclarative and
qtquickcontrols2 as Conan packages in one go. Most likely the
qmltyperegistrar tool will be located in the random install prefix
set by Conan, so building qtquickcontrols2 might fail due to not
finding the tool in the original Qt install prefix.
As to the implementation details, the change does the following:
- Dynamically computes and sets the
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when
find_package()'ing QtBuildInternals. It's an absolute path
pointing to where the relocated Qt is.
- When building qtbase this variable is not yet available (due
to QtBuildInternalsExtra not existing), in that case we set
the variable to the absolute path of CMAKE_INSTALL_PREFIX
(but only for the initial qtbase configuration).
- Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used
for standalone tests purposes. It's not needed now that we compute
the location of the Qt prefix dynamically.
- The Unixy qt-cmake and qt-cmake-private shell scripts now
use a relative path to find the toolchain file we created.
- The toolchain file also dynamically computes the location of the Qt
packages, and adds them to CMAKE_PREFIX_PATH.
- A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding
tool locations, mkspecs dir, path environment setup for tools, etc.
- Some places still use CMAKE_PREFIX_PATH in the following cases
- When determining paths while configuring qtbase (valid cases)
- When I wasn't sure what the behavior should be, so I left them
as-is (an example is documentation generation, do we want to
install it into the random Conan prefix, or into the main prefix?
Currently it installs in the random prefix).
Note that relocating a Qt installation does not work for non-prefix /
non-installed builds, due to hardcoded paths to include directories
and libraries in generated FooTargets.cmake files.
Task-number: QTBUG-83999
Change-Id: I87d6558729db93121b1715771034b03ce3295923
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-05 08:30:35 +00:00
|
|
|
set(__qt_bin_dir_absolute "${QT_INSTALL_DIR}/${INSTALL_BINDIR}")
|
2019-07-03 14:40:01 +00:00
|
|
|
if(QT_WILL_INSTALL)
|
|
|
|
# Need to prepend the install prefix when doing prefix builds, because the config install dir
|
|
|
|
# is relative then.
|
|
|
|
qt_path_join(__GlobalConfig_install_dir_absolute
|
CMake: Make build system of installed Qt more relocatable
Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way.
The following story inspired this change.
If a user wants to build a Qt repo into a different install prefix
than the usual Qt one, this will fail configuration because we
look for various things like syncqt, qdoc, etc relative to
CMAKE_INSTALL_PREFIX, which will now point to a different location
where none of the above tools are located.
The intent for such a use case is to support building Qt packages with
Conan, which sets a random install prefix when configuring a repo.
The idea is to derive the qt prefix dynamically from the
QtBuildInternals package location. Essentially it's a reverse relative
path from the QtBuildInternalsConfig.cmake file to the install prefix
that was specified when initially configuring qtbase.
Once the dynamic prefix is computed (so we know where the possibly
relocated Qt is), we can find tools like syncqt and qdoc.
This is an initial attempt to support a use case like that.
More design work will probably needed in case if tools / libs need to
be found in a location different than the Qt install prefix (so
support for multiple install prefixes / search paths).
An example of such a case would be when building qtdeclarative and
qtquickcontrols2 as Conan packages in one go. Most likely the
qmltyperegistrar tool will be located in the random install prefix
set by Conan, so building qtquickcontrols2 might fail due to not
finding the tool in the original Qt install prefix.
As to the implementation details, the change does the following:
- Dynamically computes and sets the
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when
find_package()'ing QtBuildInternals. It's an absolute path
pointing to where the relocated Qt is.
- When building qtbase this variable is not yet available (due
to QtBuildInternalsExtra not existing), in that case we set
the variable to the absolute path of CMAKE_INSTALL_PREFIX
(but only for the initial qtbase configuration).
- Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used
for standalone tests purposes. It's not needed now that we compute
the location of the Qt prefix dynamically.
- The Unixy qt-cmake and qt-cmake-private shell scripts now
use a relative path to find the toolchain file we created.
- The toolchain file also dynamically computes the location of the Qt
packages, and adds them to CMAKE_PREFIX_PATH.
- A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding
tool locations, mkspecs dir, path environment setup for tools, etc.
- Some places still use CMAKE_PREFIX_PATH in the following cases
- When determining paths while configuring qtbase (valid cases)
- When I wasn't sure what the behavior should be, so I left them
as-is (an example is documentation generation, do we want to
install it into the random Conan prefix, or into the main prefix?
Currently it installs in the random prefix).
Note that relocating a Qt installation does not work for non-prefix /
non-installed builds, due to hardcoded paths to include directories
and libraries in generated FooTargets.cmake files.
Task-number: QTBUG-83999
Change-Id: I87d6558729db93121b1715771034b03ce3295923
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-05 08:30:35 +00:00
|
|
|
${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}
|
|
|
|
${__GlobalConfig_install_dir_absolute})
|
|
|
|
qt_path_join(__qt_bin_dir_absolute
|
|
|
|
${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX} ${__qt_bin_dir_absolute})
|
2019-07-03 14:40:01 +00:00
|
|
|
endif()
|
CMake: Make build system of installed Qt more relocatable
Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way.
The following story inspired this change.
If a user wants to build a Qt repo into a different install prefix
than the usual Qt one, this will fail configuration because we
look for various things like syncqt, qdoc, etc relative to
CMAKE_INSTALL_PREFIX, which will now point to a different location
where none of the above tools are located.
The intent for such a use case is to support building Qt packages with
Conan, which sets a random install prefix when configuring a repo.
The idea is to derive the qt prefix dynamically from the
QtBuildInternals package location. Essentially it's a reverse relative
path from the QtBuildInternalsConfig.cmake file to the install prefix
that was specified when initially configuring qtbase.
Once the dynamic prefix is computed (so we know where the possibly
relocated Qt is), we can find tools like syncqt and qdoc.
This is an initial attempt to support a use case like that.
More design work will probably needed in case if tools / libs need to
be found in a location different than the Qt install prefix (so
support for multiple install prefixes / search paths).
An example of such a case would be when building qtdeclarative and
qtquickcontrols2 as Conan packages in one go. Most likely the
qmltyperegistrar tool will be located in the random install prefix
set by Conan, so building qtquickcontrols2 might fail due to not
finding the tool in the original Qt install prefix.
As to the implementation details, the change does the following:
- Dynamically computes and sets the
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when
find_package()'ing QtBuildInternals. It's an absolute path
pointing to where the relocated Qt is.
- When building qtbase this variable is not yet available (due
to QtBuildInternalsExtra not existing), in that case we set
the variable to the absolute path of CMAKE_INSTALL_PREFIX
(but only for the initial qtbase configuration).
- Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used
for standalone tests purposes. It's not needed now that we compute
the location of the Qt prefix dynamically.
- The Unixy qt-cmake and qt-cmake-private shell scripts now
use a relative path to find the toolchain file we created.
- The toolchain file also dynamically computes the location of the Qt
packages, and adds them to CMAKE_PREFIX_PATH.
- A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding
tool locations, mkspecs dir, path environment setup for tools, etc.
- Some places still use CMAKE_PREFIX_PATH in the following cases
- When determining paths while configuring qtbase (valid cases)
- When I wasn't sure what the behavior should be, so I left them
as-is (an example is documentation generation, do we want to
install it into the random Conan prefix, or into the main prefix?
Currently it installs in the random prefix).
Note that relocating a Qt installation does not work for non-prefix /
non-installed builds, due to hardcoded paths to include directories
and libraries in generated FooTargets.cmake files.
Task-number: QTBUG-83999
Change-Id: I87d6558729db93121b1715771034b03ce3295923
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-05 08:30:35 +00:00
|
|
|
# Compute relative path from $qt_prefix/bin dir to global CMake config install dir, to use in the
|
|
|
|
# unix-y qt-cmake shell script, to make it work even if the installed Qt is relocated.
|
|
|
|
file(RELATIVE_PATH
|
|
|
|
__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir
|
|
|
|
${__qt_bin_dir_absolute} ${__GlobalConfig_install_dir_absolute})
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2019-06-14 10:59:07 +00:00
|
|
|
# Generate and install Qt6 config file.
|
2018-10-24 13:20:27 +00:00
|
|
|
configure_package_config_file(
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in"
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
"${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}Config.cmake"
|
|
|
|
INSTALL_DESTINATION "${__GlobalConfig_install_dir}"
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
write_basic_package_version_file(
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake
|
2018-10-24 13:20:27 +00:00
|
|
|
VERSION ${PROJECT_VERSION}
|
|
|
|
COMPATIBILITY AnyNewerVersion
|
|
|
|
)
|
|
|
|
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
qt_install(FILES
|
|
|
|
"${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}Config.cmake"
|
|
|
|
"${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake"
|
|
|
|
DESTINATION "${__GlobalConfig_install_dir}"
|
|
|
|
COMPONENT Devel
|
|
|
|
)
|
|
|
|
|
2020-03-18 18:09:00 +00:00
|
|
|
# Configure and install the QtBuildInternals package.
|
|
|
|
set(__build_internals_path_suffix "${INSTALL_CMAKE_NAMESPACE}BuildInternals")
|
|
|
|
qt_path_join(__build_internals_build_dir ${QT_CONFIG_BUILD_DIR} ${__build_internals_path_suffix})
|
|
|
|
qt_path_join(__build_internals_install_dir ${QT_CONFIG_INSTALL_DIR}
|
|
|
|
${__build_internals_path_suffix})
|
|
|
|
set(__build_internals_standalone_test_template_dir "QtStandaloneTestTemplateProject")
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake"
|
|
|
|
"${__build_internals_build_dir}/${INSTALL_CMAKE_NAMESPACE}BuildInternalsConfig.cmake"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
qt_install(FILES
|
|
|
|
"${__build_internals_build_dir}/${INSTALL_CMAKE_NAMESPACE}BuildInternalsConfig.cmake"
|
|
|
|
"${__build_internals_build_dir}/QtBuildInternalsExtra.cmake"
|
|
|
|
DESTINATION "${__build_internals_install_dir}"
|
|
|
|
COMPONENT Devel
|
|
|
|
)
|
|
|
|
qt_copy_or_install(
|
|
|
|
FILES
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake"
|
|
|
|
DESTINATION "${__build_internals_install_dir}")
|
|
|
|
qt_copy_or_install(
|
|
|
|
DIRECTORY
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}"
|
|
|
|
DESTINATION "${__build_internals_install_dir}")
|
|
|
|
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}/CMakeLists.txt")
|
|
|
|
|
2019-06-21 12:58:52 +00:00
|
|
|
# Generate toolchain file for convenience
|
|
|
|
if(QT_HOST_PATH)
|
CMake: Fix handling of CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH
While trying to implement the 'host artifact reuse' Coin instructions
change, a bug surfaced where the qemu configurations didn't find
the host tools and instead tried to use the cross-compiled tools
while building qtbase, which failed due to not finding the
runtime linker (another unsolved issue).
Before the host artifact reuse change, the host tools were found
successfully.
The difference that caused the issue is that the target install prefix
was a direct subfolder of the host prefix.
host - /home/qt/work/qt/install
target - /home/qt/work/qt/install/target
Before the host reuse change the install prefixes were as follows
host - /home/qt/work/qt/install/host
target - /home/qt/work/qt/install/target
While looking for the Qt6CoreTools package, we temporarily set
CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH to contain first
'/home/qt/work/qt/install' and then '/home/qt/work/qt/install/target'.
CMake then reroots the CMAKE_PREFIX_PATH values onto values in
CMAKE_FIND_ROOT_PATH, making an MxN list of prefixes to search.
Rerooting essentially means concatenating 2 paths, unless the
considered prefix is a subfolder of the root path.
What happened was that the first considered value was
'/home/qt/work/qt/install/home/qt/work/qt/install', a non-existent
location that gets discarded.
The second considered value was '/home/qt/work/qt/install/target.
The second value is the result of seeing that
'/home/qt/work/qt/install/target' is a subfolder of
'/home/qt/work/qt/install' and thus the root path is stripped.
All of this is done in cmFindPackageCommand::FindConfig() ->
cmFindCommon::RerootPaths.
The behavior above caused the target tools be found instead of the
host ones.
Before the host reuse change, both of the initial constructed prefixes
were discared due to them not existing, e.g.
'/home/qt/work/qt/install/target/home/qt/work/qt/install/target'
and '/home/qt/work/qt/install/host/home/qt/work/qt/install/host'
One of the later prefixes combined CMAKE_FIND_ROOT_PATH ==
'/home/qt/work/qt/install/host' + CMAKE_PREFIX_PATH == '/' resulting
in '/home/qt/work/qt/install/host/' and this accidentally found the
host tools package.
We actually stumbled upon this issue a while ago when implementing Qt
5.14 Android CMake support in 52c799ed4425076df4353c02950ea1444fe5f102
That commit message mentions the fix is to add a "lib/cmake"
suffix to the PATHS option of find_package().
This would cause the subfolder => strip root behavior mentioned
above.
So finally the fix.
First, make sure not to append QT_HOST_PATH in the toolchain file,
there shouldn't be any need to do that, give that we temporarily set
it when looking for Tools packages.
Second, recreate the subdir scenario in the Qt toolchain file by
setting CMAKE_FIND_ROOT_PATH to the current (relocated) install
prefix as usual, but also setting CMAKE_PREFIX_PATH to a new value
poining to the CMake directory.
Aka '/home/alex/qt' and '/home/alex/qt/lib/cmake'.
Third, when a QT_HOST_PATH is given, save 2 paths in the generated Qt
toolchain: QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR. There are the host
equivalents of the target ones above. Use these values when looking
for host tools in Qt6CoreModuleDependencies.cmake, again facilitaing
the subdir behavior.
Note these are currently absolute paths and are not relocatable.
We'll have to figure out if it's even possible to make the host path
relocatable.
Finally as a cleanup, look for the Qt6HostInfo package in QtSetup
strictly in the given QT_HOST_PATH, so CMake doesn't accidentally find
a system Qt package.
Change-Id: Iefbcfbbcedd35f1c33417ab7e9f44eaf35ff6337
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-21 15:34:40 +00:00
|
|
|
# TODO: Figure out how to make these relocatable.
|
2020-09-15 09:51:59 +00:00
|
|
|
|
|
|
|
get_filename_component(__qt_host_path_absolute "${QT_HOST_PATH}" ABSOLUTE)
|
2020-09-07 15:48:56 +00:00
|
|
|
set(init_qt_host_path "
|
2020-09-15 09:51:59 +00:00
|
|
|
set(__qt_initial_qt_host_path \"${__qt_host_path_absolute}\")
|
2020-09-07 15:48:56 +00:00
|
|
|
if(NOT DEFINED QT_HOST_PATH AND EXISTS \"\${__qt_initial_qt_host_path}\")
|
|
|
|
set(QT_HOST_PATH \"\${__qt_initial_qt_host_path}\" CACHE PATH \"\" FORCE)
|
|
|
|
endif()")
|
2020-09-15 09:51:59 +00:00
|
|
|
|
|
|
|
get_filename_component(__qt_host_path_cmake_dir_absolute
|
CMake: Fix handling of CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH
While trying to implement the 'host artifact reuse' Coin instructions
change, a bug surfaced where the qemu configurations didn't find
the host tools and instead tried to use the cross-compiled tools
while building qtbase, which failed due to not finding the
runtime linker (another unsolved issue).
Before the host artifact reuse change, the host tools were found
successfully.
The difference that caused the issue is that the target install prefix
was a direct subfolder of the host prefix.
host - /home/qt/work/qt/install
target - /home/qt/work/qt/install/target
Before the host reuse change the install prefixes were as follows
host - /home/qt/work/qt/install/host
target - /home/qt/work/qt/install/target
While looking for the Qt6CoreTools package, we temporarily set
CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH to contain first
'/home/qt/work/qt/install' and then '/home/qt/work/qt/install/target'.
CMake then reroots the CMAKE_PREFIX_PATH values onto values in
CMAKE_FIND_ROOT_PATH, making an MxN list of prefixes to search.
Rerooting essentially means concatenating 2 paths, unless the
considered prefix is a subfolder of the root path.
What happened was that the first considered value was
'/home/qt/work/qt/install/home/qt/work/qt/install', a non-existent
location that gets discarded.
The second considered value was '/home/qt/work/qt/install/target.
The second value is the result of seeing that
'/home/qt/work/qt/install/target' is a subfolder of
'/home/qt/work/qt/install' and thus the root path is stripped.
All of this is done in cmFindPackageCommand::FindConfig() ->
cmFindCommon::RerootPaths.
The behavior above caused the target tools be found instead of the
host ones.
Before the host reuse change, both of the initial constructed prefixes
were discared due to them not existing, e.g.
'/home/qt/work/qt/install/target/home/qt/work/qt/install/target'
and '/home/qt/work/qt/install/host/home/qt/work/qt/install/host'
One of the later prefixes combined CMAKE_FIND_ROOT_PATH ==
'/home/qt/work/qt/install/host' + CMAKE_PREFIX_PATH == '/' resulting
in '/home/qt/work/qt/install/host/' and this accidentally found the
host tools package.
We actually stumbled upon this issue a while ago when implementing Qt
5.14 Android CMake support in 52c799ed4425076df4353c02950ea1444fe5f102
That commit message mentions the fix is to add a "lib/cmake"
suffix to the PATHS option of find_package().
This would cause the subfolder => strip root behavior mentioned
above.
So finally the fix.
First, make sure not to append QT_HOST_PATH in the toolchain file,
there shouldn't be any need to do that, give that we temporarily set
it when looking for Tools packages.
Second, recreate the subdir scenario in the Qt toolchain file by
setting CMAKE_FIND_ROOT_PATH to the current (relocated) install
prefix as usual, but also setting CMAKE_PREFIX_PATH to a new value
poining to the CMake directory.
Aka '/home/alex/qt' and '/home/alex/qt/lib/cmake'.
Third, when a QT_HOST_PATH is given, save 2 paths in the generated Qt
toolchain: QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR. There are the host
equivalents of the target ones above. Use these values when looking
for host tools in Qt6CoreModuleDependencies.cmake, again facilitaing
the subdir behavior.
Note these are currently absolute paths and are not relocatable.
We'll have to figure out if it's even possible to make the host path
relocatable.
Finally as a cleanup, look for the Qt6HostInfo package in QtSetup
strictly in the given QT_HOST_PATH, so CMake doesn't accidentally find
a system Qt package.
Change-Id: Iefbcfbbcedd35f1c33417ab7e9f44eaf35ff6337
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-21 15:34:40 +00:00
|
|
|
"${Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR}/.." ABSOLUTE)
|
|
|
|
set(init_qt_host_path_cmake_dir
|
2020-09-07 15:48:56 +00:00
|
|
|
"
|
2020-09-15 09:51:59 +00:00
|
|
|
set(__qt_initial_qt_host_path_cmake_dir \"${__qt_host_path_cmake_dir_absolute}\")
|
2020-09-07 15:48:56 +00:00
|
|
|
if(NOT DEFINED QT_HOST_PATH_CMAKE_DIR AND EXISTS \"\${__qt_initial_qt_host_path_cmake_dir}\")
|
|
|
|
set(QT_HOST_PATH_CMAKE_DIR \"\${__qt_initial_qt_host_path_cmake_dir}\" CACHE PATH \"\" FORCE)
|
|
|
|
endif()")
|
2020-09-15 11:00:22 +00:00
|
|
|
|
|
|
|
set(init_qt_host_path_checks "
|
|
|
|
if(NOT QT_HOST_PATH OR NOT EXISTS \"\${QT_HOST_PATH}\")
|
|
|
|
message(FATAL_ERROR \"To use a cross-compiled Qt, please specify a path to a host Qt installation by setting the QT_HOST_PATH cache variable.\")
|
|
|
|
endif()
|
|
|
|
if(NOT QT_HOST_PATH_CMAKE_DIR OR NOT EXISTS \"\${QT_HOST_PATH_CMAKE_DIR}\")
|
|
|
|
message(FATAL_ERROR \"To use a cross-compiled Qt, please specify a path to a host Qt installation CMake directory by setting the QT_HOST_PATH_CMAKE_DIR cache variable.\")
|
|
|
|
endif()")
|
2019-06-21 12:58:52 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_TOOLCHAIN_FILE)
|
2020-09-08 13:31:39 +00:00
|
|
|
file(TO_CMAKE_PATH "${CMAKE_TOOLCHAIN_FILE}" __qt_chainload_toolchain_file)
|
|
|
|
set(init_original_toolchain_file "set(__qt_chainload_toolchain_file \"${__qt_chainload_toolchain_file}\")")
|
2019-06-21 12:58:52 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
|
|
|
|
list(APPEND init_vcpkg "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}\")")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_TRIPLET)
|
2019-06-24 14:55:20 +00:00
|
|
|
list(APPEND init_vcpkg "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")")
|
2019-06-21 12:58:52 +00:00
|
|
|
endif()
|
|
|
|
|
2020-06-18 15:06:22 +00:00
|
|
|
# By default we don't want to allow mixing compilers for building different repositories, so we
|
|
|
|
# embed the initially chosen compilers into the toolchain.
|
|
|
|
# This is because on Windows compilers aren't easily mixed.
|
|
|
|
# We want to avoid that qtbase is built using cl.exe for example, and then for another repo
|
|
|
|
# gcc is picked up from %PATH%.
|
|
|
|
# The same goes when using a custom compiler on other platforms, such as ICC.
|
|
|
|
#
|
|
|
|
# There are a few exceptions though.
|
|
|
|
#
|
|
|
|
# When crosscompiling using Boot2Qt, the environment setup shell script sets up the CXX env var,
|
|
|
|
# which is used by CMake to determine the initial compiler that should be used.
|
|
|
|
# Unfortunately, the CXX env var contains not only the compiler name, but also a few required
|
|
|
|
# arch-specific compiler flags. This means that when building qtsvg, if the Qt created toolchain
|
|
|
|
# file sets the CMAKE_CXX_COMPILER variable, the CXX env var is ignored and thus the extra
|
|
|
|
# arch specific compiler flags are not picked up anymore, leading to a configuration failure.
|
|
|
|
#
|
|
|
|
# To avoid this issue, disable automatic embedding of the compilers into the qt toolchain when
|
|
|
|
# cross compiling. This is merely a heuristic, becacuse we don't have enough data to decide
|
|
|
|
# when to do it or not.
|
|
|
|
# For example on Linux one might want to allow mixing of clang and gcc (maybe).
|
|
|
|
#
|
|
|
|
# To allow such use cases when the default is wrong, one can provide a flag to explicitly opt-in
|
|
|
|
# or opt-out of the compiler embedding into the Qt toolchain.
|
|
|
|
#
|
|
|
|
# Passing -DQT_EMBED_TOOLCHAIN_COMPILER=ON will force embedding of the compilers.
|
|
|
|
# Passing -DQT_EMBED_TOOLCHAIN_COMPILER=OFF will disable embedding of the compilers.
|
|
|
|
set(__qt_embed_toolchain_compilers TRUE)
|
|
|
|
if(CMAKE_CROSSCOMPILING)
|
|
|
|
set(__qt_embed_toolchain_compilers FALSE)
|
|
|
|
endif()
|
|
|
|
if(DEFINED QT_EMBED_TOOLCHAIN_COMPILER)
|
|
|
|
if(QT_EMBED_TOOLCHAIN_COMPILER)
|
|
|
|
set(__qt_embed_toolchain_compilers TRUE)
|
|
|
|
else()
|
|
|
|
set(__qt_embed_toolchain_compilers FALSE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if(__qt_embed_toolchain_compilers)
|
2020-09-15 10:23:51 +00:00
|
|
|
list(APPEND init_platform "
|
|
|
|
set(__qt_initial_c_compiler \"${CMAKE_C_COMPILER}\")
|
|
|
|
set(__qt_initial_cxx_compiler \"${CMAKE_CXX_COMPILER}\")
|
|
|
|
if(NOT DEFINED CMAKE_C_COMPILER AND EXISTS \"\${__qt_initial_c_compiler}\")
|
|
|
|
set(CMAKE_C_COMPILER \"\${__qt_initial_c_compiler}\" CACHE STRING \"\")
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS \"\${__qt_initial_cxx_compiler}\")
|
|
|
|
set(CMAKE_CXX_COMPILER \"\${__qt_initial_cxx_compiler}\" CACHE STRING \"\")
|
|
|
|
endif()")
|
2020-06-18 15:06:22 +00:00
|
|
|
endif()
|
|
|
|
unset(__qt_embed_toolchain_compilers)
|
2019-09-03 07:09:06 +00:00
|
|
|
|
2019-06-26 10:39:05 +00:00
|
|
|
if(APPLE)
|
2019-04-08 15:23:57 +00:00
|
|
|
# For simulator_and_device build, we should not explicitly set the sysroot.
|
|
|
|
list(LENGTH CMAKE_OSX_ARCHITECTURES _qt_osx_architectures_count)
|
2020-03-16 12:36:47 +00:00
|
|
|
if(CMAKE_OSX_SYSROOT AND NOT _qt_osx_architectures_count GREATER 1 AND UIKIT)
|
2020-09-07 15:48:56 +00:00
|
|
|
list(APPEND init_platform "
|
|
|
|
set(__qt_initial_cmake_osx_sysroot \"${CMAKE_OSX_SYSROOT}\")
|
|
|
|
if(NOT DEFINED CMAKE_OSX_SYSROOT AND EXISTS \"\${__qt_initial_cmake_osx_sysroot}\")
|
|
|
|
set(CMAKE_OSX_SYSROOT \"\${__qt_initial_cmake_osx_sysroot}\" CACHE PATH \"\")
|
|
|
|
endif()")
|
2019-06-26 10:39:05 +00:00
|
|
|
endif()
|
2019-04-08 15:23:57 +00:00
|
|
|
unset(_qt_osx_architectures_count)
|
|
|
|
|
2019-06-26 10:39:05 +00:00
|
|
|
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
2019-04-08 15:23:57 +00:00
|
|
|
list(APPEND init_platform
|
|
|
|
"set(CMAKE_OSX_DEPLOYMENT_TARGET \"${CMAKE_OSX_DEPLOYMENT_TARGET}\" CACHE STRING \"\")")
|
|
|
|
endif()
|
|
|
|
|
2020-03-16 12:36:47 +00:00
|
|
|
if(UIKIT)
|
2019-04-08 15:23:57 +00:00
|
|
|
list(APPEND init_platform
|
|
|
|
"set(CMAKE_SYSTEM_NAME \"${CMAKE_SYSTEM_NAME}\" CACHE STRING \"\")")
|
|
|
|
set(_qt_osx_architectures_escaped "${CMAKE_OSX_ARCHITECTURES}")
|
|
|
|
string(REPLACE ";" "LITERAL_SEMICOLON"
|
|
|
|
_qt_osx_architectures_escaped "${_qt_osx_architectures_escaped}")
|
|
|
|
list(APPEND init_platform
|
|
|
|
"set(CMAKE_OSX_ARCHITECTURES \"${_qt_osx_architectures_escaped}\" CACHE STRING \"\")")
|
|
|
|
unset(_qt_osx_architectures_escaped)
|
2019-06-26 10:39:05 +00:00
|
|
|
endif()
|
2019-06-27 13:27:14 +00:00
|
|
|
elseif(ANDROID)
|
|
|
|
list(APPEND init_platform "set(ANDROID_NATIVE_API_LEVEL \"${ANDROID_NATIVE_API_LEVEL}\" CACHE STRING \"\")")
|
|
|
|
list(APPEND init_platform "set(ANDROID_STL \"${ANDROID_STL}\" CACHE STRING \"\")")
|
|
|
|
list(APPEND init_platform "set(ANDROID_ABI \"${ANDROID_ABI}\" CACHE STRING \"\")")
|
2019-08-16 14:32:57 +00:00
|
|
|
list(APPEND init_platform "if (NOT DEFINED ANDROID_SDK_ROOT)")
|
2020-09-08 13:31:39 +00:00
|
|
|
file(TO_CMAKE_PATH "${ANDROID_SDK_ROOT}" __qt_android_sdk_root)
|
|
|
|
list(APPEND init_platform " set(ANDROID_SDK_ROOT \"${__qt_android_sdk_root}\" CACHE STRING \"\")")
|
2019-08-16 14:32:57 +00:00
|
|
|
list(APPEND init_platform "endif()")
|
2019-06-26 10:39:05 +00:00
|
|
|
endif()
|
|
|
|
|
2019-06-21 12:58:52 +00:00
|
|
|
string(REPLACE ";" "\n" init_vcpkg "${init_vcpkg}")
|
2019-06-26 10:39:05 +00:00
|
|
|
string(REPLACE ";" "\n" init_platform "${init_platform}")
|
2019-04-08 15:23:57 +00:00
|
|
|
string(REPLACE "LITERAL_SEMICOLON" ";" init_platform "${init_platform}")
|
CMake: Make build system of installed Qt more relocatable
Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way.
The following story inspired this change.
If a user wants to build a Qt repo into a different install prefix
than the usual Qt one, this will fail configuration because we
look for various things like syncqt, qdoc, etc relative to
CMAKE_INSTALL_PREFIX, which will now point to a different location
where none of the above tools are located.
The intent for such a use case is to support building Qt packages with
Conan, which sets a random install prefix when configuring a repo.
The idea is to derive the qt prefix dynamically from the
QtBuildInternals package location. Essentially it's a reverse relative
path from the QtBuildInternalsConfig.cmake file to the install prefix
that was specified when initially configuring qtbase.
Once the dynamic prefix is computed (so we know where the possibly
relocated Qt is), we can find tools like syncqt and qdoc.
This is an initial attempt to support a use case like that.
More design work will probably needed in case if tools / libs need to
be found in a location different than the Qt install prefix (so
support for multiple install prefixes / search paths).
An example of such a case would be when building qtdeclarative and
qtquickcontrols2 as Conan packages in one go. Most likely the
qmltyperegistrar tool will be located in the random install prefix
set by Conan, so building qtquickcontrols2 might fail due to not
finding the tool in the original Qt install prefix.
As to the implementation details, the change does the following:
- Dynamically computes and sets the
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when
find_package()'ing QtBuildInternals. It's an absolute path
pointing to where the relocated Qt is.
- When building qtbase this variable is not yet available (due
to QtBuildInternalsExtra not existing), in that case we set
the variable to the absolute path of CMAKE_INSTALL_PREFIX
(but only for the initial qtbase configuration).
- Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used
for standalone tests purposes. It's not needed now that we compute
the location of the Qt prefix dynamically.
- The Unixy qt-cmake and qt-cmake-private shell scripts now
use a relative path to find the toolchain file we created.
- The toolchain file also dynamically computes the location of the Qt
packages, and adds them to CMAKE_PREFIX_PATH.
- A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding
tool locations, mkspecs dir, path environment setup for tools, etc.
- Some places still use CMAKE_PREFIX_PATH in the following cases
- When determining paths while configuring qtbase (valid cases)
- When I wasn't sure what the behavior should be, so I left them
as-is (an example is documentation generation, do we want to
install it into the random Conan prefix, or into the main prefix?
Currently it installs in the random prefix).
Note that relocating a Qt installation does not work for non-prefix /
non-installed builds, due to hardcoded paths to include directories
and libraries in generated FooTargets.cmake files.
Task-number: QTBUG-83999
Change-Id: I87d6558729db93121b1715771034b03ce3295923
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-05 08:30:35 +00:00
|
|
|
qt_compute_relative_path_from_cmake_config_dir_to_prefix()
|
2019-06-21 12:58:52 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt.toolchain.cmake.in" "${__GlobalConfig_build_dir}/qt.toolchain.cmake" @ONLY)
|
CMake: Make build system of installed Qt more relocatable
Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way.
The following story inspired this change.
If a user wants to build a Qt repo into a different install prefix
than the usual Qt one, this will fail configuration because we
look for various things like syncqt, qdoc, etc relative to
CMAKE_INSTALL_PREFIX, which will now point to a different location
where none of the above tools are located.
The intent for such a use case is to support building Qt packages with
Conan, which sets a random install prefix when configuring a repo.
The idea is to derive the qt prefix dynamically from the
QtBuildInternals package location. Essentially it's a reverse relative
path from the QtBuildInternalsConfig.cmake file to the install prefix
that was specified when initially configuring qtbase.
Once the dynamic prefix is computed (so we know where the possibly
relocated Qt is), we can find tools like syncqt and qdoc.
This is an initial attempt to support a use case like that.
More design work will probably needed in case if tools / libs need to
be found in a location different than the Qt install prefix (so
support for multiple install prefixes / search paths).
An example of such a case would be when building qtdeclarative and
qtquickcontrols2 as Conan packages in one go. Most likely the
qmltyperegistrar tool will be located in the random install prefix
set by Conan, so building qtquickcontrols2 might fail due to not
finding the tool in the original Qt install prefix.
As to the implementation details, the change does the following:
- Dynamically computes and sets the
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when
find_package()'ing QtBuildInternals. It's an absolute path
pointing to where the relocated Qt is.
- When building qtbase this variable is not yet available (due
to QtBuildInternalsExtra not existing), in that case we set
the variable to the absolute path of CMAKE_INSTALL_PREFIX
(but only for the initial qtbase configuration).
- Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used
for standalone tests purposes. It's not needed now that we compute
the location of the Qt prefix dynamically.
- The Unixy qt-cmake and qt-cmake-private shell scripts now
use a relative path to find the toolchain file we created.
- The toolchain file also dynamically computes the location of the Qt
packages, and adds them to CMAKE_PREFIX_PATH.
- A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding
tool locations, mkspecs dir, path environment setup for tools, etc.
- Some places still use CMAKE_PREFIX_PATH in the following cases
- When determining paths while configuring qtbase (valid cases)
- When I wasn't sure what the behavior should be, so I left them
as-is (an example is documentation generation, do we want to
install it into the random Conan prefix, or into the main prefix?
Currently it installs in the random prefix).
Note that relocating a Qt installation does not work for non-prefix /
non-installed builds, due to hardcoded paths to include directories
and libraries in generated FooTargets.cmake files.
Task-number: QTBUG-83999
Change-Id: I87d6558729db93121b1715771034b03ce3295923
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-05 08:30:35 +00:00
|
|
|
unset(qt_path_from_cmake_config_dir_to_prefix)
|
2019-06-21 12:58:52 +00:00
|
|
|
qt_install(FILES "${__GlobalConfig_build_dir}/qt.toolchain.cmake" DESTINATION "${__GlobalConfig_install_dir}" COMPONENT Devel)
|
|
|
|
|
|
|
|
# Also provide a convenience cmake wrapper
|
2020-08-28 11:15:35 +00:00
|
|
|
if(CMAKE_HOST_UNIX)
|
2019-06-21 12:58:52 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in" "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake" @ONLY)
|
2020-01-21 14:02:58 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake" DESTINATION "${INSTALL_BINDIR}")
|
2019-06-25 07:54:09 +00:00
|
|
|
else()
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.bat.in" "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake.bat" @ONLY)
|
2020-01-21 14:02:58 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake.bat" DESTINATION "${INSTALL_BINDIR}")
|
2019-06-21 12:58:52 +00:00
|
|
|
endif()
|
|
|
|
|
2019-12-06 14:12:17 +00:00
|
|
|
# Provide a private convenience wrapper with options which should not be propagated via the public
|
|
|
|
# qt-cmake wrapper e.g. CMAKE_GENERATOR.
|
|
|
|
# These options can not be set in a toolchain file, but only on the command line.
|
|
|
|
# These options should not be in the public wrapper, because a consumer of Qt might want to build
|
|
|
|
# their CMake app with the Unix Makefiles generator, while Qt should be built with the Ninja
|
|
|
|
# generator.
|
|
|
|
# The private wrapper is more conveient for building Qt itself, because a developer doesn't need
|
|
|
|
# to specify the same options for each qt module built.
|
2020-01-29 11:51:47 +00:00
|
|
|
set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\"")
|
2020-08-28 11:15:35 +00:00
|
|
|
if(CMAKE_HOST_UNIX)
|
2019-12-06 14:12:17 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private" @ONLY)
|
2020-01-21 14:02:58 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private" DESTINATION "${INSTALL_BINDIR}")
|
2019-12-06 14:12:17 +00:00
|
|
|
else()
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.bat.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private.bat" @ONLY)
|
2020-01-21 14:02:58 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private.bat" DESTINATION "${INSTALL_BINDIR}")
|
2019-12-06 14:12:17 +00:00
|
|
|
endif()
|
|
|
|
unset(__qt_cmake_extra)
|
|
|
|
|
2020-08-31 08:38:53 +00:00
|
|
|
# Provide a script to configure Qt modules.
|
|
|
|
if(QT_WILL_INSTALL)
|
|
|
|
set(__relative_path_to_processconfigureargs_script
|
|
|
|
"${__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir}")
|
|
|
|
else()
|
|
|
|
file(RELATIVE_PATH __relative_path_to_processconfigureargs_script
|
|
|
|
"${__qt_bin_dir_absolute}" "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
endif()
|
|
|
|
string(APPEND __relative_path_to_processconfigureargs_script "/QtProcessConfigureArgs.cmake")
|
|
|
|
file(TO_NATIVE_PATH "${__relative_path_to_processconfigureargs_script}"
|
|
|
|
__relative_path_to_processconfigureargs_script)
|
|
|
|
if(CMAKE_HOST_UNIX)
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-configure-module.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module" @ONLY)
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
else()
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-configure-module.bat.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module.bat" @ONLY)
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module.bat"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
endif()
|
|
|
|
unset(__relative_path_to_processconfigureargs_script)
|
|
|
|
|
2020-03-18 18:09:00 +00:00
|
|
|
# Provide a private convenience wrapper to configure and build one or more standalone tests.
|
|
|
|
# Calling CMake directly on a Qt test project won't work because the project does not call
|
|
|
|
# find_package(Qt...) to get all dependencies like examples do.
|
|
|
|
# Instead a template CMakeLists.txt project is used which sets up all the necessary private bits
|
|
|
|
# and then calls add_subdirectory on the provided project path.
|
|
|
|
set(__qt_cmake_standalone_test_bin_name "qt-cmake-standalone-test")
|
CMake: Make build system of installed Qt more relocatable
Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way.
The following story inspired this change.
If a user wants to build a Qt repo into a different install prefix
than the usual Qt one, this will fail configuration because we
look for various things like syncqt, qdoc, etc relative to
CMAKE_INSTALL_PREFIX, which will now point to a different location
where none of the above tools are located.
The intent for such a use case is to support building Qt packages with
Conan, which sets a random install prefix when configuring a repo.
The idea is to derive the qt prefix dynamically from the
QtBuildInternals package location. Essentially it's a reverse relative
path from the QtBuildInternalsConfig.cmake file to the install prefix
that was specified when initially configuring qtbase.
Once the dynamic prefix is computed (so we know where the possibly
relocated Qt is), we can find tools like syncqt and qdoc.
This is an initial attempt to support a use case like that.
More design work will probably needed in case if tools / libs need to
be found in a location different than the Qt install prefix (so
support for multiple install prefixes / search paths).
An example of such a case would be when building qtdeclarative and
qtquickcontrols2 as Conan packages in one go. Most likely the
qmltyperegistrar tool will be located in the random install prefix
set by Conan, so building qtquickcontrols2 might fail due to not
finding the tool in the original Qt install prefix.
As to the implementation details, the change does the following:
- Dynamically computes and sets the
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when
find_package()'ing QtBuildInternals. It's an absolute path
pointing to where the relocated Qt is.
- When building qtbase this variable is not yet available (due
to QtBuildInternalsExtra not existing), in that case we set
the variable to the absolute path of CMAKE_INSTALL_PREFIX
(but only for the initial qtbase configuration).
- Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used
for standalone tests purposes. It's not needed now that we compute
the location of the Qt prefix dynamically.
- The Unixy qt-cmake and qt-cmake-private shell scripts now
use a relative path to find the toolchain file we created.
- The toolchain file also dynamically computes the location of the Qt
packages, and adds them to CMAKE_PREFIX_PATH.
- A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding
tool locations, mkspecs dir, path environment setup for tools, etc.
- Some places still use CMAKE_PREFIX_PATH in the following cases
- When determining paths while configuring qtbase (valid cases)
- When I wasn't sure what the behavior should be, so I left them
as-is (an example is documentation generation, do we want to
install it into the random Conan prefix, or into the main prefix?
Currently it installs in the random prefix).
Note that relocating a Qt installation does not work for non-prefix /
non-installed builds, due to hardcoded paths to include directories
and libraries in generated FooTargets.cmake files.
Task-number: QTBUG-83999
Change-Id: I87d6558729db93121b1715771034b03ce3295923
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-05 08:30:35 +00:00
|
|
|
set(__qt_cmake_private_path
|
2020-07-07 11:05:45 +00:00
|
|
|
"${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private")
|
2020-03-18 18:09:00 +00:00
|
|
|
set(__qt_cmake_standalone_test_path
|
|
|
|
"${__build_internals_install_dir}/${__build_internals_standalone_test_template_dir}")
|
2020-06-04 16:21:13 +00:00
|
|
|
|
|
|
|
if(QT_WILL_INSTALL)
|
2020-07-07 11:05:45 +00:00
|
|
|
# Need to prepend the staging prefix when doing prefix builds, because the build internals
|
2020-06-04 16:21:13 +00:00
|
|
|
# install dir is relative in that case..
|
|
|
|
qt_path_join(__qt_cmake_standalone_test_path
|
2020-07-07 11:05:45 +00:00
|
|
|
"${QT_STAGING_PREFIX}"
|
2020-06-04 16:21:13 +00:00
|
|
|
"${__qt_cmake_standalone_test_path}")
|
|
|
|
endif()
|
2020-08-28 11:15:35 +00:00
|
|
|
if(CMAKE_HOST_UNIX)
|
2020-06-19 11:34:48 +00:00
|
|
|
set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")
|
2020-03-18 18:09:00 +00:00
|
|
|
string(PREPEND __qt_cmake_private_path "exec ")
|
|
|
|
set(__qt_cmake_standalone_passed_args "\"$@\" -DPWD=\"$PWD\"")
|
|
|
|
else()
|
2020-06-19 11:34:48 +00:00
|
|
|
set(__qt_cmake_standalone_test_os_prelude "@echo off")
|
2020-03-18 18:09:00 +00:00
|
|
|
string(APPEND __qt_cmake_standalone_test_bin_name ".bat")
|
|
|
|
string(APPEND __qt_cmake_private_path ".bat")
|
|
|
|
set(__qt_cmake_standalone_passed_args "%* -DPWD=\"%CD%\"")
|
|
|
|
endif()
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-standalone-test.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_standalone_test_bin_name}")
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_standalone_test_bin_name}"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
|
2020-05-15 09:38:53 +00:00
|
|
|
# Create an installation script that the CI can use to handle installation for both
|
|
|
|
# single and multiple configurations.
|
|
|
|
set(__qt_cmake_install_script_name "qt-cmake-private-install.cmake")
|
|
|
|
if(CMAKE_CONFIGURATION_TYPES)
|
|
|
|
set(__qt_configured_configs "${CMAKE_CONFIGURATION_TYPES}")
|
|
|
|
elseif(CMAKE_BUILD_TYPE)
|
|
|
|
set(__qt_configured_configs "${CMAKE_BUILD_TYPE}")
|
|
|
|
endif()
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/${__qt_cmake_install_script_name}.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}" @ONLY)
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
## Library to hold global features:
|
2019-01-10 09:50:38 +00:00
|
|
|
## These features are stored and accessed via Qt::GlobalConfig, but the
|
|
|
|
## files always lived in Qt::Core, so we keep it that way
|
|
|
|
add_library(GlobalConfig INTERFACE)
|
|
|
|
target_include_directories(GlobalConfig INTERFACE
|
2020-08-06 07:56:58 +00:00
|
|
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
|
|
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore>
|
2020-05-05 14:57:58 +00:00
|
|
|
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}>
|
|
|
|
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/QtCore>
|
2019-01-10 09:50:38 +00:00
|
|
|
)
|
2019-05-16 07:46:29 +00:00
|
|
|
qt_feature_module_begin(NO_MODULE
|
2018-10-24 13:20:27 +00:00
|
|
|
PUBLIC_FILE src/corelib/global/qconfig.h
|
|
|
|
PRIVATE_FILE src/corelib/global/qconfig_p.h
|
|
|
|
)
|
|
|
|
include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake")
|
2019-04-08 15:23:57 +00:00
|
|
|
|
|
|
|
# Do what mkspecs/features/uikit/default_pre.prf does, aka enable sse2 for
|
|
|
|
# simulator_and_device_builds.
|
2020-03-16 12:36:47 +00:00
|
|
|
if(UIKIT AND NOT QT_UIKIT_SDK)
|
2019-04-08 15:23:57 +00:00
|
|
|
set(__QtFeature_custom_enabled_cache_variables
|
|
|
|
TEST_subarch_sse2
|
|
|
|
FEATURE_sse2
|
|
|
|
QT_FEATURE_sse2)
|
|
|
|
endif()
|
|
|
|
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
qt_feature_module_end(GlobalConfig OUT_VAR_PREFIX "__GlobalConfig_")
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2019-05-29 14:56:49 +00:00
|
|
|
qt_generate_global_config_pri_file()
|
2019-08-28 13:15:50 +00:00
|
|
|
qt_generate_global_module_pri_file()
|
2020-06-26 18:45:11 +00:00
|
|
|
qt_generate_global_device_pri_file()
|
2020-06-18 08:07:22 +00:00
|
|
|
qt_generate_qmake_wrapper_for_target()
|
2019-05-29 14:56:49 +00:00
|
|
|
|
2019-01-10 09:50:38 +00:00
|
|
|
add_library(Qt::GlobalConfig ALIAS GlobalConfig)
|
|
|
|
|
|
|
|
add_library(GlobalConfigPrivate INTERFACE)
|
|
|
|
target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig)
|
|
|
|
target_include_directories(GlobalConfigPrivate INTERFACE
|
2020-08-06 07:56:58 +00:00
|
|
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}>
|
|
|
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore>
|
2020-05-05 14:57:58 +00:00
|
|
|
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/QtCore/${PROJECT_VERSION}>
|
|
|
|
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/QtCore/${PROJECT_VERSION}/QtCore>
|
2019-01-10 09:50:38 +00:00
|
|
|
)
|
|
|
|
add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate)
|
|
|
|
|
2020-03-11 13:44:12 +00:00
|
|
|
# Propagate minimum C++ 17 via Platform to Qt consumers (apps), after the global features
|
|
|
|
# are computed.
|
|
|
|
qt_set_language_standards_interface_compile_features(Platform)
|
|
|
|
|
2020-05-12 12:57:23 +00:00
|
|
|
# By default enable utf8 sources for both Qt and Qt consumers. Can be opted out.
|
|
|
|
qt_enable_utf8_sources(Platform)
|
|
|
|
|
2019-06-24 12:59:21 +00:00
|
|
|
# defines PlatformCommonInternal PlatformModuleInternal PlatformPluginInternal PlatformToolInternal
|
2019-06-05 14:05:50 +00:00
|
|
|
include(QtInternalTargets)
|
|
|
|
|
2019-06-24 12:59:21 +00:00
|
|
|
set(__export_targets Platform
|
|
|
|
GlobalConfig
|
|
|
|
GlobalConfigPrivate
|
|
|
|
PlatformCommonInternal
|
|
|
|
PlatformModuleInternal
|
|
|
|
PlatformPluginInternal
|
2020-07-27 08:17:04 +00:00
|
|
|
PlatformAppInternal
|
2019-06-24 12:59:21 +00:00
|
|
|
PlatformToolInternal)
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
set(__export_name "${INSTALL_CMAKE_NAMESPACE}Targets")
|
|
|
|
qt_install(TARGETS ${__export_targets} EXPORT "${__export_name}")
|
|
|
|
qt_install(EXPORT ${__export_name}
|
|
|
|
NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}::
|
|
|
|
DESTINATION "${__GlobalConfig_install_dir}")
|
2018-10-24 13:20:27 +00:00
|
|
|
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
qt_internal_export_modern_cmake_config_targets_file(TARGETS ${__export_targets}
|
2019-05-03 10:30:09 +00:00
|
|
|
EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
CONFIG_INSTALL_DIR
|
|
|
|
${__GlobalConfig_install_dir})
|
2019-05-03 10:30:09 +00:00
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
## Install some QtBase specific CMake files:
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
qt_copy_or_install(FILES
|
2019-09-24 09:42:15 +00:00
|
|
|
cmake/ModuleDescription.json.in
|
2020-03-23 13:43:02 +00:00
|
|
|
cmake/Qt3rdPartyLibraryConfig.cmake.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/Qt3rdPartyLibraryHelpers.cmake
|
|
|
|
cmake/QtAppHelpers.cmake
|
|
|
|
cmake/QtAutogenHelpers.cmake
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
cmake/QtBuild.cmake
|
2019-11-21 12:33:28 +00:00
|
|
|
cmake/QtBuildInformation.cmake
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtCMakeHelpers.cmake
|
|
|
|
cmake/QtCompatibilityHelpers.cmake
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
cmake/QtCompilerFlags.cmake
|
|
|
|
cmake/QtCompilerOptimization.cmake
|
2020-08-03 14:28:16 +00:00
|
|
|
cmake/QtConfigDependencies.cmake.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtDbusHelpers.cmake
|
|
|
|
cmake/QtDocsHelpers.cmake
|
|
|
|
cmake/QtExecutableHelpers.cmake
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
cmake/QtFeature.cmake
|
2020-08-12 07:17:21 +00:00
|
|
|
cmake/QtFeatureCommon.cmake
|
CMake: Introduce qt_configure_file
It has the same kind of signature as file(GENERATE) but
creates the files at configure time rather than generation time.
CMake provides a few ways to generate files
file(WRITE) -> always overrides content
configure_file() -> only overrides if content changes, creates file
at configure time, can only take a file as input
file(GENERATE) -> only overrides if content changes, creats file
at generation time, can take a string or file
as input
Because dealing with an input file is a hassle (need to create one,
make sure it's installed, make sure it's used correctly in the
various build types like super-build, non-prefix-build, etc)
people tend to use file(GENERATE) instead, which can take a string
argument, and is thus easier to use.
Unfortunately that introduces subtle bugs because the
file is created at generation time, but there are existence
checks which are done at configuration time.
Thus qt_configure_file allows creation of files at configure time,
without having to provide an input file. Underneath it uses
configure_file(). Once CMake 3.18 is released, the implementation
can be switched to use file(CONFIGURE).
Change-Id: Ic8f8d88541ef0b25d01af143352c8c9ba390ad5f
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-20 14:03:54 +00:00
|
|
|
cmake/QtFileConfigure.txt.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtFindPackageHelpers.cmake
|
|
|
|
cmake/QtFindWrapConfigExtra.cmake.in
|
|
|
|
cmake/QtFindWrapHelper.cmake
|
|
|
|
cmake/QtFinishPrlFile.cmake
|
|
|
|
cmake/QtFlagHandlingHelpers.cmake
|
|
|
|
cmake/QtFrameworkHelpers.cmake
|
2020-04-22 19:01:32 +00:00
|
|
|
cmake/QtGenerateExtPri.cmake
|
2020-07-30 17:17:09 +00:00
|
|
|
cmake/QtGenerateLibHelpers.cmake
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtGenerateLibPri.cmake
|
|
|
|
cmake/QtGlobalStateHelpers.cmake
|
2020-08-26 20:19:55 +00:00
|
|
|
cmake/QtHeadersClean.cmake
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtInstallHelpers.cmake
|
|
|
|
cmake/QtLalrHelpers.cmake
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
cmake/QtModuleConfig.cmake.in
|
|
|
|
cmake/QtModuleDependencies.cmake.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtModuleHelpers.cmake
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
cmake/QtModuleToolsConfig.cmake.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtModuleToolsDependencies.cmake.in
|
2019-12-06 13:29:18 +00:00
|
|
|
cmake/QtModuleToolsVersionlessTargets.cmake.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtNoLinkTargetHelpers.cmake
|
|
|
|
cmake/QtPlatformAndroid.cmake
|
|
|
|
cmake/QtPlatformSupport.cmake
|
2019-06-04 13:37:55 +00:00
|
|
|
cmake/QtPluginConfig.cmake.in
|
|
|
|
cmake/QtPluginDependencies.cmake.in
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtPluginHelpers.cmake
|
|
|
|
cmake/QtPlugins.cmake.in
|
|
|
|
cmake/QtPostProcess.cmake
|
2020-08-14 08:24:57 +00:00
|
|
|
cmake/QtPostProcessHelpers.cmake
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtPrecompiledHeadersHelpers.cmake
|
|
|
|
cmake/QtPriHelpers.cmake
|
|
|
|
cmake/QtPrlHelpers.cmake
|
2020-08-31 08:38:53 +00:00
|
|
|
cmake/QtProcessConfigureArgs.cmake
|
2020-08-13 15:37:47 +00:00
|
|
|
cmake/QtQmakeHelpers.cmake
|
|
|
|
cmake/QtResourceHelpers.cmake
|
|
|
|
cmake/QtRpathHelpers.cmake
|
|
|
|
cmake/QtSanitizerHelpers.cmake
|
|
|
|
cmake/QtScopeFinalizerHelpers.cmake
|
|
|
|
cmake/QtSeparateDebugInfo.Info.plist.in
|
|
|
|
cmake/QtSeparateDebugInfo.cmake
|
|
|
|
cmake/QtSetup.cmake
|
|
|
|
cmake/QtSimdHelpers.cmake
|
|
|
|
cmake/QtStandaloneTestsConfig.cmake.in
|
|
|
|
cmake/QtSyncQtHelpers.cmake
|
|
|
|
cmake/QtTargetHelpers.cmake
|
|
|
|
cmake/QtTestHelpers.cmake
|
|
|
|
cmake/QtToolHelpers.cmake
|
2020-09-11 17:28:01 +00:00
|
|
|
cmake/QtJavaHelpers.cmake
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
DESTINATION "${__GlobalConfig_install_dir}"
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
|
2019-11-21 12:33:28 +00:00
|
|
|
file(COPY cmake/QtFeature.cmake DESTINATION "${__GlobalConfig_build_dir}")
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
|
2019-02-13 08:45:57 +00:00
|
|
|
# TODO: Check whether this is the right place to install these
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
qt_copy_or_install(DIRECTORY cmake/3rdparty DESTINATION "${__GlobalConfig_install_dir}")
|
Write find_dependency() calls in Qt Module config files
This change introduces a new function called qt_find_package()
which can take an extra option called PROVIDED_TARGETS, which
associates targets with the package that defines those targets.
This is done by setting the INTERFACE_QT_PACKAGE_NAME and
INTERFACE_QT_PACKAGE_VERSION properties on the imported targets.
This information allows us to generate appropriate find_dependency()
calls in a module's Config file for third party libraries.
For example when an application links against QtCore, it should also
link against zlib and atomic libraries. In order to do that, the
library locations first have to be found by CMake. This is achieved by
embedding find_dependency(ZLIB) and find_dependency(Atomic) in
Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake.
The latter is picked up when an application project contains
find_package(Qt5Core), and thus all linking dependencies are resolved.
The information 'which package provides which targets' is contained
in the python json2cmake conversion script. The generated output of
the script contains qt_find_package() calls that represent that
information.
The Qt5CoreDependencies.cmake file and which which dependencies it
contains is generated at the QtPostProcess stop.
Note that for non-static Qt builds, we only need to propagate public
3rd party libraries. For static builds, we need all third party
libraries.
In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any
scope, the targets on which the property is set, have to be GLOBAL.
Also for applications and other modules to find all required third
party libraries, we have to install all our custom Find modules, and
make sure they define INTERFACE IMPORTED libraries, and not just
IMPORTED libraries.
Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-24 15:14:25 +00:00
|
|
|
|
|
|
|
# Install our custom Find modules, which will be used by the find_dependency() calls
|
|
|
|
# inside the generated ModuleDependencies cmake files.
|
Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.
To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).
When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.
Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).
This patch stops installation of any files by forcing the
make "install" target be a no-op.
When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.
The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.
As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.
Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.
The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.
All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.
When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.
Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.
Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-08 12:45:41 +00:00
|
|
|
qt_copy_or_install(DIRECTORY cmake/
|
|
|
|
DESTINATION "${__GlobalConfig_install_dir}"
|
Write find_dependency() calls in Qt Module config files
This change introduces a new function called qt_find_package()
which can take an extra option called PROVIDED_TARGETS, which
associates targets with the package that defines those targets.
This is done by setting the INTERFACE_QT_PACKAGE_NAME and
INTERFACE_QT_PACKAGE_VERSION properties on the imported targets.
This information allows us to generate appropriate find_dependency()
calls in a module's Config file for third party libraries.
For example when an application links against QtCore, it should also
link against zlib and atomic libraries. In order to do that, the
library locations first have to be found by CMake. This is achieved by
embedding find_dependency(ZLIB) and find_dependency(Atomic) in
Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake.
The latter is picked up when an application project contains
find_package(Qt5Core), and thus all linking dependencies are resolved.
The information 'which package provides which targets' is contained
in the python json2cmake conversion script. The generated output of
the script contains qt_find_package() calls that represent that
information.
The Qt5CoreDependencies.cmake file and which which dependencies it
contains is generated at the QtPostProcess stop.
Note that for non-static Qt builds, we only need to propagate public
3rd party libraries. For static builds, we need all third party
libraries.
In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any
scope, the targets on which the property is set, have to be GLOBAL.
Also for applications and other modules to find all required third
party libraries, we have to install all our custom Find modules, and
make sure they define INTERFACE IMPORTED libraries, and not just
IMPORTED libraries.
Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-24 15:14:25 +00:00
|
|
|
FILES_MATCHING PATTERN "Find*.cmake"
|
|
|
|
PATTERN "tests" EXCLUDE
|
|
|
|
PATTERN "3rdparty" EXCLUDE
|
|
|
|
)
|
2019-05-15 11:57:15 +00:00
|
|
|
|
2020-03-16 12:36:47 +00:00
|
|
|
if(MACOS)
|
cmake: Add default Info.plist for macOS with some important keys
The default Info.plist shipped with CMake lacks an NSPrincipalClass
entry, which is crucial for making macOS apps run in full resolution
on retina screens.
We make sure the file is only picked up on macOS, not iOS and friends,
since those platforms require another principal class. If needed we can
extract the value out as a CMake variable and use the same file for all
Apple platforms. Doing so would assume all keys are single-platform
only, so if that's not the case we need platform-specific files.
We should probably extract the package type out as a variable too,
so that the file can be used for both apps, plugins, and frameworks,
but doing so requires setting up that variable somewhere based on
the target type, which CMake doesn't allow in an easy way.
The file itself is based on the file CMake ships, combined with
keys inherited from Qt's existing plist templates for qmake, and
adjusted to match what Xcode generates by default these days.
Change-Id: I3f5109e5fff63cdbd109a99d4008948d4bd2102b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-11 20:45:50 +00:00
|
|
|
qt_copy_or_install(FILES
|
|
|
|
cmake/macos/MacOSXBundleInfo.plist.in
|
|
|
|
DESTINATION "${__GlobalConfig_install_dir}/macos"
|
|
|
|
)
|
|
|
|
endif()
|