COMP: Do not build VS-specific code when generators are not included.

This commit is contained in:
Brad King 2007-11-19 14:22:38 -05:00
parent 0fcf365137
commit 678bccc64b
1 changed files with 5 additions and 0 deletions

View File

@ -68,6 +68,7 @@
# include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h"
# include "cmGlobalWatcomWMakeGenerator.h" # include "cmGlobalWatcomWMakeGenerator.h"
# define CMAKE_HAVE_VS_GENERATORS
# endif # endif
# include "cmGlobalMSYSMakefileGenerator.h" # include "cmGlobalMSYSMakefileGenerator.h"
# include "cmGlobalMinGWMakefileGenerator.h" # include "cmGlobalMinGWMakefileGenerator.h"
@ -530,10 +531,12 @@ void cmake::SetArgs(const std::vector<std::string>& args)
{ {
this->CheckStampFile = args[++i]; this->CheckStampFile = args[++i];
} }
#if defined(CMAKE_HAVE_VS_GENERATORS)
else if((i < args.size()-1) && (arg.find("--vs-solution-file",0) == 0)) else if((i < args.size()-1) && (arg.find("--vs-solution-file",0) == 0))
{ {
this->VSSolutionFile = args[++i]; this->VSSolutionFile = args[++i];
} }
#endif
else if(arg.find("-V",0) == 0) else if(arg.find("-V",0) == 0)
{ {
this->Verbose = true; this->Verbose = true;
@ -2103,6 +2106,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
int ret = this->Configure(); int ret = this->Configure();
if (ret || this->ScriptMode) if (ret || this->ScriptMode)
{ {
#if defined(CMAKE_HAVE_VS_GENERATORS)
if(!this->VSSolutionFile.empty() && this->GlobalGenerator) if(!this->VSSolutionFile.empty() && this->GlobalGenerator)
{ {
// CMake is running to regenerate a Visual Studio build tree // CMake is running to regenerate a Visual Studio build tree
@ -2117,6 +2121,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
gg->CallVisualStudioMacro(cmGlobalVisualStudioGenerator::MacroStop, gg->CallVisualStudioMacro(cmGlobalVisualStudioGenerator::MacroStop,
this->VSSolutionFile.c_str()); this->VSSolutionFile.c_str());
} }
#endif
return ret; return ret;
} }
ret = this->Generate(); ret = this->Generate();