Commit d204791e authored by Bill Hoffman's avatar Bill Hoffman

ENH: integrate borland support

parent ecd4acfb
......@@ -65,7 +65,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /Gi- /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
......@@ -91,6 +91,10 @@ SOURCE=.\cmake.cxx
# End Source File
# Begin Source File
SOURCE=.\cmBorlandMakefileGenerator.cpp
# End Source File
# Begin Source File
SOURCE=.\cmCableClassSet.cxx
# End Source File
# Begin Source File
......
......@@ -85,32 +85,34 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 376, 225
IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 389, 225
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "CMakeSetupDialog"
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_WhereSource,147,6,135,66,CBS_DROPDOWN |
COMBOBOX IDC_WhereSource,96,6,133,66,CBS_DROPDOWN |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse...",IDC_BUTTON2,286,5,43,13
COMBOBOX IDC_WhereBuild,148,26,133,68,CBS_DROPDOWN |
PUSHBUTTON "Browse...",IDC_BUTTON2,230,6,34,13
COMBOBOX IDC_WhereBuild,96,26,133,68,CBS_DROPDOWN |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse...",IDC_BUTTON3,286,25,43,13
PUSHBUTTON "Browse...",IDC_BUTTON3,230,25,34,13
DEFPUSHBUTTON "Configure",IDC_BuildProjects,88,202,67,15
PUSHBUTTON "Cancel",IDCANCEL,220,201,67,15
LISTBOX IDC_LIST2,15,55,344,122,LBS_OWNERDRAWVARIABLE |
LISTBOX IDC_LIST2,15,55,356,122,LBS_OWNERDRAWVARIABLE |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
WS_HSCROLL
RTEXT "Where is the source code:",IDC_STATIC,52,6,86,9
RTEXT "Where do you want to build the binaries:",IDC_STATIC,10,
27,128,9
GROUPBOX "Cache Values",IDC_FRAME,9,43,356,141
RTEXT "Where is the source code:",IDC_STATIC,6,7,86,9
RTEXT "Where to build the binaries:",IDC_STATIC,5,27,90,9
GROUPBOX "Cache Values",IDC_FRAME,9,43,369,141
CTEXT "Right click on cache entries for additional options",
IDC_MouseHelpCaption,106,189,156,8
LTEXT "Static",IDC_CMAKE_VERSION,3,211,58,13,SS_CENTERIMAGE
PUSHBUTTON "OK",IDC_OK,160,202,56,14
COMBOBOX IDC_Generator,275,25,103,50,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
LTEXT "Build For:",IDC_GeneratorLabel,279,10,103,12
END
......@@ -175,7 +177,7 @@ BEGIN
IDD_CMakeSetupDialog_DIALOG, DIALOG
BEGIN
RIGHTMARGIN, 375
RIGHTMARGIN, 388
END
END
#endif // APSTUDIO_INVOKED
......
......@@ -8,6 +8,7 @@
#include "CMakeCommandLineInfo.h"
#include "../cmCacheManager.h"
#include "../cmake.h"
#include "../cmMakefileGenerator.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
......@@ -72,6 +73,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
//{{AFX_DATA_INIT(CMakeSetupDialog)
m_WhereSource = cmdInfo.m_WhereSource;
m_WhereBuild = cmdInfo.m_WhereBuild;
m_GeneratorChoiceString = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
......@@ -92,6 +94,7 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMakeSetupDialog)
DDX_Control(pDX, IDC_Generator, m_GeneratorChoice);
DDX_Control(pDX, IDC_OK, m_OKButton);
DDX_Control(pDX, IDCANCEL, m_CancelButton);
DDX_CBStringExact(pDX, IDC_WhereSource, m_WhereSource);
......@@ -103,6 +106,7 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_MouseHelpCaption, m_MouseHelp);
DDX_Control(pDX, IDC_CMAKE_VERSION, m_VersionDisplay);
DDX_Control(pDX, IDC_BuildProjects, m_Configure);
DDX_CBStringExact(pDX, IDC_Generator, m_GeneratorChoiceString);
//}}AFX_DATA_MAP
}
......@@ -120,8 +124,9 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
ON_WM_SIZE()
ON_WM_GETMINMAXINFO()
ON_BN_CLICKED(IDCANCEL, OnCancel)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDCANCEL, OnCancel)
ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
......@@ -156,10 +161,22 @@ BOOL CMakeSetupDialog::OnInitDialog()
SetIcon(m_hIcon, FALSE); // Set small icon
// Load source and build dirs from registry
this->LoadFromRegistry();
cmake m; // force a register of generators
std::vector<std::string> names;
cmMakefileGenerator::GetRegisteredGenerators(names);
for(std::vector<std::string>::iterator i = names.begin();
i != names.end(); ++i)
{
m_GeneratorChoice.AddString(i->c_str());
}
m_GeneratorChoiceString = "Visual Studio 6";
// try to load the cmake cache from disk
this->LoadCacheFromDiskToGUI();
m_WhereBuildControl.LimitText(2048);
m_WhereSourceControl.LimitText(2048);
m_GeneratorChoice.LimitText(2048);
// Set the version number
char tmp[1024];
sprintf(tmp,"Version %d.%d", cmMakefile::GetMajorVersion(),
......@@ -435,6 +452,9 @@ void CMakeSetupDialog::RunCMake(bool generateProjectFiles)
arg = "-B";
arg += m_WhereBuild;
args.push_back(arg);
arg = "-G";
arg += m_GeneratorChoiceString;
args.push_back(arg);
// run the generate process
if(make.Generate(args, generateProjectFiles) != 0)
{
......@@ -617,6 +637,26 @@ void CMakeSetupDialog::LoadCacheFromDiskToGUI()
{
cmCacheManager::GetInstance()->LoadCache(m_WhereBuild);
this->FillCacheGUIFromCacheManager();
if(cmCacheManager::GetInstance()->GetCacheEntry("CMAKE_GENERATOR"))
{
std::string curGen =
cmCacheManager::GetInstance()->GetCacheEntry("CMAKE_GENERATOR")->m_Value;
if(m_GeneratorChoiceString != curGen.c_str())
{
m_GeneratorChoiceString = curGen.c_str();
this->UpdateData(FALSE);
// m_GeneratorChoice.SetWindowText(m_GeneratorChoiceString);
// int c = m_GeneratorChoice.GetCount();
// int j = m_GeneratorChoice.FindStringExact(0, curGen.c_str());
// if (j != CB_ERR)
// {
// m_GeneratorChoice.SetCurSel(j);
// }
// m_GeneratorChoice.SelectString(0, curGen.c_str());
// this->UpdateData(FALSE);
}
}
}
}
......@@ -735,3 +775,9 @@ void CMakeSetupDialog::OnOk()
this->RunCMake(true);
CDialog::OnOK();
}
void CMakeSetupDialog::OnEditchangeGenerator()
{
// TODO: Add your control notification handler code here
}
......@@ -36,6 +36,7 @@ protected:
// Dialog Data
//{{AFX_DATA(CMakeSetupDialog)
enum { IDD = IDD_CMakeSetupDialog_DIALOG };
CComboBox m_GeneratorChoice;
CButton m_OKButton;
CButton m_CancelButton;
CString m_WhereSource;
......@@ -48,6 +49,7 @@ protected:
CStatic m_MouseHelp;
CStatic m_VersionDisplay;
CButton m_Configure;
CString m_GeneratorChoiceString;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
......@@ -85,6 +87,7 @@ protected:
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI );
afx_msg void OnOk();
afx_msg void OnEditchangeGenerator();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
......
......@@ -18,6 +18,8 @@
#define IDC_FRAME 1015
#define IDC_MouseHelpCaption 1016
#define IDC_OK 1018
#define IDC_Generator 1019
#define IDC_GeneratorLabel 1020
// Next default values for new objects
//
......@@ -25,7 +27,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1019
#define _APS_NEXT_CONTROL_VALUE 1021
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
This diff is collapsed.
......@@ -10,72 +10,82 @@
* cmBorlandMakefileGenerator produces a Unix makefile from its
* member m_Makefile.
*/
class cmBorlandMakefileGenerator : public cmMakefileGenerator {
public:
///! Set cache only and recurse to false by default.
cmBorlandMakefileGenerator();
class cmBorlandMakefileGenerator : public cmMakefileGenerator
{
public:
///! Set cache only and recurse to false by default.
cmBorlandMakefileGenerator();
///! Get the name for the generator.
virtual const char* GetName() {return "Borland Makefiles";}
//! just sets the Cache Only and Recurse flags
virtual void SetLocal(bool local);
///! virtual copy constructor
virtual cmMakefileGenerator* CreateObject()
{ return new cmBorlandMakefileGenerator;}
/**
* If cache only is on.
* Only stub makefiles are generated, and no depends, for speed.
* The default is OFF.
**/
void SetCacheOnlyOn() {m_CacheOnly = true;}
void SetCacheOnlyOff() {m_CacheOnly = false;}
//! just sets the Cache Only and Recurse flags
virtual void SetLocal(bool local);
/**
* If recurse is on, then all the makefiles below this one are parsed as well.
*/
void SetRecurseOn() {m_Recurse = true;}
void SetRecurseOff() {m_Recurse = false;}
/**
* If cache only is on.
* Only stub makefiles are generated, and no depends, for speed.
* The default is OFF.
**/
void SetCacheOnlyOn() {m_CacheOnly = true;}
void SetCacheOnlyOff() {m_CacheOnly = false;}
/**
* Produce the makefile (in this case a Unix makefile).
*/
virtual void GenerateMakefile();
/**
* If recurse is on, then all the makefiles below this one are parsed as well.
*/
void SetRecurseOn() {m_Recurse = true;}
void SetRecurseOff() {m_Recurse = false;}
/**
* Output the depend information for all the classes
* in the makefile. These would have been generated
* by the class cmMakeDepend.
*/
void OutputObjectDepends(std::ostream&);
/**
* Produce the makefile (in this case a Unix makefile).
*/
virtual void GenerateMakefile();
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void ComputeSystemInfo();
/**
* Output the depend information for all the classes
* in the makefile. These would have been generated
* by the class cmMakeDepend.
*/
void OutputObjectDepends(std::ostream&);
private:
void RecursiveGenerateCacheOnly();
void GenerateCacheOnly();
void OutputMakefile(const char* file);
void OutputTargetRules(std::ostream& fout);
void OutputTargets(std::ostream&);
void OutputSubDirectoryRules(std::ostream&);
void OutputDependInformation(std::ostream&);
void OutputDependencies(std::ostream&);
void OutputCustomRules(std::ostream&);
void OutputMakeVariables(std::ostream&);
void OutputMakeRules(std::ostream&);
void OutputSubDirectoryVars(std::ostream& fout,
const char* var,
const char* target,
const char* target1,
const char* target2,
const std::vector<std::string>& SubDirectories);
void OutputMakeRule(std::ostream&,
const char* comment,
const char* target,
const char* depends,
const char* command);
private:
bool m_CacheOnly;
bool m_Recurse;
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void ComputeSystemInfo();
private:
void RecursiveGenerateCacheOnly();
void GenerateCacheOnly();
void OutputMakefile(const char* file);
void OutputTargetRules(std::ostream& fout);
void OutputTargets(std::ostream&);
void OutputSubDirectoryRules(std::ostream&);
void OutputDependInformation(std::ostream&);
void OutputDependencies(std::ostream&);
void OutputCustomRules(std::ostream&);
void OutputMakeVariables(std::ostream&);
void OutputMakeRules(std::ostream&);
void OutputSubDirectoryVars(std::ostream& fout,
const char* var,
const char* target,
const char* target1,
const char* target2,
const std::vector<std::string>& SubDirectories);
void OutputMakeRule(std::ostream&,
const char* comment,
const char* target,
const char* depends,
const char* command);
private:
bool m_CacheOnly;
bool m_Recurse;
std::string m_ExecutableOutputPath;
std::string m_LibraryOutputPath;
};
#endif
......@@ -55,22 +55,23 @@ class cmDSWWriter;
class cmMSProjectGenerator : public cmMakefileGenerator
{
public:
/**
* Constructor sets the generation of DSW files on.
*/
///! Constructor sets the generation of DSW files on.
cmMSProjectGenerator();
/**
* Destructor.
*/
///! Destructor.
~cmMSProjectGenerator();
/**
* Produce the makefile (in this case a Microsoft Visual C++ project).
*/
///! Get the name for the generator.
virtual const char* GetName() {return "Visual Studio 6";}
///! virtual copy constructor
virtual cmMakefileGenerator* CreateObject()
{ return new cmMSProjectGenerator;}
///! Produce the makefile (in this case a Microsoft Visual C++ project).
virtual void GenerateMakefile();
//! controls the DSW/DSP settings
///! controls the DSW/DSP settings
virtual void SetLocal(bool);
/**
......@@ -81,20 +82,14 @@ public:
*/
void BuildDSWOff() {m_BuildDSW = false;}
/**
* Turn on the generation of a Microsoft Visual C++ DSW file.
*/
///! Turn on the generation of a Microsoft Visual C++ DSW file.
void BuildDSWOn() {m_BuildDSW = true;}
/**
* Retrieve a pointer to a cmDSWWriter instance.
*/
///! Retrieve a pointer to a cmDSWWriter instance.
cmDSWWriter* GetDSWWriter()
{return m_DSWWriter;}
/**
* Retrieve a pointer to a cmDSPWriter instance.
*/
///! Retrieve a pointer to a cmDSPWriter instance.
cmDSPWriter* GetDSPWriter()
{return m_DSPWriter;}
......
......@@ -40,8 +40,53 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "cmMakefileGenerator.h"
// static list of registered generators
std::map<cmStdString, cmMakefileGenerator*>
cmMakefileGenerator::s_RegisteredGenerators;
void cmMakefileGenerator::SetMakefile(cmMakefile* mf)
{
m_Makefile = mf;
}
void cmMakefileGenerator::GetRegisteredGenerators(std::vector<std::string>& names)
{
for(std::map<cmStdString, cmMakefileGenerator*>::iterator i
= s_RegisteredGenerators.begin();
i != s_RegisteredGenerators.end(); ++i)
{
names.push_back(i->first);
}
}
void
cmMakefileGenerator::RegisterGenerator(cmMakefileGenerator* mg)
{
std::map<cmStdString, cmMakefileGenerator*>::iterator i =
s_RegisteredGenerators.find(mg->GetName());
// delete re-registered objects
if(i != s_RegisteredGenerators.end())
{
delete i->second;
}
s_RegisteredGenerators[mg->GetName()] = mg;
}
cmMakefileGenerator*
cmMakefileGenerator::CreateGenerator(const char* name)
{
std::map<cmStdString, cmMakefileGenerator*>::iterator i;
for(i = s_RegisteredGenerators.begin();
i != s_RegisteredGenerators.end(); ++i)
{
cmMakefileGenerator* gen = i->second;
if(strcmp(name, gen->GetName()) == 0)
{
return gen->CreateObject();
}
}
return 0;
}
......@@ -55,9 +55,20 @@ class cmClassFile;
class cmMakefileGenerator
{
public:
/**
* Set the cmMakefile instance from which to generate the makefile.
*/
///! Create a named generator
static cmMakefileGenerator* CreateGenerator(const char* name);
///! Register a generator
static void RegisterGenerator(cmMakefileGenerator*);
///! Get the names of the current registered generators
static void GetRegisteredGenerators(std::vector<std::string>& names);
///! Get the name for the generator.
virtual const char* GetName() = 0;
///! virtual copy constructor
virtual cmMakefileGenerator* CreateObject() = 0;
///! Set the cmMakefile instance from which to generate the makefile.
void SetMakefile(cmMakefile*);
/**
......@@ -84,6 +95,7 @@ public:
virtual ~cmMakefileGenerator(){};
protected:
static std::map<cmStdString, cmMakefileGenerator*> s_RegisteredGenerators;
cmMakefile* m_Makefile;
};
......
......@@ -56,6 +56,13 @@ public:
///! Set cache only and recurse to false by default.
cmUnixMakefileGenerator();
///! Get the name for the generator.
virtual const char* GetName() {return "Unix Makefiles";}
///! virtual copy constructor
virtual cmMakefileGenerator* CreateObject()
{ return new cmUnixMakefileGenerator;}
//! just sets the Cache Only and Recurse flags
virtual void SetLocal(bool local);
......
......@@ -44,26 +44,48 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// include the generator
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "cmMSProjectGenerator.h"
#include "cmBorlandMakefileGenerator.h"
#else
#include "cmUnixMakefileGenerator.h"
#endif
cmake::cmake()
{
m_Verbose = false;
#if defined(_WIN32) && !defined(__CYGWIN__)
cmMakefileGenerator::RegisterGenerator(new cmMSProjectGenerator);
cmMakefileGenerator::RegisterGenerator(new cmBorlandMakefileGenerator);
#else
cmMakefileGenerator::RegisterGenerator(new cmUnixMakefileGenerator);
#endif
}
void cmake::Usage(const char* program)
{
std::cerr << "cmake version " << cmMakefile::GetMajorVersion()
<< "." << cmMakefile::GetMinorVersion() << "\n";
std::cerr << "Usage: " << program << " srcdir \n"
<< "Where cmake is run from the directory where you want the object files written\n";
std::cerr << "[-GgeneratorName] (where generator name can be: ";
std::vector<std::string> names;
cmMakefileGenerator::GetRegisteredGenerators(names);
for(std::vector<std::string>::iterator i =names.begin();
i != names.end(); ++i)
{
std::cerr << i->c_str() << " ";
}
std::cerr << ")\n";
}
// Parse the args
void cmake::SetArgs(cmMakefile& builder, const std::vector<std::string>& args)
{
m_Local = false;
bool directoriesSet = false;
// watch for cmake and cmake srcdir invocations
if (args.size() <= 2)
{
directoriesSet = true;
builder.SetHomeOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
builder.SetStartOutputDirectory
......@@ -89,36 +111,78 @@ void cmake::SetArgs(cmMakefile& builder, const std::vector<std::string>& args)
std::string arg = args[i];
if(arg.find("-H",0) == 0)
{
directoriesSet = true;
std::string path = arg.substr(2);
builder.SetHomeDirectory(path.c_str());
}
if(arg.find("-S",0) == 0)
else if(arg.find("-S",0) == 0)
{
directoriesSet = true;
m_Local = true;
std::string path = arg.substr(2);
builder.SetStartDirectory(path.c_str());
}
if(arg.find("-O",0) == 0)
else if(arg.find("-O",0) == 0)
{
directoriesSet = true;
std::string path = arg.substr(2);
builder.SetStartOutputDirectory(path.c_str());
}
if(arg.find("-B",0) == 0)
else if(arg.find("-B",0) == 0)
{
directoriesSet = true;
std::string path = arg.substr(2);
builder.SetHomeOutputDirectory(path.c_str());
}
if(arg.find("-D",0) == 0)
else if(arg.find("-D",0) == 0)
{
std::string value = arg.substr(2);
builder.AddDefinition(value.c_str(), true);
}
if(arg.find("-V",0) == 0)
else if(arg.find("-V",0) == 0)
{
m_Verbose = true;
}
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);
cmMakefileGenerator* gen =
cmMakefileGenerator::CreateGenerator(value.c_str());
if(!gen)
{
cmSystemTools::Error("Could not create named generator ",
value.c_str());
}
else
{
builder.SetMakefileGenerator(gen);
}
}
// no option assume it is the path to the source
else
{
directoriesSet = true;
builder.SetHomeOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
builder.SetStartOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
builder.SetHomeDirectory
(cmSystemTools::CollapseFullPath(args[1].c_str()).c_str());
builder.SetStartDirectory
(cmSystemTools::CollapseFullPath(args[1].c_str()).c_str());
}
}
if(!directoriesSet)
{
builder.SetHomeOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
builder.SetStartOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
builder.SetHomeDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
builder.SetStartDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
}
if (!m_Local)
{
builder.SetStartDirectory(builder.GetHomeDirectory());
......@@ -244,23 +308,46 @@ int cmake::Generate(const std::vector<std::string>& args, bool buildMakefiles)
}
// Create a makefile
cmMakefile mf;
// extract the directory arguments
cmake::SetArgs(mf, args);
// create the generator
// extract the directory arguments, could create a Generator
this->SetArgs(mf, args);
// Read and parse the input makefile
mf.MakeStartDirectoriesCurrent();
cmCacheManager::GetInstance()->LoadCache(&mf);
// no generator specified on the command line
if(!mf.GetMakefileGenerator())
{
cmMakefileGenerator* gen;
const char* genName = mf.GetDefinition("CMAKE_GENERATOR");
if(genName)
{
gen = cmMakefileGenerator::CreateGenerator(genName);
}
else
{
#if defined(_WIN32) && !defined(__CYGWIN__)
cmMSProjectGenerator* gen = new cmMSProjectGenerator;
gen = new cmMSProjectGenerator;
#else
cmUnixMakefileGenerator* gen = new cmUnixMakefileGenerator;
gen = new cmUnixMakefileGenerator;
#endif
}
if(!gen)
{
cmSystemTools::Error("Could not create generator");
return -1;
}
mf.SetMakefileGenerator(gen);
// add the
}
cmMakefileGenerator* gen = mf.GetMakefileGenerator();
gen->SetLocal(m_Local);
// Read and parse the input makefile
mf.SetMakefileGenerator(gen);
mf.MakeStartDirectoriesCurrent();
cmCacheManager::GetInstance()->LoadCache(&mf);
if(!mf.GetDefinition("CMAKE_GENERATOR"))
{
mf.AddCacheDefinition("CMAKE_GENERATOR",
gen->GetName(),
"Name of generator.",
cmCacheManager::INTERNAL);
}
// setup CMAKE_ROOT and CMAKE_COMMAND
this->AddCMakePaths(args);
......
......@@ -79,9 +79,9 @@ class cmake
/**
* constructor
*/
cmake() {m_Verbose = false