summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/install
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2013-12-25 16:59:24 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2014-01-08 15:28:14 (GMT)
commitbe0458c5620d611a772fd3a25312cf5ae6cb492c (patch)
treea026c5ba04bd2404ce29ae77b22485a865f92bd2 /Tests/RunCMake/install
parentb87ce492ab4600091262593499095ea5db1ae0ca (diff)
downloadCMake-be0458c5620d611a772fd3a25312cf5ae6cb492c.zip
CMake-be0458c5620d611a772fd3a25312cf5ae6cb492c.tar.gz
CMake-be0458c5620d611a772fd3a25312cf5ae6cb492c.tar.bz2
InstallRules: added new variable to disable generation of install rules
The boolean variable CMAKE_SKIP_INSTALL_RULES allows disabling generation of install rules for projects which don't want them.
Diffstat (limited to 'Tests/RunCMake/install')
-rw-r--r--Tests/RunCMake/install/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesNoWarning1-check.cmake9
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesNoWarning1-stderr.txt1
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesNoWarning1.cmake1
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesNoWarning2-check.cmake9
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesNoWarning2-stderr.txt1
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesNoWarning2.cmake1
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesWarning-check.cmake9
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesWarning-stderr.txt3
-rw-r--r--Tests/RunCMake/install/SkipInstallRulesWarning.cmake2
11 files changed, 43 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/CMakeLists.txt b/Tests/RunCMake/install/CMakeLists.txt
new file mode 100644
index 0000000..4b3de84
--- /dev/null
+++ b/Tests/RunCMake/install/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
new file mode 100644
index 0000000..c8dc379
--- /dev/null
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+run_cmake(SkipInstallRulesWarning)
+run_cmake(SkipInstallRulesNoWarning1)
+run_cmake(SkipInstallRulesNoWarning2)
diff --git a/Tests/RunCMake/install/SkipInstallRulesNoWarning1-check.cmake b/Tests/RunCMake/install/SkipInstallRulesNoWarning1-check.cmake
new file mode 100644
index 0000000..2807698
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesNoWarning1-check.cmake
@@ -0,0 +1,9 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt")
+ message(FATAL_ERROR "missing test prerequisite CMakeCache.txt")
+endif()
+
+set(CMAKE_INSTALL_CMAKE "${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake")
+
+if(EXISTS ${CMAKE_INSTALL_CMAKE})
+ message(FATAL_ERROR "${CMAKE_INSTALL_CMAKE} should not exist")
+endif()
diff --git a/Tests/RunCMake/install/SkipInstallRulesNoWarning1-stderr.txt b/Tests/RunCMake/install/SkipInstallRulesNoWarning1-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesNoWarning1-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/install/SkipInstallRulesNoWarning1.cmake b/Tests/RunCMake/install/SkipInstallRulesNoWarning1.cmake
new file mode 100644
index 0000000..22c7f8c
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesNoWarning1.cmake
@@ -0,0 +1 @@
+set(CMAKE_SKIP_INSTALL_RULES ON)
diff --git a/Tests/RunCMake/install/SkipInstallRulesNoWarning2-check.cmake b/Tests/RunCMake/install/SkipInstallRulesNoWarning2-check.cmake
new file mode 100644
index 0000000..4372b77
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesNoWarning2-check.cmake
@@ -0,0 +1,9 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt")
+ message(FATAL_ERROR "missing test prerequisite CMakeCache.txt")
+endif()
+
+set(CMAKE_INSTALL_CMAKE "${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake")
+
+if(NOT EXISTS ${CMAKE_INSTALL_CMAKE})
+ message(FATAL_ERROR "${CMAKE_INSTALL_CMAKE} should exist")
+endif()
diff --git a/Tests/RunCMake/install/SkipInstallRulesNoWarning2-stderr.txt b/Tests/RunCMake/install/SkipInstallRulesNoWarning2-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesNoWarning2-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/install/SkipInstallRulesNoWarning2.cmake b/Tests/RunCMake/install/SkipInstallRulesNoWarning2.cmake
new file mode 100644
index 0000000..2f5f03a
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesNoWarning2.cmake
@@ -0,0 +1 @@
+install(FILES CMakeLists.txt DESTINATION src)
diff --git a/Tests/RunCMake/install/SkipInstallRulesWarning-check.cmake b/Tests/RunCMake/install/SkipInstallRulesWarning-check.cmake
new file mode 100644
index 0000000..2807698
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesWarning-check.cmake
@@ -0,0 +1,9 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt")
+ message(FATAL_ERROR "missing test prerequisite CMakeCache.txt")
+endif()
+
+set(CMAKE_INSTALL_CMAKE "${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake")
+
+if(EXISTS ${CMAKE_INSTALL_CMAKE})
+ message(FATAL_ERROR "${CMAKE_INSTALL_CMAKE} should not exist")
+endif()
diff --git a/Tests/RunCMake/install/SkipInstallRulesWarning-stderr.txt b/Tests/RunCMake/install/SkipInstallRulesWarning-stderr.txt
new file mode 100644
index 0000000..9130526
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesWarning-stderr.txt
@@ -0,0 +1,3 @@
+CMake Warning in CMakeLists.txt:
+ CMAKE_SKIP_INSTALL_RULES was enabled even though installation rules have
+ been specified
diff --git a/Tests/RunCMake/install/SkipInstallRulesWarning.cmake b/Tests/RunCMake/install/SkipInstallRulesWarning.cmake
new file mode 100644
index 0000000..b621d9b
--- /dev/null
+++ b/Tests/RunCMake/install/SkipInstallRulesWarning.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_SKIP_INSTALL_RULES ON)
+install(FILES CMakeLists.txt DESTINATION src)