cmGlobalNMakeMakefileGenerator.cxx 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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()
  14. {
  15. this->FindMakeProgramFile = "CMakeNMakeFindMake.cmake";
  16. this->ForceUnixPaths = false;
  17. this->ToolSupportsColor = true;
  18. this->UseLinkScript = false;
  19. this->WindowsShell = true;
  20. this->NMake = true;
  21. this->DefineWindowsNULL = true;
  22. this->PassMakeflags = true;
  23. this->UnixCD = false;
  24. this->MakeSilentFlag = "/nologo";
  25. }
  26. void cmGlobalNMakeMakefileGenerator
  27. ::EnableLanguage(std::vector<std::string>const& l,
  28. cmMakefile *mf,
  29. bool optional)
  30. {
  31. // pick a default
  32. mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
  33. mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
  34. if(!(cmSystemTools::GetEnv("INCLUDE") &&
  35. cmSystemTools::GetEnv("LIB"))
  36. )
  37. {
  38. std::string message = "To use the NMake generator, cmake must be run "
  39. "from a shell that can use the compiler cl from the command line. "
  40. "This environment does not contain INCLUDE, LIB, or LIBPATH, and "
  41. "these must be set for the cl compiler to work. ";
  42. mf->IssueMessage(cmake::WARNING,
  43. message);
  44. }
  45. this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
  46. }
  47. ///! Create a local generator appropriate to this Global Generator
  48. cmLocalGenerator *
  49. cmGlobalNMakeMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
  50. {
  51. cmLocalUnixMakefileGenerator3* lg =
  52. new cmLocalUnixMakefileGenerator3(this, parent);
  53. return lg;
  54. }
  55. //----------------------------------------------------------------------------
  56. void cmGlobalNMakeMakefileGenerator
  57. ::GetDocumentation(cmDocumentationEntry& entry)
  58. {
  59. entry.Name = cmGlobalNMakeMakefileGenerator::GetActualName();
  60. entry.Brief = "Generates NMake makefiles.";
  61. }