summaryrefslogtreecommitdiffstats
path: root/Source/itkVC60Configure.cxx
blob: 498e30fe5542b947dca9ee2e056c2f821f2f58bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "itkVC60Configure.h"
#include "cmSystemTools.h"
#include "stdlib.h"
#include <windows.h>

void itkVC60Configure::Configure()
{
  this->GenerateITKConfigHeader();
  this->GenerateVNLConfigHeader();
}

void itkVC60Configure::GenerateITKConfigHeader()
{
  // for now just copy the itkConfigure.h.in file into place
  std::string source = m_WhereSource;
  source += "/itkConfigure.h.in";
  std::string destdir = m_WhereBuild;
  std::string dest = destdir;
  dest += "/itkConfigure.h";
  this->CopyFileTo(source.c_str(),
                   destdir.c_str(),
                   dest.c_str());
}

void itkVC60Configure::CopyFileTo(const char* source,
                                  const char* destdir,
                                  const char* dest)
{
  if(!cmSystemTools::MakeDirectory(destdir) )
    {
    std::string error = "Error: can not create directory: ";
    error += destdir;
    MessageBox(0, error.c_str(), "config ERROR", MB_OK);
    }
  if(!CopyFile(source, dest, FALSE))
    {
     std::string error = "Error: can not create : ";
     error += dest;
     MessageBox(0, error.c_str(), "config ERROR", MB_OK);
    }
}


void itkVC60Configure::GenerateVNLConfigHeader()
{
  // Copy the vcl config stuff for vc50 into place
  std::string source = m_WhereSource;
  source += "/Code/Insight3DParty/vxl/vcl/vcl_config-vc60.h ";
  std::string destdir = m_WhereBuild;
  destdir += "/Code/Insight3DParty/vxl/vcl";
  std::string dest = destdir;
  dest += "/vcl_config.h";
  this->CopyFileTo(source.c_str(),
                   destdir.c_str(),
                   dest.c_str());
  
}