CMake: Allow specifying custom install dir for non-EP examples
Originally, QT_INTERNAL_EXAMPLES_INSTALL_PREFIX was added to control the installation of examples when they are built as ExternalProjects, and was not considered for the non-EP case because we hoped to switch entirely to EP-based building. Due to some unsolved issues regarding using EP builds in CI, add the ability to control the installation of non-EP examples. This will be used in the CI to allow removing the hacky INSTALL_EXAMPLEDIR and INSTALL_EXAMPLESDIR assignments in example projects. It is also likely that we will not deprecate the non-EP based building, because it is useful for IDE integration (EP targets are not as developer-friendly to work with in an IDE in regards to rebuilding). Amends 98c89c8cc1c5ceb4bfbb5f5ed6c96ecdbab99afa Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I02264aaa1daa2c80bb9ef3d02b1831b4ca5d2b84 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 9a18facc66d729a7d9d0a186da49b4b7251fda8b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1d4479add8
commit
a31b51f835
@ -896,8 +896,15 @@ unset(CMAKE_INSTALL_PREFIX)
|
||||
|
||||
# Override the install prefix in the subdir cmake_install.cmake, so that
|
||||
# relative install(TARGETS DESTINATION) calls in example projects install where we tell them to.
|
||||
set(CMAKE_INSTALL_PREFIX
|
||||
"${CMAKE_INSTALL_PREFIX}/${INSTALL_EXAMPLESDIR}/${example_rel_path}")
|
||||
# Allow customizing the installation path of the examples. Will be used in CI.
|
||||
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
|
||||
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_INSTALL_PREFIX}")
|
||||
else()
|
||||
set(qt_example_install_prefix "${CMAKE_INSTALL_PREFIX}/${INSTALL_EXAMPLESDIR}")
|
||||
endif()
|
||||
file(TO_CMAKE_PATH "${qt_example_install_prefix}" qt_example_install_prefix)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX "${qt_example_install_prefix}/${example_rel_path}")
|
||||
|
||||
# Make sure unclean example projects have their INSTALL_EXAMPLEDIR set to "."
|
||||
# Won't have any effect on example projects that don't use INSTALL_EXAMPLEDIR.
|
||||
|
Loading…
x
Reference in New Issue
Block a user