Commit 25ff4552 authored by Ken Martin's avatar Ken Martin
Browse files

new arch

parent 2c7e9b3b
...@@ -5,7 +5,6 @@ cmake.cxx ...@@ -5,7 +5,6 @@ cmake.cxx
cmakewizard.cxx cmakewizard.cxx
cmMakeDepend.cxx cmMakeDepend.cxx
cmMakefile.cxx cmMakefile.cxx
cmMakefileGenerator.cxx
cmRegularExpression.cxx cmRegularExpression.cxx
cmSourceFile.cxx cmSourceFile.cxx
cmSystemTools.cxx cmSystemTools.cxx
...@@ -17,6 +16,10 @@ cmCustomCommand.cxx ...@@ -17,6 +16,10 @@ cmCustomCommand.cxx
cmCacheManager.cxx cmCacheManager.cxx
cmSourceGroup.cxx cmSourceGroup.cxx
cmListFileCache.cxx cmListFileCache.cxx
cmGlobalGenerator.cxx
cmGlobalUnixMakefileGenerator.cxx
cmLocalGenerator.cxx
cmLocalUnixMakefileGenerator.cxx
cmake.h cmake.h
cmakewizard.h cmakewizard.h
cmMakeDepend.h cmMakeDepend.h
...@@ -33,6 +36,10 @@ cmCustomCommand.h ...@@ -33,6 +36,10 @@ cmCustomCommand.h
cmCacheManager.h cmCacheManager.h
cmSourceGroup.h cmSourceGroup.h
cmListFileCache.h cmListFileCache.h
cmGlobalGenerator.h
cmGlobalUnixMakefileGenerator.h
cmLocalGenerator.h
cmLocalUnixMakefileGenerator.h
) )
# configure the .h file # configure the .h file
...@@ -50,18 +57,22 @@ ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE) ...@@ -50,18 +57,22 @@ ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
IF (WIN32) IF (WIN32)
IF(NOT UNIX) IF(NOT UNIX)
SET(SRCS ${SRCS} SET(SRCS ${SRCS}
cmDSWWriter.cxx cmGlobalBorlandMakefileGenerator.cxx
cmDSPWriter.cxx cmLocalBorlandMakefileGenerator.cxx
cmMSProjectGenerator.cxx cmGlobalNMakeMakefileGenerator.cxx
cmBorlandMakefileGenerator.cxx cmLocalNMakeMakefileGenerator.cxx
cmNMakeMakefileGenerator.cxx cmGlobalVisualStudio6Generator.cxx
cmMSDotNETGenerator.cxx cmLocalVisualStudio6Generator.cxx
cmDSWWriter.h cmGlobalVisualStudio7Generator.cxx
cmDSPWriter.h cmLocalVisualStudio7Generator.cxx
cmMSProjectGenerator.h cmGlobalBorlandMakefileGenerator.h
cmBorlandMakefileGenerator.h cmLocalBorlandMakefileGenerator.h
cmNMakeMakefileGenerator.h cmGlobalNMakeMakefileGenerator.h
cmMSDotNETGenerator.h cmLocalNMakeMakefileGenerator.h
cmGlobalVisualStudio6Generator.h
cmLocalVisualStudio6Generator.h
cmGlobalVisualStudio7Generator.h
cmLocalVisualStudio7Generator.h
) )
IF( NOT BORLAND ) IF( NOT BORLAND )
LINK_LIBRARIES( rpcrt4.lib ) LINK_LIBRARIES( rpcrt4.lib )
...@@ -70,8 +81,6 @@ IF (WIN32) ...@@ -70,8 +81,6 @@ IF (WIN32)
ENDIF(NOT UNIX) ENDIF(NOT UNIX)
ENDIF (WIN32) ENDIF (WIN32)
SET(SRCS ${SRCS} cmUnixMakefileGenerator.cxx cmUnixMakefileGenerator.h)
# create a library used by the command line and the GUI # create a library used by the command line and the GUI
ADD_LIBRARY(CMakeLib ${SRCS}) ADD_LIBRARY(CMakeLib ${SRCS})
...@@ -111,9 +120,6 @@ CONFIGURE_FILE( ...@@ -111,9 +120,6 @@ CONFIGURE_FILE(
ADD_EXECUTABLE(cmaketest cmaketest.cxx) ADD_EXECUTABLE(cmaketest cmaketest.cxx)
TARGET_LINK_LIBRARIES(cmaketest CMakeLib) TARGET_LINK_LIBRARIES(cmaketest CMakeLib)
#ADD_LIBRARY(TEST_PLUGIN SHARED cmSimpleCommandPlugin.c)
#TARGET_LINK_LIBRARIES(TEST_PLUGIN CMakeLib)
IF(BUILD_TESTING) IF(BUILD_TESTING)
ADD_TEST(DumpDocumentation ${CMake_BINARY_DIR}/Source/DumpDocumentation ADD_TEST(DumpDocumentation ${CMake_BINARY_DIR}/Source/DumpDocumentation
${CMake_BINARY_DIR}/CMakeDoc.html) ${CMake_BINARY_DIR}/CMakeDoc.html)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "CMakeCommandLineInfo.h" #include "CMakeCommandLineInfo.h"
#include "../cmCacheManager.h" #include "../cmCacheManager.h"
#include "../cmake.h" #include "../cmake.h"
#include "../cmMakefileGenerator.h" #include "../cmGlobalGenerator.h"
#ifdef _DEBUG #ifdef _DEBUG
#define new DEBUG_NEW #define new DEBUG_NEW
#undef THIS_FILE #undef THIS_FILE
...@@ -52,7 +52,7 @@ class CAboutDlg : public CDialog ...@@ -52,7 +52,7 @@ class CAboutDlg : public CDialog
public: public:
CAboutDlg(); CAboutDlg();
// Dialog Data // Dialog Data
//{{AFX_DATA(CAboutDlg) //{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX }; enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA //}}AFX_DATA
...@@ -146,7 +146,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo, ...@@ -146,7 +146,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
m_oldCX = -1; m_oldCX = -1;
m_deltaXRemainder = 0; m_deltaXRemainder = 0;
m_CMakeInstance = 0; m_CMakeInstance = new cmake;
} }
void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
...@@ -184,15 +184,15 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog) ...@@ -184,15 +184,15 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild) ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource) ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource) ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
ON_WM_SIZE() ON_WM_SIZE()
ON_WM_GETMINMAXINFO() ON_WM_GETMINMAXINFO()
ON_BN_CLICKED(IDC_OK, OnOk) ON_BN_CLICKED(IDC_OK, OnOk)
ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator) ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator)
ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton) ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton)
ON_BN_CLICKED(IDCANCEL, OnCancel) ON_BN_CLICKED(IDCANCEL, OnCancel)
ON_BN_CLICKED(IDC_AdvancedValues, OnAdvancedValues) ON_BN_CLICKED(IDC_AdvancedValues, OnAdvancedValues)
ON_BN_DOUBLECLICKED(IDC_AdvancedValues, OnDoubleclickedAdvancedValues) ON_BN_DOUBLECLICKED(IDC_AdvancedValues, OnDoubleclickedAdvancedValues)
//}}AFX_MSG_MAP //}}AFX_MSG_MAP
END_MESSAGE_MAP() END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
...@@ -245,7 +245,6 @@ BOOL CMakeSetupDialog::OnInitDialog() ...@@ -245,7 +245,6 @@ BOOL CMakeSetupDialog::OnInitDialog()
SetIcon(m_hIcon, FALSE); // Set small icon SetIcon(m_hIcon, FALSE); // Set small icon
// Load source and build dirs from registry // Load source and build dirs from registry
this->LoadFromRegistry(); this->LoadFromRegistry();
this->m_CMakeInstance = new cmake;
std::vector<std::string> names; std::vector<std::string> names;
this->m_CMakeInstance->GetRegisteredGenerators(names); this->m_CMakeInstance->GetRegisteredGenerators(names);
for(std::vector<std::string>::iterator i = names.begin(); for(std::vector<std::string>::iterator i = names.begin();
...@@ -266,8 +265,8 @@ BOOL CMakeSetupDialog::OnInitDialog() ...@@ -266,8 +265,8 @@ BOOL CMakeSetupDialog::OnInitDialog()
// Set the version number // Set the version number
char tmp[1024]; char tmp[1024];
sprintf(tmp,"Version %d.%d - %s", cmMakefile::GetMajorVersion(), sprintf(tmp,"Version %d.%d - %s", cmake::GetMajorVersion(),
cmMakefile::GetMinorVersion(), cmMakefile::GetReleaseVersion()); cmake::GetMinorVersion(), cmake::GetReleaseVersion());
SetDlgItemText(IDC_CMAKE_VERSION, tmp); SetDlgItemText(IDC_CMAKE_VERSION, tmp);
this->UpdateData(FALSE); this->UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control return TRUE; // return TRUE unless you set the focus to a control
...@@ -560,38 +559,37 @@ void CMakeSetupDialog::RunCMake(bool generateProjectFiles) ...@@ -560,38 +559,37 @@ void CMakeSetupDialog::RunCMake(bool generateProjectFiles)
this->UpdateData(); this->UpdateData();
// always save the current gui values to disk // always save the current gui values to disk
this->SaveCacheFromGUI(); this->SaveCacheFromGUI();
// free the old cmake and create a new one here
if (this->m_CMakeInstance)
{
delete this->m_CMakeInstance;
this->m_CMakeInstance = 0;
}
this->m_CMakeInstance = new cmake;
// Make sure we are working from the cache on disk // Make sure we are working from the cache on disk
this->LoadCacheFromDiskToGUI(); this->LoadCacheFromDiskToGUI();
m_OKButton.EnableWindow(false); m_OKButton.EnableWindow(false);
// create the arguments for the cmake object
std::vector<std::string> args; // setup the cmake instance
args.push_back((const char*)m_PathToExecutable); if (generateProjectFiles)
std::string arg;
arg = "-H";
arg += m_WhereSource;
args.push_back(arg);
arg = "-B";
arg += m_WhereBuild;
args.push_back(arg);
arg = "-G";
arg += m_GeneratorChoiceString;
args.push_back(arg);
// run the generate process
if(this->m_CMakeInstance->Generate(args, generateProjectFiles) != 0)
{ {
cmSystemTools::Error( if(m_CMakeInstance->Generate() != 0)
"Error in generation process, project files may be invalid"); {
cmSystemTools::Error(
"Error in generation process, project files may be invalid");
}
} }
// update the GUI with any new values in the caused by the else
// generation process {
this->LoadCacheFromDiskToGUI(); m_CMakeInstance->SetHomeDirectory(m_WhereSource);
m_CMakeInstance->SetStartDirectory(m_WhereSource);
m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
m_CMakeInstance->SetGlobalGenerator(
m_CMakeInstance->CreateGlobalGenerator(m_GeneratorChoiceString));
if(m_CMakeInstance->Configure(m_PathToExecutable) != 0)
{
cmSystemTools::Error(
"Error in configuration process, project files may be invalid");
}
// update the GUI with any new values in the caused by the
// generation process
this->LoadCacheFromDiskToGUI();
}
// save source and build paths to registry // save source and build paths to registry
this->SaveToRegistry(); this->SaveToRegistry();
// path is up-to-date now // path is up-to-date now
...@@ -647,6 +645,11 @@ void CMakeSetupDialog::OnChangeWhereBuild() ...@@ -647,6 +645,11 @@ void CMakeSetupDialog::OnChangeWhereBuild()
std::string path = this->m_WhereBuild; std::string path = this->m_WhereBuild;
cmSystemTools::ConvertToUnixSlashes(path); cmSystemTools::ConvertToUnixSlashes(path);
// adjust the cmake instance
m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
std::string cache_file = path; std::string cache_file = path;
cache_file += "/CMakeCache.txt"; cache_file += "/CMakeCache.txt";
......
...@@ -55,7 +55,7 @@ protected: ...@@ -55,7 +55,7 @@ protected:
const char *aadefault); const char *aadefault);
void ShowAdvancedValues(); void ShowAdvancedValues();
void RemoveAdvancedValues(); void RemoveAdvancedValues();
// Dialog Data // Dialog Data
//{{AFX_DATA(CMakeSetupDialog) //{{AFX_DATA(CMakeSetupDialog)
enum { IDD = IDD_CMakeSetupDialog_DIALOG }; enum { IDD = IDD_CMakeSetupDialog_DIALOG };
CButton m_HelpButton; CButton m_HelpButton;
......
...@@ -19,12 +19,14 @@ cmakewizard.o \ ...@@ -19,12 +19,14 @@ cmakewizard.o \
cmakemain.o \ cmakemain.o \
cmMakeDepend.o \ cmMakeDepend.o \
cmMakefile.o \ cmMakefile.o \
cmMakefileGenerator.o \ cmGlobalGenerator.o \
cmLocalGenerator.o \
cmRegularExpression.o \ cmRegularExpression.o \
cmSourceFile.o \ cmSourceFile.o \
cmSystemTools.o \ cmSystemTools.o \
cmDirectory.o \ cmDirectory.o \
cmUnixMakefileGenerator.o \ cmGlobalUnixMakefileGenerator.o \
cmLocalUnixMakefileGenerator.o \
cmCommands.o \ cmCommands.o \
cmTarget.o \ cmTarget.o \
cmCustomCommand.o \ cmCustomCommand.o \
...@@ -39,13 +41,15 @@ cmake.o : $(DEPENDS) ...@@ -39,13 +41,15 @@ cmake.o : $(DEPENDS)
cmakemain.o : $(DEPENDS) cmakemain.o : $(DEPENDS)
cmMakeDepend.o : $(DEPENDS) cmMakeDepend.o : $(DEPENDS)
cmMakefile.o : $(DEPENDS) cmMakefile.o : $(DEPENDS)
cmMakefileGenerator.o : $(DEPENDS) cmGlobalGenerator.o : $(DEPENDS)
cmLocalGenerator.o : $(DEPENDS)
cmAuxSourceDirectoryCommand.o : $(DEPENDS) cmAuxSourceDirectoryCommand.o : $(DEPENDS)
cmRegularExpression.o : $(DEPENDS) cmRegularExpression.o : $(DEPENDS)
cmSourceFile.o : $(DEPENDS) cmSourceFile.o : $(DEPENDS)
cmDirectory.o : $(DEPENDS) cmDirectory.o : $(DEPENDS)
cmCustomCommand.o : $(DEPENDS) cmCustomCommand.o : $(DEPENDS)
cmUnixMakefileGenerator.o : $(DEPENDS) cmGlobalUnixMakefileGenerator.o : $(DEPENDS)
cmLocalUnixMakefileGenerator.o : $(DEPENDS)
cmCommands.o : $(DEPENDS) $(srcdir)/*Command*.cxx cmCommands.o : $(DEPENDS) $(srcdir)/*Command*.cxx
cmTarget.o : $(DEPENDS) cmTarget.o : $(DEPENDS)
cmCacheManager.o : $(DEPENDS) cmCacheManager.o : $(DEPENDS)
......
...@@ -52,6 +52,9 @@ void cmGlobalGenerator::ClearEnabledLanguages() ...@@ -52,6 +52,9 @@ void cmGlobalGenerator::ClearEnabledLanguages()
void cmGlobalGenerator::Configure() void cmGlobalGenerator::Configure()
{ {
// reset theLanguages
m_LanguagesEnabled = false;
// Delete any existing cmLocalGenerators // Delete any existing cmLocalGenerators
int i; int i;
for (i = 0; i < m_LocalGenerators.size(); ++i) for (i = 0; i < m_LocalGenerators.size(); ++i)
...@@ -65,8 +68,8 @@ void cmGlobalGenerator::Configure() ...@@ -65,8 +68,8 @@ void cmGlobalGenerator::Configure()
m_LocalGenerators.push_back(lg); m_LocalGenerators.push_back(lg);
// set the Start directories // set the Start directories
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetHomeDirectory()); lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetHomeOutputDirectory()); lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent(); lg->GetMakefile()->MakeStartDirectoriesCurrent();
// now do it // now do it
...@@ -124,8 +127,8 @@ void cmGlobalGenerator::LocalGenerate() ...@@ -124,8 +127,8 @@ void cmGlobalGenerator::LocalGenerate()
cmLocalGenerator *lg = this->CreateLocalGenerator(); cmLocalGenerator *lg = this->CreateLocalGenerator();
// set the Start directories // set the Start directories
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetHomeDirectory()); lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetHomeOutputDirectory()); lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent(); lg->GetMakefile()->MakeStartDirectoriesCurrent();
// now do trhe configure // now do trhe configure
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "cmGlobalUnixMakefileGenerator.h" #include "cmGlobalUnixMakefileGenerator.h"
#include "cmLocalUnixMakefileGenerator.h" #include "cmLocalUnixMakefileGenerator.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmake.h"
void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
cmMakefile *mf) cmMakefile *mf)
...@@ -25,58 +26,68 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, ...@@ -25,58 +26,68 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
{ {
m_LanguagesEnabled = true; m_LanguagesEnabled = true;
// see man putenv for explaination of this stupid code.... // only do for global runs
static char envCXX[5000]; if (!m_CMakeInstance->GetLocal())
static char envCC[5000];
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
{ {
std::string env = "CXX=${CMAKE_CXX_COMPILER}"; // see man putenv for explaination of this stupid code....
mf->ExpandVariablesInString(env); static char envCXX[5000];
strncpy(envCXX, env.c_str(), 4999); static char envCC[5000];
envCXX[4999] = 0; if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
putenv(envCXX); {
} std::string env = "CXX=${CMAKE_CXX_COMPILER}";
if(mf->GetDefinition("CMAKE_C_COMPILER")) mf->ExpandVariablesInString(env);
{ strncpy(envCXX, env.c_str(), 4999);
std::string env = "CC=${CMAKE_C_COMPILER}"; envCXX[4999] = 0;
mf->ExpandVariablesInString(env); putenv(envCXX);
strncpy(envCC, env.c_str(), 4999); }
envCC[4999] = 0; if(mf->GetDefinition("CMAKE_C_COMPILER"))
putenv(envCC); {
} std::string env = "CC=${CMAKE_C_COMPILER}";
std::string output; mf->ExpandVariablesInString(env);
std::string root strncpy(envCC, env.c_str(), 4999);
= cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT")); envCC[4999] = 0;
// if no lang specified use CXX putenv(envCC);
if(!lang ) }
{ std::string output;
lang = "CXX"; std::string root
} = cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT"));
// if CXX or C, then enable C // if no lang specified use CXX
if((!this->GetLanguageEnabled(lang) && lang[0] == 'C')) if(!lang )
{ {
std::string cmd = root; lang = "CXX";
cmd += "/Templates/cconfigure"; }
cmSystemTools::RunCommand(cmd.c_str(), output, // if CXX or C, then enable C
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str()); if((!this->GetLanguageEnabled(lang) && lang[0] == 'C'))
std::string fpath = mf->GetHomeOutputDirectory(); {
fpath += "/CCMakeSystemConfig.cmake"; std::string cmd = root;
mf->ReadListFile(NULL,fpath.c_str()); cmd += "/Templates/cconfigure";
this->SetLanguageEnabled("C"); cmSystemTools::RunCommand(cmd.c_str(), output,
} cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str());
// if CXX std::string fpath = mf->GetHomeOutputDirectory();
if(!this->GetLanguageEnabled(lang) || strcmp(lang, "CXX") == 0) fpath += "/CCMakeSystemConfig.cmake";
{ mf->ReadListFile(NULL,fpath.c_str());
std::string cmd = root; this->SetLanguageEnabled("C");
cmd += "/Templates/cxxconfigure"; }
cmSystemTools::RunCommand(cmd.c_str(), output, // if CXX
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str()); if(!this->GetLanguageEnabled(lang) || strcmp(lang, "CXX") == 0)
std::string fpath = mf->GetHomeOutputDirectory(); {
fpath += "/CXXCMakeSystemConfig.cmake"; std::string cmd = root;
mf->ReadListFile(NULL,fpath.c_str()); cmd += "/Templates/cxxconfigure";
this->SetLanguageEnabled("CXX"); cmSystemTools::RunCommand(cmd.c_str(), output,
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str());
std::string fpath = mf->GetHomeOutputDirectory();
fpath += "/CXXCMakeSystemConfig.cmake";
mf->ReadListFile(NULL,fpath.c_str());
this->SetLanguageEnabled("CXX");
}
} }
} }
if (!m_CMakeInstance->GetLocal())
{
// if we are from the top, always define this
mf->AddDefinition("RUN_CONFIGURE", true);
}
} }
///! Create a local generator appropriate to this Global Generator ///! Create a local generator appropriate to this Global Generator
......
...@@ -97,7 +97,9 @@ void cmLocalUnixMakefileGenerator::Generate(bool fromTheTop) ...@@ -97,7 +97,9 @@ void cmLocalUnixMakefileGenerator::Generate(bool fromTheTop)
this->ProcessDepends(md); this->ProcessDepends(md);
} }
// output the makefile fragment // output the makefile fragment
this->OutputMakefile("Makefile", !fromTheTop); std::string dest = m_Makefile->GetStartOutputDirectory();
dest += "/Makefile";
this->OutputMakefile(dest.c_str(), !fromTheTop);
} }
void cmLocalUnixMakefileGenerator::ProcessDepends(const cmMakeDepend &md) void cmLocalUnixMakefileGenerator::ProcessDepends(const cmMakeDepend &md)
......
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
#include "cmSourceFile.h" #include "cmSourceFile.h"
#include "cmDirectory.h" #include "cmDirectory.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmMakefileGenerator.h" #include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmCommands.h" #include "cmCommands.h"
#include "cmCacheManager.h" #include "cmCacheManager.h"
#include "cmFunctionBlocker.h" #include "cmFunctionBlocker.h"
...@@ -48,8 +49,7 @@ cmMakefile::cmMakefile() ...@@ -48,8 +49,7 @@ cmMakefile::cmMakefile()
m_HeaderFileExtensions.push_back( "in" ); m_HeaderFileExtensions.push_back( "in" );
m_DefineFlags = " "; m_DefineFlags = " ";
m_MakefileGenerator = 0; m_LocalGenerator = 0;
m_CacheManager = 0;
this->AddSourceGroup("", "^.*$"); this->AddSourceGroup("", "^.*$");
this->AddSourceGroup("Source Files", "\\.(cpp|C|c|cxx|rc|def|r|odl|idl|hpj|bat)$"); this->AddSourceGroup("Source Files", "\\.(cpp|C|c|cxx|rc|def|r|odl|idl|hpj|bat)$");
this->AddSourceGroup("Header Files", "\\.(h|hh|hpp|hxx|hm|inl)$"); this->AddSourceGroup("Header Files", "\\.(h|hh|hpp|hxx|hm|inl)$");
...@@ -59,20 +59,20 @@ cmMakefile::cmMakefile() ...@@ -59,20 +59,20 @@ cmMakefile::cmMakefile()
unsigned int cmMakefile::GetCacheMajorVersion() unsigned int cmMakefile::GetCacheMajorVersion()
{ {
if(!this->m_CacheManager->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) if(!this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION"))
{ {
return 0; return 0;
} }
return atoi(this->m_CacheManager->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")); return atoi(this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION"));
} }
unsigned int cmMakefile::GetCacheMinorVersion() unsigned int cmMakefile::GetCacheMinorVersion()
{ {
if(!this->m_CacheManager->GetCacheValue("Cmake_Cache_MINOR_VERSION")) if(!this->GetCacheManager()->GetCacheValue("Cmake_Cache_MINOR_VERSION"))
{ {
return 0; return 0;
} }
return atoi(this->m_CacheManager->GetCacheValue("CMAKE_CACHE_MINOR_VERSION")); return atoi(this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MINOR_VERSION"));
} }
...@@ -132,7 +132,6 @@ cmMakefile::~cmMakefile() ...@@ -132,7 +132,6 @@ cmMakefile::~cmMakefile()
m_FunctionBlockers.remove(*pos); m_FunctionBlockers.remove(*pos);