cmGlobalBorlandMakefileGenerator.cxx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmLocalBorlandMakefileGenerator.h"
  15. #include "cmMakefile.h"
  16. #include "cmake.h"
  17. void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char*,
  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. if(!this->GetLanguageEnabled("CXX"))
  36. {
  37. std::string fpath =
  38. mf->GetDefinition("CMAKE_ROOT");
  39. fpath += "/Templates/CMakeBorlandWindowsSystemConfig.cmake";
  40. mf->ReadListFile(NULL,fpath.c_str());
  41. this->SetLanguageEnabled("CXX");
  42. }
  43. }
  44. ///! Create a local generator appropriate to this Global Generator
  45. cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
  46. {
  47. cmLocalGenerator *lg = new cmLocalBorlandMakefileGenerator;
  48. lg->SetGlobalGenerator(this);
  49. return lg;
  50. }