summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx76
1 files changed, 69 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e3bebbd..09d270d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -58,6 +58,7 @@
# include "cmGlobalVisualStudio10Generator.h"
# include "cmGlobalVisualStudio11Generator.h"
# include "cmGlobalVisualStudio12Generator.h"
+# include "cmGlobalVisualStudio14Generator.h"
# include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h"
# include "cmGlobalJOMMakefileGenerator.h"
@@ -343,16 +344,24 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
// The value is transformed if it is a filepath for example, so
// we can't compare whether the value is already in the cache until
// after we call AddCacheEntry.
- const char *cachedValue =
- this->CacheManager->GetCacheValue(var);
+ bool haveValue = false;
+ std::string cachedValue;
+ if(this->WarnUnusedCli)
+ {
+ if(const char *v = this->CacheManager->GetCacheValue(var))
+ {
+ haveValue = true;
+ cachedValue = v;
+ }
+ }
this->CacheManager->AddCacheEntry(var, value.c_str(),
"No help, variable specified on the command line.", type);
+
if(this->WarnUnusedCli)
{
- if (!cachedValue
- || strcmp(this->CacheManager->GetCacheValue(var),
- cachedValue) != 0)
+ if (!haveValue ||
+ cachedValue != this->CacheManager->GetCacheValue(var))
{
this->WatchUnusedCli(var);
}
@@ -630,6 +639,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
{
bool directoriesSet = directoriesSetBefore;
bool haveToolset = false;
+ bool havePlatform = false;
for(unsigned int i=1; i < args.size(); ++i)
{
std::string arg = args[i];
@@ -758,6 +768,27 @@ void cmake::SetArgs(const std::vector<std::string>& args,
"uninitialized variables.\n";
this->SetCheckSystemVars(true);
}
+ else if(arg.find("-A",0) == 0)
+ {
+ std::string value = arg.substr(2);
+ if(value.size() == 0)
+ {
+ ++i;
+ if(i >= args.size())
+ {
+ cmSystemTools::Error("No platform specified for -A");
+ return;
+ }
+ value = args[i];
+ }
+ if(havePlatform)
+ {
+ cmSystemTools::Error("Multiple -A options not allowed");
+ return;
+ }
+ this->GeneratorPlatform = value;
+ havePlatform = true;
+ }
else if(arg.find("-T",0) == 0)
{
std::string value = arg.substr(2);
@@ -1372,6 +1403,7 @@ int cmake::ActualConfigure()
{"10.0", "Visual Studio 10 2010"},
{"11.0", "Visual Studio 11 2012"},
{"12.0", "Visual Studio 12 2013"},
+ {"14.0", "Visual Studio 14"},
{0, 0}};
for(int i=0; version[i].MSVersion != 0; i++)
{
@@ -1435,6 +1467,34 @@ int cmake::ActualConfigure()
cmCacheManager::INTERNAL);
}
+ if(const char* platformName =
+ this->CacheManager->GetCacheValue("CMAKE_GENERATOR_PLATFORM"))
+ {
+ if(this->GeneratorPlatform.empty())
+ {
+ this->GeneratorPlatform = platformName;
+ }
+ else if(this->GeneratorPlatform != platformName)
+ {
+ std::string message = "Error: generator platform: ";
+ message += this->GeneratorPlatform;
+ message += "\nDoes not match the platform used previously: ";
+ message += platformName;
+ message +=
+ "\nEither remove the CMakeCache.txt file and CMakeFiles "
+ "directory or choose a different binary directory.";
+ cmSystemTools::Error(message.c_str());
+ return -2;
+ }
+ }
+ else
+ {
+ this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM",
+ this->GeneratorPlatform.c_str(),
+ "Name of generator platform.",
+ cmCacheManager::INTERNAL);
+ }
+
if(const char* tsName =
this->CacheManager->GetCacheValue("CMAKE_GENERATOR_TOOLSET"))
{
@@ -1705,7 +1765,7 @@ int cmake::Generate()
{
return -1;
}
- this->GlobalGenerator->Generate();
+ this->GlobalGenerator->DoGenerate();
if ( !this->GraphVizFile.empty() )
{
std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl;
@@ -1771,6 +1831,8 @@ void cmake::AddDefaultGenerators()
this->Generators.push_back(
cmGlobalVisualStudio12Generator::NewFactory());
this->Generators.push_back(
+ cmGlobalVisualStudio14Generator::NewFactory());
+ this->Generators.push_back(
cmGlobalVisualStudio71Generator::NewFactory());
this->Generators.push_back(
cmGlobalVisualStudio8Generator::NewFactory());
@@ -2745,7 +2807,7 @@ int cmake::Build(const std::string& dir,
projName = it.GetValue();
return gen->Build("", dir,
projName, target,
- &output,
+ output,
"",
config, clean, false, 0,
cmSystemTools::OUTPUT_PASSTHROUGH,