cmProjectCommand.cxx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #include "cmProjectCommand.h"
  12. // cmProjectCommand
  13. bool cmProjectCommand::Invoke(std::vector<std::string>& args)
  14. {
  15. if(args.size() < 1 || args.size() > 1)
  16. {
  17. this->SetError("PROJECT called with incorrect number of arguments");
  18. return false;
  19. }
  20. m_Makefile->SetProjectName(args[0].c_str());
  21. std::string bindir = args[0];
  22. bindir += "_BINARY_DIR";
  23. std::string srcdir = args[0];
  24. srcdir += "_SOURCE_DIR";
  25. m_Makefile->AddDefinition(bindir.c_str(),
  26. m_Makefile->GetCurrentOutputDirectory());
  27. m_Makefile->AddDefinition(srcdir.c_str(),
  28. m_Makefile->GetCurrentDirectory());
  29. return true;
  30. }