cmGlobalBorlandMakefileGenerator.cxx 2.1 KB

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