summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-08-05 11:16:19 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-08-05 18:10:00 +0200
commit6423a657c7179e7e0f00c14dccc94b237b3160b8 (patch)
treef012ae42e6e874fdfb7a59575ff730dcd9f2a05c /tests/auto/cmake/CMakeLists.txt
parent60e46790dc29c960487b62312a2f2227362c55e2 (diff)
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. Pick-to: 6.4 Change-Id: I78cd63f51c499a0df451b08290c6dfc84e52666c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/cmake/CMakeLists.txt')
-rw-r--r--tests/auto/cmake/CMakeLists.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 88e73b2bb6..3393fdac88 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -256,11 +256,16 @@ elseif(QT6_INSTALL_BINS)
endif()
# Test building and installing a few dummy Qt modules and plugins.
-_qt_internal_test_expect_pass(mockplugins
- BINARY "${CMAKE_COMMAND}"
- BINARY_ARGS
- "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins"
- -P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake")
+set(mockplugins_test_args "")
+if(NOT QT_FEATURE_no_prefix)
+ list(APPEND mockplugins_test_args
+ BINARY "${CMAKE_COMMAND}"
+ 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)
# Test importing the plugins built in the project above.