cmGlobalBorlandMakefileGenerator.cxx 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmGlobalBorlandMakefileGenerator.h"
  14. #include "cmLocalUnixMakefileGenerator.h"
  15. #include "cmMakefile.h"
  16. #include "cmake.h"
  17. cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
  18. {
  19. m_FindMakeProgramFile = "CMakeBorlandFindMake.cmake";
  20. m_ForceUnixPaths = false;
  21. }
  22. void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
  23. cmMakefile *mf)
  24. {
  25. // now load the settings
  26. if(!mf->GetDefinition("CMAKE_ROOT"))
  27. {
  28. cmSystemTools::Error(
  29. "CMAKE_ROOT has not been defined, bad GUI or driver program");
  30. return;
  31. }
  32. std::string outdir = m_CMakeInstance->GetStartOutputDirectory();
  33. if(outdir.find('-') != std::string::npos)
  34. {
  35. std::string message = "The Borland command line tools do not support path names that have - in them. Please re-name your output directory and use _ instead of -.";
  36. message += "\nYour path currently is: ";
  37. message += outdir;
  38. cmSystemTools::Error(message.c_str());
  39. }
  40. mf->AddDefinition("BORLAND", "1");
  41. mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
  42. mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
  43. this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf);
  44. }
  45. ///! Create a local generator appropriate to this Global Generator
  46. cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
  47. {
  48. cmLocalUnixMakefileGenerator *lg = new cmLocalUnixMakefileGenerator;
  49. lg->SetIncludeDirective("!include");
  50. lg->SetWindowsShell(true);
  51. lg->SetMakefileVariableSize(32);
  52. lg->SetPassMakeflags(true);
  53. lg->SetGlobalGenerator(this);
  54. return lg;
  55. }
  56. //----------------------------------------------------------------------------
  57. void cmGlobalBorlandMakefileGenerator::GetDocumentation(cmDocumentationEntry& entry) const
  58. {
  59. entry.name = this->GetName();
  60. entry.brief = "Generates Borland makefiles.";
  61. entry.full = "";
  62. }