summaryrefslogtreecommitdiffstats
path: root/Tests/MissingInstall/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-09 14:37:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-01-09 14:37:17 (GMT)
commit69c366a28178027a5cf2629c0240d1709ae9ab55 (patch)
treefe61369dffe946ccb6b17830994d901e3af4662c /Tests/MissingInstall/CMakeLists.txt
parentf3a9eb45605638b42ca431731080875470cc229a (diff)
parentbe0458c5620d611a772fd3a25312cf5ae6cb492c (diff)
downloadCMake-69c366a28178027a5cf2629c0240d1709ae9ab55.zip
CMake-69c366a28178027a5cf2629c0240d1709ae9ab55.tar.gz
CMake-69c366a28178027a5cf2629c0240d1709ae9ab55.tar.bz2
Merge topic 'optional-install'
be0458c InstallRules: added new variable to disable generation of install rules
Diffstat (limited to 'Tests/MissingInstall/CMakeLists.txt')
-rw-r--r--Tests/MissingInstall/CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/MissingInstall/CMakeLists.txt b/Tests/MissingInstall/CMakeLists.txt
new file mode 100644
index 0000000..91624f7
--- /dev/null
+++ b/Tests/MissingInstall/CMakeLists.txt
@@ -0,0 +1,25 @@
+cmake_minimum_required (VERSION 2.8.12)
+project(TestMissingInstall)
+
+set(CMAKE_SKIP_INSTALL_RULES ON)
+
+# Skip the dependency that causes a build when installing. This
+# avoids infinite loops when the post-build rule below installs.
+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
+set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1)
+
+if(CMAKE_CONFIGURATION_TYPES)
+ set(MULTI_CONFIG ON)
+else()
+ set(MULTI_CONFIG OFF)
+endif()
+
+add_executable(mybin mybin.cpp)
+install(TARGETS mybin RUNTIME DESTINATION bin)
+
+add_custom_command(TARGET mybin
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} "-DMULTI_CONFIG=${MULTI_CONFIG}"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/ExpectInstallFail.cmake
+ COMMENT "Install Project"
+)