cmLocalGenerator.cxx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "cmLocalGenerator.h"
  14. #include "cmGlobalGenerator.h"
  15. #include "cmake.h"
  16. #include "cmMakefile.h"
  17. cmLocalGenerator::cmLocalGenerator()
  18. {
  19. m_Makefile = new cmMakefile;
  20. m_Makefile->SetLocalGenerator(this);
  21. }
  22. cmLocalGenerator::~cmLocalGenerator()
  23. {
  24. delete m_Makefile;
  25. }
  26. void cmLocalGenerator::Configure()
  27. {
  28. // set the PROJECT_SOURCE_DIR and PROJECT_BIN_DIR to default values
  29. // just in case the project does not include a PROJECT command
  30. m_Makefile->AddDefinition("PROJECT_BINARY_DIR",
  31. m_Makefile->GetHomeOutputDirectory());
  32. m_Makefile->AddDefinition("PROJECT_SOURCE_DIR",
  33. m_Makefile->GetHomeDirectory());
  34. // find & read the list file
  35. std::string currentStart = m_Makefile->GetStartDirectory();
  36. currentStart += "/CMakeLists.txt";
  37. m_Makefile->ReadListFile(currentStart.c_str());
  38. }
  39. void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
  40. {
  41. m_GlobalGenerator = gg;
  42. // setup the home directories
  43. m_Makefile->SetHomeDirectory(
  44. gg->GetCMakeInstance()->GetHomeDirectory());
  45. m_Makefile->SetHomeOutputDirectory(
  46. gg->GetCMakeInstance()->GetHomeOutputDirectory());
  47. }
  48. void cmLocalGenerator::ConfigureFinalPass()
  49. {
  50. m_Makefile->ConfigureFinalPass();
  51. }