summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VSSolution
diff options
context:
space:
mode:
authorTaylor Braun-Jones <taylor@braun-jones.org>2016-03-21 20:01:20 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-23 17:22:15 (GMT)
commitf069be054833f465ab469b534fddbc52c5c9913b (patch)
treecef4fffdbd67374055d67a7ce9c2f918c68f9fec /Tests/RunCMake/VSSolution
parentc05ea48545f04dee8666094b0731366b64dfc9ad (diff)
downloadCMake-f069be054833f465ab469b534fddbc52c5c9913b.zip
CMake-f069be054833f465ab469b534fddbc52c5c9913b.tar.gz
CMake-f069be054833f465ab469b534fddbc52c5c9913b.tar.bz2
VS: Fix default target support for targets nested inside a folder
It's not actually the first target in a `.sln` file that is treated as the default startup project, but rather the first fully defined target.
Diffstat (limited to 'Tests/RunCMake/VSSolution')
-rw-r--r--Tests/RunCMake/VSSolution/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake9
-rw-r--r--Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake3
3 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
index 8ae9598..afd74a1 100644
--- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
@@ -10,3 +10,7 @@ run_cmake(Override1)
run_cmake(Override2)
run_cmake(StartupProject)
run_cmake(StartupProjectMissing)
+
+if(RunCMake_GENERATOR MATCHES "Visual Studio ([^7]|[7][0-9])" AND NOT NO_USE_FOLDERS)
+ run_cmake(StartupProjectUseFolders)
+endif()
diff --git a/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake b/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake
new file mode 100644
index 0000000..c0a545a
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake
@@ -0,0 +1,9 @@
+getProjectNames(projects)
+list(GET projects 0 first_project)
+if(NOT first_project STREQUAL "CMakePredefinedTargets")
+ error("CMakePredefinedTargets is not the first project")
+endif()
+list(GET projects 1 second_project)
+if(NOT second_project STREQUAL "TestStartup")
+ error("TestStartup does not immediately follow the CMakePredefinedTargets project")
+endif()
diff --git a/Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake b/Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake
new file mode 100644
index 0000000..8e422a4
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake
@@ -0,0 +1,3 @@
+add_custom_target(TestStartup)
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT "TestStartup")