summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-12-05 18:44:11 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-12-05 18:44:11 (GMT)
commit96189f79d582f90758ba1b4f691031b1d7fa02f3 (patch)
tree36bc488b7a77d01a9b9be3b1e4b0ab8963378fdc /Source
parent8d20322160e6e8c7bf9c6d69de9319f57373de5d (diff)
downloadCMake-96189f79d582f90758ba1b4f691031b1d7fa02f3.zip
CMake-96189f79d582f90758ba1b4f691031b1d7fa02f3.tar.gz
CMake-96189f79d582f90758ba1b4f691031b1d7fa02f3.tar.bz2
ENH: unify EnableLanguage across all generators
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.cxx11
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.h1
-rw-r--r--Source/cmGlobalGenerator.cxx177
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx15
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.h1
-rw-r--r--Source/cmGlobalUnixMakefileGenerator.cxx148
-rw-r--r--Source/cmGlobalUnixMakefileGenerator.h6
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx25
-rw-r--r--Source/cmGlobalVisualStudio6Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx29
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h1
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx12
13 files changed, 219 insertions, 212 deletions
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index 7e85f3a..baf8807 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -18,6 +18,10 @@
#include "cmLocalUnixMakefileGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
+cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
+{
+ m_FindMakeProgramFile = "CMakeBorlandFindMake.cmake";
+}
void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
cmMakefile *mf)
@@ -40,13 +44,6 @@ void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
mf->AddDefinition("BORLAND", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
- if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
- || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
- {
- std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT");
- setMakeProgram += "/Modules/CMakeBorlandFindMake.cmake";
- mf->ReadListFile(0, setMakeProgram.c_str());
- }
this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf);
}
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index ef560a7..7f66932 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -27,6 +27,7 @@
class cmGlobalBorlandMakefileGenerator : public cmGlobalNMakeMakefileGenerator
{
public:
+ cmGlobalBorlandMakefileGenerator();
///! Get the name for the generator.
virtual const char* GetName() {
return cmGlobalBorlandMakefileGenerator::GetActualName();}
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index bdb0d14..b3f4b0a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -34,6 +34,155 @@ cmGlobalGenerator::~cmGlobalGenerator()
m_LocalGenerators.clear();
}
+
+void cmGlobalGenerator::EnableLanguage(const char* lang,
+ cmMakefile *mf)
+{
+ if(m_FindMakeProgramFile.size() == 0)
+ {
+ cmSystemTools::Error(
+ "Generator implementation error, "
+ "all generators must specify m_FindMakeProgramFile");
+ }
+ std::string root = mf->GetDefinition("CMAKE_ROOT");
+ if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
+ || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
+ {
+ std::string setMakeProgram = root;
+ setMakeProgram += "/Modules/";
+ setMakeProgram += m_FindMakeProgramFile;
+ mf->ReadListFile(0, setMakeProgram.c_str());
+ }
+ if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
+ || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
+ {
+ cmSystemTools::Error("EnableLanguage was unable to find a CMAKE_MAKE_PROGRAM");
+ return;
+ }
+ std::string makeProgram = mf->GetDefinition("CMAKE_MAKE_PROGRAM");
+ if(makeProgram.find(' ') != makeProgram.npos)
+ {
+ cmSystemTools::GetShortPath(makeProgram.c_str(), makeProgram);
+ this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", makeProgram.c_str(),
+ "make program",
+ cmCacheManager::FILEPATH);
+ }
+
+ bool isLocal = m_CMakeInstance->GetLocal();
+ // if no lang specified use CXX
+ if(!lang )
+ {
+ lang = "CXX";
+ }
+ std::string rootBin = mf->GetHomeOutputDirectory();
+ if(m_ConfiguredFilesPath.size())
+ {
+ rootBin = m_ConfiguredFilesPath;
+ }
+ bool needCBackwards = false;
+ bool needCXXBackwards = false;
+
+ // check for a C compiler and configure it
+ if(!isLocal &&
+ !this->GetLanguageEnabled("C") &&
+ lang[0] == 'C')
+ {
+ if (m_CMakeInstance->GetIsInTryCompile())
+ {
+ cmSystemTools::Error("This should not have happen. "
+ "If you see this message, you are probably using a "
+ "broken CMakeLists.txt file or a problematic release of "
+ "CMake");
+ }
+ needCBackwards = true;
+ // Read the DetermineSystem file
+ std::string systemFile = root;
+ systemFile += "/Modules/CMakeDetermineSystem.cmake";
+ mf->ReadListFile(0, systemFile.c_str());
+ // read determine C compiler
+ std::string determineCFile = root;
+ determineCFile += "/Modules/CMakeDetermineCCompiler.cmake";
+ mf->ReadListFile(0,determineCFile.c_str());
+ this->SetLanguageEnabled("C");
+ }
+
+ // check for a CXX compiler and configure it
+ if(!isLocal &&
+ !this->GetLanguageEnabled("CXX") &&
+ strcmp(lang, "CXX") == 0)
+ {
+ needCXXBackwards = true;
+ std::string determineCFile = root;
+ determineCFile += "/Modules/CMakeDetermineCXXCompiler.cmake";
+ mf->ReadListFile(0,determineCFile.c_str());
+ this->SetLanguageEnabled("CXX");
+ }
+
+
+ std::string fpath = rootBin;
+ if(!mf->GetDefinition("CMAKE_SYSTEM_LOADED"))
+ {
+ fpath += "/CMakeSystem.cmake";
+ mf->ReadListFile(0,fpath.c_str());
+ }
+ // if C, then enable C
+ if(lang[0] == 'C' && !mf->GetDefinition("CMAKE_C_COMPILER_LOADED"))
+ {
+ fpath = rootBin;
+ fpath += "/CMakeCCompiler.cmake";
+ mf->ReadListFile(0,fpath.c_str());
+ }
+ if(strcmp(lang, "CXX") == 0 && !mf->GetDefinition("CMAKE_CXX_COMPILER_LOADED"))
+ {
+ fpath = rootBin;
+ fpath += "/CMakeCXXCompiler.cmake";
+ mf->ReadListFile(0,fpath.c_str());
+ }
+ if(!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED"))
+ {
+ fpath = root;
+ fpath += "/Modules/CMakeSystemSpecificInformation.cmake";
+ mf->ReadListFile(0,fpath.c_str());
+ }
+
+ if(!isLocal)
+ {
+ // At this point we should have enough info for a try compile
+ // which is used in the backward stuff
+ if(needCBackwards)
+ {
+ if (!m_CMakeInstance->GetIsInTryCompile())
+ {
+ // for old versions of CMake ListFiles
+ const char* versionValue
+ = mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
+ if (!versionValue || atof(versionValue) <= 1.4)
+ {
+ std::string ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
+ mf->ReadListFile(0,ifpath.c_str());
+ }
+ }
+ }
+ if(needCXXBackwards)
+ {
+ if (!m_CMakeInstance->GetIsInTryCompile())
+ {
+ // for old versions of CMake ListFiles
+ const char* versionValue
+ = mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
+ if (!versionValue || atof(versionValue) <= 1.4)
+ {
+ std::string fpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake";
+ mf->ReadListFile(0,fpath.c_str());
+ }
+ }
+ }
+ // if we are from the top, always define this
+ mf->AddDefinition("RUN_CONFIGURE", true);
+ }
+}
+
+
void cmGlobalGenerator::SetLanguageEnabled(const char* l)
{
m_LanguageEnabled[l] = true;
@@ -215,19 +364,23 @@ cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator()
void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen )
{
- // create a temp generator
- cmLocalGenerator *lg = this->CreateLocalGenerator();
- lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory());
- lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory());
- lg->GetMakefile()->MakeStartDirectoriesCurrent();
-
- // for each existing language call enable Language
- std::map<cmStdString, bool>::const_iterator i =
- gen->m_LanguageEnabled.begin();
- for (;i != gen->m_LanguageEnabled.end(); ++i)
+ this->SetConfiguredFilesPath(
+ gen->GetCMakeInstance()->GetHomeOutputDirectory());
+ const char* make =
+ gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
+ this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make,
+ "make program",
+ cmCacheManager::FILEPATH);
+ // if C, then enable C
+ if(gen->GetLanguageEnabled("C"))
{
- this->EnableLanguage(i->first.c_str(),lg->GetMakefile());
+ this->SetLanguageEnabled("C");
+ }
+
+ // if CXX
+ if(gen->GetLanguageEnabled("CXX"))
+ {
+ this->SetLanguageEnabled("CXX");
}
- delete lg;
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 11f3704..ee2a1cb 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -74,7 +74,7 @@ public:
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(const char*, cmMakefile *) {};
+ virtual void EnableLanguage(const char*, cmMakefile *);
/**
* Try to determine system infomation, get it from another generator
@@ -99,6 +99,7 @@ public:
void SetConfiguredFilesPath(const char* s){m_ConfiguredFilesPath = s;}
protected:
+ cmStdString m_FindMakeProgramFile;
cmStdString m_ConfiguredFilesPath;
cmake *m_CMakeInstance;
std::vector<cmLocalGenerator *> m_LocalGenerators;
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 318b428..abf3426 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -18,21 +18,18 @@
#include "cmLocalUnixMakefileGenerator.h"
#include "cmMakefile.h"
+
+cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator()
+{
+ m_FindMakeProgramFile = "CMakeNMakeFindMake.cmake";
+}
+
void cmGlobalNMakeMakefileGenerator::EnableLanguage(const char* l,
cmMakefile *mf)
{
// pick a default
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
- if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
- || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
- {
- std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT");
- setMakeProgram += "/Modules/CMakeNMakeFindMake.cmake";
- mf->ReadListFile(0, setMakeProgram.c_str());
- }
-
-
this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf);
}
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h
index c125cba..1c233c6 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.h
+++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -27,6 +27,7 @@
class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator
{
public:
+ cmGlobalNMakeMakefileGenerator();
///! Get the name for the generator.
virtual const char* GetName() {
return cmGlobalNMakeMakefileGenerator::GetActualName();}
diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx
index 5132f25..7f68d21 100644
--- a/Source/cmGlobalUnixMakefileGenerator.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator.cxx
@@ -20,130 +20,15 @@
#include "cmMakefile.h"
#include "cmake.h"
+cmGlobalUnixMakefileGenerator::cmGlobalUnixMakefileGenerator()
+{
+ m_FindMakeProgramFile = "CMakeUnixFindMake.cmake";
+}
+
void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
cmMakefile *mf)
{
- if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
- || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
- {
- std::string setMakeProgram = mf->GetDefinition("CMAKE_ROOT");
- setMakeProgram += "/Modules/CMakeUnixFindMake.cmake";
- mf->ReadListFile(0, setMakeProgram.c_str());
- }
-
- bool isLocal = m_CMakeInstance->GetLocal();
- // if no lang specified use CXX
- if(!lang )
- {
- lang = "CXX";
- }
- std::string root = mf->GetDefinition("CMAKE_ROOT");
- std::string rootBin = mf->GetHomeOutputDirectory();
- if(m_ConfiguredFilesPath.size())
- {
- rootBin = m_ConfiguredFilesPath;
- }
- bool needCBackwards = false;
- bool needCXXBackwards = false;
-
- // check for a C compiler and configure it
- if(!isLocal &&
- !this->GetLanguageEnabled("C") &&
- lang[0] == 'C')
- {
- if (m_CMakeInstance->GetIsInTryCompile())
- {
- cmSystemTools::Error("This should not have happen. "
- "If you see this message, you are probably using a "
- "broken CMakeLists.txt file or a problematic release of "
- "CMake");
- }
- needCBackwards = true;
- // Read the DetermineSystem file
- std::string systemFile = root;
- systemFile += "/Modules/CMakeDetermineSystem.cmake";
- mf->ReadListFile(0, systemFile.c_str());
- // read determine C compiler
- std::string determineCFile = root;
- determineCFile += "/Modules/CMakeDetermineCCompiler.cmake";
- mf->ReadListFile(0,determineCFile.c_str());
- this->SetLanguageEnabled("C");
- }
-
- // check for a CXX compiler and configure it
- if(!isLocal &&
- !this->GetLanguageEnabled("CXX") &&
- strcmp(lang, "CXX") == 0)
- {
- needCXXBackwards = true;
- std::string determineCFile = root;
- determineCFile += "/Modules/CMakeDetermineCXXCompiler.cmake";
- mf->ReadListFile(0,determineCFile.c_str());
- this->SetLanguageEnabled("CXX");
- }
-
-
- std::string fpath = rootBin;
- if(!mf->GetDefinition("CMAKE_SYSTEM_LOADED"))
- {
- fpath += "/CMakeSystem.cmake";
- mf->ReadListFile(0,fpath.c_str());
- }
- // if C, then enable C
- if(lang[0] == 'C' && !mf->GetDefinition("CMAKE_C_COMPILER_LOADED"))
- {
- fpath = rootBin;
- fpath += "/CMakeCCompiler.cmake";
- mf->ReadListFile(0,fpath.c_str());
- }
- if(strcmp(lang, "CXX") == 0 && !mf->GetDefinition("CMAKE_CXX_COMPILER_LOADED"))
- {
- fpath = rootBin;
- fpath += "/CMakeCXXCompiler.cmake";
- mf->ReadListFile(0,fpath.c_str());
- }
- if(!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED"))
- {
- fpath = root;
- fpath += "/Modules/CMakeSystemSpecificInformation.cmake";
- mf->ReadListFile(0,fpath.c_str());
- }
-
- if(!isLocal)
- {
- // At this point we should have enough info for a try compile
- // which is used in the backward stuff
- if(needCBackwards)
- {
- if (!m_CMakeInstance->GetIsInTryCompile())
- {
- // for old versions of CMake ListFiles
- const char* versionValue
- = mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
- if (!versionValue || atof(versionValue) <= 1.4)
- {
- std::string ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
- mf->ReadListFile(0,ifpath.c_str());
- }
- }
- }
- if(needCXXBackwards)
- {
- if (!m_CMakeInstance->GetIsInTryCompile())
- {
- // for old versions of CMake ListFiles
- const char* versionValue
- = mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
- if (!versionValue || atof(versionValue) <= 1.4)
- {
- std::string fpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake";
- mf->ReadListFile(0,fpath.c_str());
- }
- }
- }
- // if we are from the top, always define this
- mf->AddDefinition("RUN_CONFIGURE", true);
- }
+ this->cmGlobalGenerator::EnableLanguage(lang, mf);
}
///! Create a local generator appropriate to this Global Generator
@@ -154,24 +39,3 @@ cmLocalGenerator *cmGlobalUnixMakefileGenerator::CreateLocalGenerator()
return lg;
}
-void cmGlobalUnixMakefileGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen)
-{
- this->SetConfiguredFilesPath(
- gen->GetCMakeInstance()->GetHomeOutputDirectory());
- const char* make =
- gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make,
- "make program",
- cmCacheManager::FILEPATH);
- // if C, then enable C
- if(gen->GetLanguageEnabled("C"))
- {
- this->SetLanguageEnabled("C");
- }
-
- // if CXX
- if(gen->GetLanguageEnabled("CXX"))
- {
- this->SetLanguageEnabled("CXX");
- }
-}
diff --git a/Source/cmGlobalUnixMakefileGenerator.h b/Source/cmGlobalUnixMakefileGenerator.h
index 895b6a1..43abe57 100644
--- a/Source/cmGlobalUnixMakefileGenerator.h
+++ b/Source/cmGlobalUnixMakefileGenerator.h
@@ -27,6 +27,7 @@
class cmGlobalUnixMakefileGenerator : public cmGlobalGenerator
{
public:
+ cmGlobalUnixMakefileGenerator();
///! Get the name for the generator.
virtual const char* GetName() {
return cmGlobalUnixMakefileGenerator::GetActualName();}
@@ -41,11 +42,6 @@ public:
*/
virtual void EnableLanguage(const char*, cmMakefile *mf);
- /**
- * Try to determine system infomation, get it from another generator
- */
- virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *);
-
};
#endif
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index ac5bd77..a3d5f84 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -19,24 +19,15 @@
#include "cmMakefile.h"
#include "cmake.h"
-void cmGlobalVisualStudio6Generator::EnableLanguage(const char*,
+cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator()
+{
+ m_FindMakeProgramFile = "CMakeVS6FindMake.cmake";
+}
+
+void cmGlobalVisualStudio6Generator::EnableLanguage(const char* lang,
cmMakefile *mf)
{
- // now load the settings
- if(!mf->GetDefinition("CMAKE_ROOT"))
- {
- cmSystemTools::Error(
- "CMAKE_ROOT has not been defined, bad GUI or driver program");
- return;
- }
- if(!this->GetLanguageEnabled("CXX"))
- {
- std::string fpath =
- mf->GetDefinition("CMAKE_ROOT");
- fpath += "/Templates/CMakeWindowsSystemConfig.cmake";
- mf->ReadListFile(NULL,fpath.c_str());
- this->SetLanguageEnabled("CXX");
- }
+ this->cmGlobalGenerator::EnableLanguage(lang, mf);
}
int cmGlobalVisualStudio6Generator::TryCompile(const char *,
@@ -63,7 +54,6 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
*/
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir);
-
// if there are spaces in the makeCommand, assume a full path
// and convert it to a path with no spaces in it as the
// RunCommand does not like spaces
@@ -85,7 +75,6 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
makeCommand += "ALL_BUILD";
}
makeCommand += " - Debug\"";
-
int retVal;
if (!cmSystemTools::RunCommand(makeCommand.c_str(), *output, retVal, 0, false))
{
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index b0cbbe5..9e72b85 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -29,6 +29,8 @@ class cmTarget;
class cmGlobalVisualStudio6Generator : public cmGlobalGenerator
{
public:
+ cmGlobalVisualStudio6Generator();
+
///! Get the name for the generator.
virtual const char* GetName() {
return cmGlobalVisualStudio6Generator::GetActualName();}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index a005e2d..8b61c08 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -20,26 +20,23 @@
#include "cmake.h"
#include "windows.h"
-void cmGlobalVisualStudio7Generator::EnableLanguage(const char*,
+
+cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator()
+{
+ m_FindMakeProgramFile = "CMakeVS7FindMake.cmake";
+}
+
+
+void cmGlobalVisualStudio7Generator::EnableLanguage(const char* lang,
cmMakefile *mf)
{
- // now load the settings
- if(!mf->GetDefinition("CMAKE_ROOT"))
- {
- cmSystemTools::Error(
- "CMAKE_ROOT has not been defined, bad GUI or driver program");
- return;
- }
- if(!this->GetLanguageEnabled("CXX"))
- {
- std::string fpath =
- mf->GetDefinition("CMAKE_ROOT");
- fpath += "/Templates/CMakeDotNetSystemConfig.cmake";
- mf->ReadListFile(NULL,fpath.c_str());
- this->SetLanguageEnabled("CXX");
- }
+ mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
+ mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
+ this->cmGlobalGenerator::EnableLanguage(lang, mf);
}
+
+
int cmGlobalVisualStudio7Generator::TryCompile(const char *,
const char *bindir,
const char *projectName,
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index f716709..ce87c6b 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -29,6 +29,7 @@ class cmTarget;
class cmGlobalVisualStudio7Generator : public cmGlobalGenerator
{
public:
+ cmGlobalVisualStudio7Generator();
///! Get the name for the generator.
virtual const char* GetName() {
return cmGlobalVisualStudio7Generator::GetActualName();}
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 3c4a640..9ec0ece 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -737,8 +737,16 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
}
}
}
- std::string extraLinkOptions =
- m_Makefile->GetDefinition("CMAKE_EXTRA_LINK_FLAGS");
+ std::string extraLinkOptions;
+ if(target.GetType() == cmTarget::EXECUTABLE)
+ {
+ extraLinkOptions = m_Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
+ }
+ if(target.GetType() == cmTarget::SHARED_LIBRARY)
+ {
+ extraLinkOptions = m_Makefile->GetDefinition("CMAKE_SHARED_LINKER_FLAGS");
+ }
+
if(extraLinkOptions.size())
{
libOptions += " ";