cmGlobalNMakeMakefileGenerator.cxx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include "cmGlobalNMakeMakefileGenerator.h"
  11. #include "cmLocalUnixMakefileGenerator3.h"
  12. #include "cmMakefile.h"
  13. cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator(cmake* cm)
  14. : cmGlobalUnixMakefileGenerator3(cm)
  15. {
  16. this->FindMakeProgramFile = "CMakeNMakeFindMake.cmake";
  17. this->ForceUnixPaths = false;
  18. this->ToolSupportsColor = true;
  19. this->UseLinkScript = false;
  20. this->WindowsShell = true;
  21. this->NMake = true;
  22. this->DefineWindowsNULL = true;
  23. this->PassMakeflags = true;
  24. this->UnixCD = false;
  25. this->MakeSilentFlag = "/nologo";
  26. }
  27. void cmGlobalNMakeMakefileGenerator
  28. ::EnableLanguage(std::vector<std::string>const& l,
  29. cmMakefile *mf,
  30. bool optional)
  31. {
  32. // pick a default
  33. mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
  34. mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
  35. if(!(cmSystemTools::GetEnv("INCLUDE") &&
  36. cmSystemTools::GetEnv("LIB"))
  37. )
  38. {
  39. std::string message = "To use the NMake generator, cmake must be run "
  40. "from a shell that can use the compiler cl from the command line. "
  41. "This environment does not contain INCLUDE, LIB, or LIBPATH, and "
  42. "these must be set for the cl compiler to work. ";
  43. mf->IssueMessage(cmake::WARNING,
  44. message);
  45. }
  46. this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
  47. }
  48. //----------------------------------------------------------------------------
  49. void cmGlobalNMakeMakefileGenerator
  50. ::GetDocumentation(cmDocumentationEntry& entry)
  51. {
  52. entry.Name = cmGlobalNMakeMakefileGenerator::GetActualName();
  53. entry.Brief = "Generates NMake makefiles.";
  54. }