summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorDavy Durham <ddurham@bomgar.com>2016-03-17 20:12:02 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-22 11:57:00 (GMT)
commit78ec04613063653008f221eed644f1c2566fd900 (patch)
tree9d27fcd0dcba991e6519f548099a86d4337e5970 /Source/cmGlobalVisualStudioGenerator.cxx
parent5c1f4da83d1142e52b361e8f59dd68ea5728e843 (diff)
downloadCMake-78ec04613063653008f221eed644f1c2566fd900.zip
CMake-78ec04613063653008f221eed644f1c2566fd900.tar.gz
CMake-78ec04613063653008f221eed644f1c2566fd900.tar.bz2
VS: Add option to choose the `.sln` startup project (#15578)
Add a `VS_STARTUP_PROJECT` directory property to specify the project that should be placed first in the `.sln` file so that it will be selected as the default startup project. Co-Author: Taylor Braun-Jones <taylor.braunjones@avigilon.com>
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 00bb511..b11b49a 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -519,6 +519,32 @@ cmGlobalVisualStudioGenerator::GetUtilityDepend(
}
//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudioGenerator::GetStartupProjectName(
+ cmLocalGenerator const* root) const
+{
+ const char* n = root->GetMakefile()->GetProperty("VS_STARTUP_PROJECT");
+ if (n && *n)
+ {
+ std::string startup = n;
+ if (this->FindTarget(startup))
+ {
+ return startup;
+ }
+ else
+ {
+ root->GetMakefile()->IssueMessage(
+ cmake::AUTHOR_WARNING,
+ "Directory property VS_STARTUP_PROJECT specifies target "
+ "'" + startup + "' that does not exist. Ignoring.");
+ }
+ }
+
+ // default, if not specified
+ return this->GetAllTargetName();
+}
+
+//----------------------------------------------------------------------------
#include <windows.h>
//----------------------------------------------------------------------------