cmakemain.cxx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "cmakewizard.h"
  14. #include "cmake.h"
  15. #include "cmCacheManager.h"
  16. #include "cmDynamicLoader.h"
  17. #include "cmListFileCache.h"
  18. int do_cmake(int ac, char** av);
  19. int main(int ac, char** av)
  20. {
  21. int ret = do_cmake(ac, av);
  22. cmDynamicLoader::FlushCache();
  23. cmListFileCache::GetInstance()->ClearCache();
  24. return ret;
  25. }
  26. int do_cmake(int ac, char** av)
  27. {
  28. bool wiz = false;
  29. bool command = false;
  30. std::vector<std::string> args;
  31. for(int i =0; i < ac; ++i)
  32. {
  33. if(strcmp(av[i], "-i") == 0)
  34. {
  35. wiz = true;
  36. }
  37. else
  38. {
  39. if (strcmp(av[i], "-E") == 0)
  40. {
  41. command = true;
  42. }
  43. else
  44. {
  45. args.push_back(av[i]);
  46. }
  47. }
  48. }
  49. if(command)
  50. {
  51. int ret = cmake::CMakeCommand(args);
  52. return ret;
  53. }
  54. if (wiz)
  55. {
  56. cmakewizard wizard;
  57. wizard.RunWizard(args);
  58. return 0;
  59. }
  60. cmake cm;
  61. return cm.Run(args);
  62. }