ENH: enable cxx by default if no languages have been enabled

This commit is contained in:
Bill Hoffman 2002-05-22 09:48:33 -04:00
parent 2489a3583d
commit fd98b0cca0
3 changed files with 20 additions and 4 deletions

View File

@ -34,6 +34,7 @@ cmMSDotNETGenerator::cmMSDotNETGenerator()
void cmMSDotNETGenerator::GenerateMakefile() void cmMSDotNETGenerator::GenerateMakefile()
{ {
this->EnableLanguage("CXX");
std::string configTypes = m_Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"); std::string configTypes = m_Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES");
std::string::size_type start = 0; std::string::size_type start = 0;
std::string::size_type endpos = 0; std::string::size_type endpos = 0;

View File

@ -28,6 +28,7 @@ cmMSProjectGenerator::cmMSProjectGenerator()
void cmMSProjectGenerator::GenerateMakefile() void cmMSProjectGenerator::GenerateMakefile()
{ {
this->EnableLanguage("CXX");
if(m_BuildDSW) if(m_BuildDSW)
{ {
delete m_DSWWriter; delete m_DSWWriter;
@ -64,8 +65,13 @@ void cmMSProjectGenerator::EnableLanguage(const char*)
"CMAKE_ROOT has not been defined, bad GUI or driver program"); "CMAKE_ROOT has not been defined, bad GUI or driver program");
return; return;
} }
std::string fpath = if(!this->GetLanguageEnabled("CXX"))
m_Makefile->GetDefinition("CMAKE_ROOT"); {
fpath += "/Templates/CMakeWindowsSystemConfig.cmake"; std::string fpath =
m_Makefile->ReadListFile(NULL,fpath.c_str()); m_Makefile->GetDefinition("CMAKE_ROOT");
fpath += "/Templates/CMakeWindowsSystemConfig.cmake";
m_Makefile->ReadListFile(NULL,fpath.c_str());
this->SetLanguageEnabled("CXX");
}
} }

View File

@ -41,6 +41,15 @@ cmUnixMakefileGenerator::~cmUnixMakefileGenerator()
void cmUnixMakefileGenerator::GenerateMakefile() void cmUnixMakefileGenerator::GenerateMakefile()
{ {
// for backwards compatibility if niether c or cxx is
// enabled, the enable cxx
if(! (this->GetLanguageEnabled("C") ||
this->GetLanguageEnabled("CXX")))
{
this->EnableLanguage("CXX");
}
// suppoirt override in output directories // suppoirt override in output directories
if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH")) if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"))
{ {