summaryrefslogtreecommitdiff
path: root/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Goulet <robert.goulet@autodesk.com>2015-05-01 13:46:17 -0400
committerBrad King <brad.king@kitware.com>2015-05-06 10:31:39 -0400
commita6e4e73da3de092439b6fcfe884f44a7c8a1ad81 (patch)
treecbffd7b03e181ad6f6f69d09365f435302b26280 /Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
parent562e69dd500f3b1558ab3ffd62679b8b4b0df842 (diff)
downloadcmake-a6e4e73da3de092439b6fcfe884f44a7c8a1ad81.tar.gz
VS: Add option to put INSTALL target in .sln default build
Add a CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD variable to control this behavior.
Diffstat (limited to 'Tests/VSExcludeFromDefaultBuild/CMakeLists.txt')
-rw-r--r--Tests/VSExcludeFromDefaultBuild/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt b/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
index d30414b4ba..243fdf5899 100644
--- a/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
+++ b/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.8.9)
project(VSExcludeFromDefaultBuild)
+# CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD will enable the INSTALL target to be part of the default build
+set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
+
# First step is to clear all .exe files in output so that possible past
# failures of this test do not prevent it from succeeding.
add_custom_target(ClearExes ALL
@@ -13,6 +16,7 @@ add_custom_target(ClearExes ALL
function(add_test_executable target)
add_executable("${target}" ${ARGN})
add_dependencies("${target}" ClearExes)
+ install(TARGETS "${target}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/install" OPTIONAL)
endfunction()
add_test_executable(DefaultBuilt main.c)