cmGlobalJOMMakefileGenerator.cxx 2.4 KB

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