itkVC60Configure.cxx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "itkVC60Configure.h"
  2. #include "cmSystemTools.h"
  3. #include "stdlib.h"
  4. #include <windows.h>
  5. void itkVC60Configure::Configure()
  6. {
  7. this->GenerateITKConfigHeader();
  8. this->GenerateVNLConfigHeader();
  9. }
  10. void itkVC60Configure::GenerateITKConfigHeader()
  11. {
  12. // for now just copy the itkConfigure.h.in file into place
  13. std::string source = m_WhereSource;
  14. source += "/itkConfigure.h.in";
  15. std::string destdir = m_WhereBuild;
  16. std::string dest = destdir;
  17. dest += "/itkConfigure.h";
  18. this->CopyFileTo(source.c_str(),
  19. destdir.c_str(),
  20. dest.c_str());
  21. }
  22. void itkVC60Configure::CopyFileTo(const char* source,
  23. const char* destdir,
  24. const char* dest)
  25. {
  26. if(!cmSystemTools::MakeDirectory(destdir) )
  27. {
  28. std::string error = "Error: can not create directory: ";
  29. error += destdir;
  30. MessageBox(0, error.c_str(), "config ERROR", MB_OK);
  31. }
  32. if(!CopyFile(source, dest, FALSE))
  33. {
  34. std::string error = "Error: can not create : ";
  35. error += dest;
  36. MessageBox(0, error.c_str(), "config ERROR", MB_OK);
  37. }
  38. }
  39. void itkVC60Configure::GenerateVNLConfigHeader()
  40. {
  41. // Copy the vcl config stuff for vc50 into place
  42. std::string source = m_WhereSource;
  43. source += "/Code/Insight3DParty/vxl/vcl/vcl_config-vc60.h ";
  44. std::string destdir = m_WhereBuild;
  45. destdir += "/Code/Insight3DParty/vxl/vcl";
  46. std::string dest = destdir;
  47. dest += "/vcl_config.h";
  48. this->CopyFileTo(source.c_str(),
  49. destdir.c_str(),
  50. dest.c_str());
  51. }