2001-01-11 19:55:47 +00:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: Insight Segmentation & Registration Toolkit
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
2002-01-21 20:30:43 +00:00
|
|
|
Copyright (c) 2002 Insight Consortium. All rights reserved.
|
|
|
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
|
2001-01-11 19:55:47 +00:00
|
|
|
|
2002-01-21 20:30:43 +00:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
2001-01-11 19:55:47 +00:00
|
|
|
|
|
|
|
=========================================================================*/
|
2001-01-05 16:41:20 +00:00
|
|
|
#include "cmMSProjectGenerator.h"
|
2001-06-06 17:48:13 +00:00
|
|
|
#include "cmDSWWriter.h"
|
|
|
|
#include "cmDSPWriter.h"
|
2001-05-18 19:22:17 +00:00
|
|
|
#include "cmCacheManager.h"
|
2001-01-05 16:41:20 +00:00
|
|
|
|
|
|
|
cmMSProjectGenerator::cmMSProjectGenerator()
|
|
|
|
{
|
2001-06-06 17:48:13 +00:00
|
|
|
m_DSWWriter = 0;
|
|
|
|
m_DSPWriter = 0;
|
2001-01-11 19:47:38 +00:00
|
|
|
BuildDSWOn();
|
2001-01-05 16:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void cmMSProjectGenerator::GenerateMakefile()
|
|
|
|
{
|
|
|
|
if(m_BuildDSW)
|
|
|
|
{
|
2001-06-06 17:48:13 +00:00
|
|
|
delete m_DSWWriter;
|
|
|
|
m_DSWWriter = 0;
|
|
|
|
m_DSWWriter = new cmDSWWriter(m_Makefile);
|
|
|
|
m_DSWWriter->OutputDSWFile();
|
2001-01-05 16:41:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-06-06 17:48:13 +00:00
|
|
|
delete m_DSPWriter;
|
|
|
|
m_DSPWriter = 0;
|
|
|
|
m_DSPWriter = new cmDSPWriter(m_Makefile);
|
|
|
|
m_DSPWriter->OutputDSPFile();
|
2001-01-05 16:41:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cmMSProjectGenerator::~cmMSProjectGenerator()
|
|
|
|
{
|
2001-06-06 17:48:13 +00:00
|
|
|
delete m_DSPWriter;
|
|
|
|
delete m_DSWWriter;
|
2001-01-05 16:41:20 +00:00
|
|
|
}
|
|
|
|
|
2001-05-18 15:12:21 +00:00
|
|
|
void cmMSProjectGenerator::SetLocal(bool local)
|
|
|
|
{
|
|
|
|
m_BuildDSW = !local;
|
|
|
|
}
|
2001-05-18 19:20:31 +00:00
|
|
|
|
|
|
|
void cmMSProjectGenerator::ComputeSystemInfo()
|
|
|
|
{
|
|
|
|
// now load the settings
|
2001-08-08 15:54:46 +00:00
|
|
|
if(!m_Makefile->GetDefinition("CMAKE_ROOT"))
|
2001-05-30 19:28:55 +00:00
|
|
|
{
|
|
|
|
cmSystemTools::Error(
|
|
|
|
"CMAKE_ROOT has not been defined, bad GUI or driver program");
|
|
|
|
return;
|
|
|
|
}
|
2001-05-18 19:20:31 +00:00
|
|
|
std::string fpath =
|
2001-08-08 15:54:46 +00:00
|
|
|
m_Makefile->GetDefinition("CMAKE_ROOT");
|
2001-05-23 20:31:43 +00:00
|
|
|
fpath += "/Templates/CMakeWindowsSystemConfig.cmake";
|
2001-05-18 19:20:31 +00:00
|
|
|
m_Makefile->ReadListFile(NULL,fpath.c_str());
|
|
|
|
}
|