cmakemain.cxx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 "cmMakefileGenerator.h"
  16. int main(int ac, char** av)
  17. {
  18. bool wiz = false;
  19. bool command = false;
  20. std::vector<std::string> args;
  21. for(int i =0; i < ac; ++i)
  22. {
  23. if(strcmp(av[i], "-i") == 0)
  24. {
  25. wiz = true;
  26. }
  27. else
  28. {
  29. if (strcmp(av[i], "-E") == 0)
  30. {
  31. command = true;
  32. }
  33. else
  34. {
  35. args.push_back(av[i]);
  36. }
  37. }
  38. }
  39. if(command)
  40. {
  41. int ret = cmake::CMakeCommand(args);
  42. return ret;
  43. }
  44. if (wiz)
  45. {
  46. cmakewizard wizard;
  47. wizard.RunWizard(args);
  48. cmMakefileGenerator::UnRegisterGenerators();
  49. return 0;
  50. }
  51. cmake cm;
  52. int ret = cm.Generate(args);
  53. cmMakefileGenerator::UnRegisterGenerators();
  54. return ret;
  55. }