cmGlobalBorlandMakefileGenerator.cxx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. }
  21. void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
  22. cmMakefile *mf)
  23. {
  24. // now load the settings
  25. if(!mf->GetDefinition("CMAKE_ROOT"))
  26. {
  27. cmSystemTools::Error(
  28. "CMAKE_ROOT has not been defined, bad GUI or driver program");
  29. return;
  30. }
  31. std::string outdir = m_CMakeInstance->GetStartOutputDirectory();
  32. if(outdir.find('-') != std::string::npos)
  33. {
  34. 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 -.";
  35. message += "\nYour path currently is: ";
  36. message += outdir;
  37. cmSystemTools::Error(message.c_str());
  38. }
  39. mf->AddDefinition("BORLAND", "1");
  40. mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
  41. mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
  42. this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf);
  43. }
  44. ///! Create a local generator appropriate to this Global Generator
  45. cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
  46. {
  47. cmLocalUnixMakefileGenerator *lg = new cmLocalUnixMakefileGenerator;
  48. lg->SetIncludeDirective("!include");
  49. lg->SetWindowsShell(true);
  50. lg->SetMakefileVariableSize(32);
  51. lg->SetGlobalGenerator(this);
  52. return lg;
  53. }