cmAddLibraryCommand.cxx 1.1 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 "cmAddLibraryCommand.h"
  12. #include "cmCacheManager.h"
  13. // cmLibraryCommand
  14. bool cmAddLibraryCommand::Invoke(std::vector<std::string>& args)
  15. {
  16. if(args.size() < 1 )
  17. {
  18. this->SetError("called with incorrect number of arguments");
  19. return false;
  20. }
  21. std::vector<std::string>::iterator s = args.begin();
  22. std::vector<std::string> srclists(++s, args.end());
  23. m_Makefile->AddLibrary(args[0].c_str(),srclists);
  24. // Add an entry into the cache
  25. cmCacheManager::GetInstance()->
  26. AddCacheEntry(args[0].c_str(),
  27. m_Makefile->GetCurrentOutputDirectory(),
  28. "Path to a library", cmCacheManager::INTERNAL);
  29. return true;
  30. }