diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-04-02 20:43:23 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-04-02 20:43:23 (GMT) |
commit | 4ea0f6b9494f2b4a4a5a238f8ad51ee6fbbcfe0a (patch) | |
tree | b73c04c8bce53edbdf39e3e98ae6e2a361f47bef /Source/cmMSDotNETGenerator.cxx | |
parent | 81ebecaea17cc18dfdda4fc3051eba08f6f076a0 (diff) | |
download | CMake-4ea0f6b9494f2b4a4a5a238f8ad51ee6fbbcfe0a.zip CMake-4ea0f6b9494f2b4a4a5a238f8ad51ee6fbbcfe0a.tar.gz CMake-4ea0f6b9494f2b4a4a5a238f8ad51ee6fbbcfe0a.tar.bz2 |
ENH: add enable language support for PROJECT command, this means that a C only project can be built with cmake, even without a cxx compiler
Diffstat (limited to 'Source/cmMSDotNETGenerator.cxx')
-rw-r--r-- | Source/cmMSDotNETGenerator.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/Source/cmMSDotNETGenerator.cxx b/Source/cmMSDotNETGenerator.cxx index 69fd73a..29bfb7a 100644 --- a/Source/cmMSDotNETGenerator.cxx +++ b/Source/cmMSDotNETGenerator.cxx @@ -88,7 +88,7 @@ void cmMSDotNETGenerator::SetLocal(bool local) m_BuildSLN = !local; } -void cmMSDotNETGenerator::ComputeSystemInfo() +void cmMSDotNETGenerator::EnableLanguage(const char*) { // now load the settings if(!m_Makefile->GetDefinition("CMAKE_ROOT")) @@ -97,10 +97,14 @@ void cmMSDotNETGenerator::ComputeSystemInfo() "CMAKE_ROOT has not been defined, bad GUI or driver program"); return; } - std::string fpath = - m_Makefile->GetDefinition("CMAKE_ROOT"); - fpath += "/Templates/CMakeDotNetSystemConfig.cmake"; - m_Makefile->ReadListFile(NULL,fpath.c_str()); + if(!this->GetLanguageEnabled("CXX")) + { + std::string fpath = + m_Makefile->GetDefinition("CMAKE_ROOT"); + fpath += "/Templates/CMakeDotNetSystemConfig.cmake"; + m_Makefile->ReadListFile(NULL,fpath.c_str()); + this->SetLanguageEnabled("CXX"); + } } @@ -187,20 +191,10 @@ void cmMSDotNETGenerator::WriteSLNFile(std::ostream& fout) k != allListFiles.end(); ++k) { cmMakefile* mf = *k; - cmMSDotNETGenerator* pg = 0; - // if not this makefile, then create a new generator - if(m_Makefile != mf) - { - // Create an MS generator with SLN off, so it only creates dsp files - pg = new cmMSDotNETGenerator; - } - else - { - pg = static_cast<cmMSDotNETGenerator*>(m_Makefile->GetMakefileGenerator()); - } + cmMSDotNETGenerator* pg = + static_cast<cmMSDotNETGenerator*>(mf->GetMakefileGenerator()); // make sure the generator is building dsp files pg->BuildSLNOff(); - mf->SetMakefileGenerator(pg); mf->GenerateMakefile(); // Get the source directory from the makefile std::string dir = mf->GetStartDirectory(); |