CMake: Fix mockplugins test not to fail in a non-prefix build

Explicitly running the install step would fail in a non-prefix build.
Do it conditionally on the no_prefix feature.

Change-Id: I78cd63f51c499a0df451b08290c6dfc84e52666c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6423a657c7179e7e0f00c14dccc94b237b3160b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2022-08-05 11:16:19 +02:00 committed by Qt Cherry-pick Bot
parent b61de3163a
commit 9d5b0a77da

View File

@ -253,11 +253,16 @@ elseif(QT6_INSTALL_BINS)
endif() endif()
# Test building and installing a few dummy Qt modules and plugins. # Test building and installing a few dummy Qt modules and plugins.
_qt_internal_test_expect_pass(mockplugins set(mockplugins_test_args "")
BINARY "${CMAKE_COMMAND}" if(NOT QT_FEATURE_no_prefix)
BINARY_ARGS list(APPEND mockplugins_test_args
"-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins" BINARY "${CMAKE_COMMAND}"
-P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake") BINARY_ARGS
"-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins"
-P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake"
)
endif()
_qt_internal_test_expect_pass(mockplugins ${mockplugins_test_args})
set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins) set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins)
# Test importing the plugins built in the project above. # Test importing the plugins built in the project above.