ENH: change the search path order (if several Tcl/Tk are installed, the "current...
[cmake.git] / Source / cmMSProjectGenerator.cxx
blob573ce71de5b95d354ce6a3415a13b1c26828b52f
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmMSProjectGenerator.cxx,v $
5 Language: C++
6 Date: $Date: 2002-05-22 13:48:33 $
7 Version: $Revision: 1.15 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmMSProjectGenerator.h"
18 #include "cmDSWWriter.h"
19 #include "cmDSPWriter.h"
20 #include "cmCacheManager.h"
22 cmMSProjectGenerator::cmMSProjectGenerator()
24 m_DSWWriter = 0;
25 m_DSPWriter = 0;
26 BuildDSWOn();
29 void cmMSProjectGenerator::GenerateMakefile()
31 this->EnableLanguage("CXX");
32 if(m_BuildDSW)
34 delete m_DSWWriter;
35 m_DSWWriter = 0;
36 m_DSWWriter = new cmDSWWriter(m_Makefile);
37 m_DSWWriter->OutputDSWFile();
39 else
41 delete m_DSPWriter;
42 m_DSPWriter = 0;
43 m_DSPWriter = new cmDSPWriter(m_Makefile);
44 m_DSPWriter->OutputDSPFile();
48 cmMSProjectGenerator::~cmMSProjectGenerator()
50 delete m_DSPWriter;
51 delete m_DSWWriter;
54 void cmMSProjectGenerator::SetLocal(bool local)
56 m_BuildDSW = !local;
59 void cmMSProjectGenerator::EnableLanguage(const char*)
61 // now load the settings
62 if(!m_Makefile->GetDefinition("CMAKE_ROOT"))
64 cmSystemTools::Error(
65 "CMAKE_ROOT has not been defined, bad GUI or driver program");
66 return;
68 if(!this->GetLanguageEnabled("CXX"))
70 std::string fpath =
71 m_Makefile->GetDefinition("CMAKE_ROOT");
72 fpath += "/Templates/CMakeWindowsSystemConfig.cmake";
73 m_Makefile->ReadListFile(NULL,fpath.c_str());
74 this->SetLanguageEnabled("CXX");