summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-01 13:40:19 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-01 13:40:19 (GMT)
commite065decd43186117913044984eaefd5040cf9063 (patch)
tree63749acd544672c30d56f03343fddbcf52bddbb4 /Tests
parentde5c29890f2139318b5c4c34e69774f3fa70ef30 (diff)
parentfe057ab3cd2469af5440307f1bf2a4f69d686db3 (diff)
downloadCMake-e065decd43186117913044984eaefd5040cf9063.zip
CMake-e065decd43186117913044984eaefd5040cf9063.tar.gz
CMake-e065decd43186117913044984eaefd5040cf9063.tar.bz2
Merge topic 'add-CMAKE_FIND_NO_INSTALL_PREFIX'
fe057ab Allow disabling adding the install prefix to the prefix search path.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/no_install_prefix/do_test.cmake2
-rw-r--r--Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt18
-rw-r--r--Tests/RunCMake/no_install_prefix/no_install_prefix.cmake2
-rw-r--r--Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt1
-rw-r--r--Tests/RunCMake/no_install_prefix/with_install_prefix.cmake2
10 files changed, 46 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 97bf14d..99a0fb3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -109,6 +109,7 @@ add_RunCMake_test(CMP0004)
add_RunCMake_test(TargetPolicies)
add_RunCMake_test(alias_targets)
add_RunCMake_test(interface_library)
+add_RunCMake_test(no_install_prefix)
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/no_install_prefix/CMakeLists.txt b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
new file mode 100644
index 0000000..12cd3c7
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake b/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
new file mode 100644
index 0000000..2923449
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
@@ -0,0 +1,15 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix")
+
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/prefix")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/prefix/NoPrefix")
+file(WRITE "${RunCMake_BINARY_DIR}/prefix/NoPrefix/NoPrefixConfig.cmake" "")
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/prefix")
+run_cmake(with_install_prefix)
+
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/prefix")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/prefix/NoPrefix")
+file(WRITE "${RunCMake_BINARY_DIR}/prefix/NoPrefix/NoPrefixConfig.cmake" "")
+list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_FIND_NO_INSTALL_PREFIX=1")
+run_cmake(no_install_prefix)
diff --git a/Tests/RunCMake/no_install_prefix/do_test.cmake b/Tests/RunCMake/no_install_prefix/do_test.cmake
new file mode 100644
index 0000000..340c7dc
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/do_test.cmake
@@ -0,0 +1,2 @@
+
+find_package(NoPrefix REQUIRED)
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt b/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt b/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt
new file mode 100644
index 0000000..66c6241
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt
@@ -0,0 +1,18 @@
+CMake Error at do_test.cmake:2 \(find_package\):
+ By not providing "FindNoPrefix.cmake" in CMAKE_MODULE_PATH this project has
+ asked CMake to find a package configuration file provided by "NoPrefix",
+ but CMake did not find one.
+
+ Could not find a package configuration file provided by "NoPrefix" with any
+ of the following names:
+
+ NoPrefixConfig.cmake
+ noprefix-config.cmake
+
+ Add the installation prefix of "NoPrefix" to CMAKE_PREFIX_PATH or set
+ "NoPrefix_DIR" to a directory containing one of the above files. If
+ "NoPrefix" provides a separate development package or SDK, be sure it has
+ been installed.
+Call Stack \(most recent call first\):
+ no_install_prefix.cmake:2 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix.cmake b/Tests/RunCMake/no_install_prefix/no_install_prefix.cmake
new file mode 100644
index 0000000..c7d28da
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix.cmake
@@ -0,0 +1,2 @@
+
+include(do_test.cmake)
diff --git a/Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt b/Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt b/Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/no_install_prefix/with_install_prefix.cmake b/Tests/RunCMake/no_install_prefix/with_install_prefix.cmake
new file mode 100644
index 0000000..c7d28da
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/with_install_prefix.cmake
@@ -0,0 +1,2 @@
+
+include(do_test.cmake)