cmBuildCommand.cxx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "cmBuildCommand.h"
  14. #include "cmLocalGenerator.h"
  15. #include "cmGlobalGenerator.h"
  16. // cmBuildCommand
  17. bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
  18. {
  19. if(args.size() < 2 )
  20. {
  21. this->SetError("called with incorrect number of arguments");
  22. return false;
  23. }
  24. const char* define = args[0].c_str();
  25. const char* cacheValue
  26. = m_Makefile->GetDefinition(define);
  27. std::string makeprogram = args[1];
  28. std::string makecommand
  29. = m_Makefile->GetLocalGenerator()->GetGlobalGenerator()->GenerateBuildCommand(
  30. makeprogram.c_str(), m_Makefile->GetProjectName(), 0,
  31. 0, "Release", true);
  32. if(cacheValue)
  33. {
  34. return true;
  35. }
  36. m_Makefile->AddCacheDefinition(define,
  37. makecommand.c_str(),
  38. "Command used to build entire project "
  39. "from the command line.",
  40. cmCacheManager::STRING);
  41. return true;
  42. }