cmMSProjectGenerator.cxx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 "cmMSProjectGenerator.h"
  14. #include "cmDSWWriter.h"
  15. #include "cmDSPWriter.h"
  16. #include "cmCacheManager.h"
  17. cmMSProjectGenerator::cmMSProjectGenerator()
  18. {
  19. m_DSWWriter = 0;
  20. m_DSPWriter = 0;
  21. BuildDSWOn();
  22. }
  23. void cmMSProjectGenerator::GenerateMakefile()
  24. {
  25. if(m_BuildDSW)
  26. {
  27. delete m_DSWWriter;
  28. m_DSWWriter = 0;
  29. m_DSWWriter = new cmDSWWriter(m_Makefile);
  30. m_DSWWriter->OutputDSWFile();
  31. }
  32. else
  33. {
  34. delete m_DSPWriter;
  35. m_DSPWriter = 0;
  36. m_DSPWriter = new cmDSPWriter(m_Makefile);
  37. m_DSPWriter->OutputDSPFile();
  38. }
  39. }
  40. cmMSProjectGenerator::~cmMSProjectGenerator()
  41. {
  42. delete m_DSPWriter;
  43. delete m_DSWWriter;
  44. }
  45. void cmMSProjectGenerator::SetLocal(bool local)
  46. {
  47. m_BuildDSW = !local;
  48. }
  49. void cmMSProjectGenerator::EnableLanguage(const char*)
  50. {
  51. // now load the settings
  52. if(!m_Makefile->GetDefinition("CMAKE_ROOT"))
  53. {
  54. cmSystemTools::Error(
  55. "CMAKE_ROOT has not been defined, bad GUI or driver program");
  56. return;
  57. }
  58. std::string fpath =
  59. m_Makefile->GetDefinition("CMAKE_ROOT");
  60. fpath += "/Templates/CMakeWindowsSystemConfig.cmake";
  61. m_Makefile->ReadListFile(NULL,fpath.c_str());
  62. }