summaryrefslogtreecommitdiff
path: root/Tests/FindPackageTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-14 09:51:48 -0400
committerBrad King <brad.king@kitware.com>2015-05-14 10:07:37 -0400
commitd430cb7c36e7739a70da7897465badba62be7989 (patch)
treeb95c84e0d60178ebe4025fc11c5adbece90897c3 /Tests/FindPackageTest
parent332ee3e305f017a2991b2ae348644141d1539f61 (diff)
downloadcmake-d430cb7c36e7739a70da7897465badba62be7989.tar.gz
Tests: Fix failures when running under the default install prefix (#15566)
Fix test cases whose behavior differs when their source or build tree is under CMAKE_INSTALL_PREFIX by setting an install prefix under the build tree. Otherwise they may fail when run under the default install prefix (e.g. /usr/local).
Diffstat (limited to 'Tests/FindPackageTest')
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 8fafa3b707..fadd0feeff 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required (VERSION 2.6)
project(FindPackageTest)
+# Protect tests from running inside the default install prefix.
+set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/NotDefaultPrefix")
+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# Look for a package which uses FindPackageHandleStandardArgs.cmake with the