diff options
author | Brad King <brad.king@kitware.com> | 2013-06-28 22:29:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-06-28 22:29:54 (GMT) |
commit | 4e5cb398ae392079031ae6a880569349c29770a6 (patch) | |
tree | 55b13e53e2368e0425602fb8527936accc50ac9a /Source/cmGlobalVisualStudio10Generator.cxx | |
parent | 78fdbbcb4130eedc2cb48ec9e67fad5c2beffb0e (diff) | |
parent | daaf6283f5c0e8b7ea7ee93f983ad56d4498788d (diff) | |
download | CMake-4e5cb398ae392079031ae6a880569349c29770a6.zip CMake-4e5cb398ae392079031ae6a880569349c29770a6.tar.gz CMake-4e5cb398ae392079031ae6a880569349c29770a6.tar.bz2 |
Merge branch 'master' into vs12-generator
Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping
the side from 'master'.
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index b8c4939..742ab78 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -14,6 +14,8 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmVisualStudioSlnData.h" +#include "cmVisualStudioSlnParser.h" #include "cmake.h" static const char vs10Win32generatorName[] = "Visual Studio 10"; @@ -215,7 +217,7 @@ std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase() std::string cmGlobalVisualStudio10Generator ::GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool fast) { @@ -230,7 +232,8 @@ std::string cmGlobalVisualStudio10Generator lowerCaseCommand.find("VCExpress") != std::string::npos) { return cmGlobalVisualStudio7Generator::GenerateBuildCommand(makeProgram, - projectName, additionalOptions, targetName, config, ignoreErrors, fast); + projectName, projectDir, additionalOptions, targetName, config, + ignoreErrors, fast); } // Otherwise, assume MSBuild command line, and construct accordingly. @@ -258,9 +261,38 @@ std::string cmGlobalVisualStudio10Generator } else { + std::string targetProject(targetName); + targetProject += ".vcxproj"; + if (targetProject.find('/') == std::string::npos) + { + // it might be in a subdir + cmVisualStudioSlnParser parser; + cmSlnData slnData; + std::string slnFile; + if (projectDir && *projectDir) + { + slnFile = projectDir; + slnFile += '/'; + slnFile += projectName; + } + else + { + slnFile = projectName; + } + if (parser.ParseFile(slnFile + ".sln", slnData, + cmVisualStudioSlnParser::DataGroupProjects)) + { + if (cmSlnProjectEntry const* proj = + slnData.GetProjectByName(targetName)) + { + targetProject = proj->GetRelativePath(); + cmSystemTools::ConvertToUnixSlashes(targetProject); + } + } + } + makeCommand += " "; + makeCommand += targetProject; makeCommand += " "; - makeCommand += targetName; - makeCommand += ".vcxproj "; } makeCommand += "/p:Configuration="; if(config && strlen(config)) |