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

new arch

parent 2c7e9b3b
......@@ -5,7 +5,6 @@ cmake.cxx
cmakewizard.cxx
cmMakeDepend.cxx
cmMakefile.cxx
cmMakefileGenerator.cxx
cmRegularExpression.cxx
cmSourceFile.cxx
cmSystemTools.cxx
......@@ -17,6 +16,10 @@ cmCustomCommand.cxx
cmCacheManager.cxx
cmSourceGroup.cxx
cmListFileCache.cxx
cmGlobalGenerator.cxx
cmGlobalUnixMakefileGenerator.cxx
cmLocalGenerator.cxx
cmLocalUnixMakefileGenerator.cxx
cmake.h
cmakewizard.h
cmMakeDepend.h
......@@ -33,6 +36,10 @@ cmCustomCommand.h
cmCacheManager.h
cmSourceGroup.h
cmListFileCache.h
cmGlobalGenerator.h
cmGlobalUnixMakefileGenerator.h
cmLocalGenerator.h
cmLocalUnixMakefileGenerator.h
)
# configure the .h file
......@@ -50,18 +57,22 @@ ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
IF (WIN32)
IF(NOT UNIX)
SET(SRCS ${SRCS}
cmDSWWriter.cxx
cmDSPWriter.cxx
cmMSProjectGenerator.cxx
cmBorlandMakefileGenerator.cxx
cmNMakeMakefileGenerator.cxx
cmMSDotNETGenerator.cxx
cmDSWWriter.h
cmDSPWriter.h
cmMSProjectGenerator.h
cmBorlandMakefileGenerator.h
cmNMakeMakefileGenerator.h
cmMSDotNETGenerator.h
cmGlobalBorlandMakefileGenerator.cxx
cmLocalBorlandMakefileGenerator.cxx
cmGlobalNMakeMakefileGenerator.cxx
cmLocalNMakeMakefileGenerator.cxx
cmGlobalVisualStudio6Generator.cxx
cmLocalVisualStudio6Generator.cxx
cmGlobalVisualStudio7Generator.cxx
cmLocalVisualStudio7Generator.cxx
cmGlobalBorlandMakefileGenerator.h
cmLocalBorlandMakefileGenerator.h
cmGlobalNMakeMakefileGenerator.h
cmLocalNMakeMakefileGenerator.h
cmGlobalVisualStudio6Generator.h
cmLocalVisualStudio6Generator.h
cmGlobalVisualStudio7Generator.h
cmLocalVisualStudio7Generator.h
)
IF( NOT BORLAND )
LINK_LIBRARIES( rpcrt4.lib )
......@@ -70,8 +81,6 @@ IF (WIN32)
ENDIF(NOT UNIX)
ENDIF (WIN32)
SET(SRCS ${SRCS} cmUnixMakefileGenerator.cxx cmUnixMakefileGenerator.h)
# create a library used by the command line and the GUI
ADD_LIBRARY(CMakeLib ${SRCS})
......@@ -111,9 +120,6 @@ CONFIGURE_FILE(
ADD_EXECUTABLE(cmaketest cmaketest.cxx)
TARGET_LINK_LIBRARIES(cmaketest CMakeLib)
#ADD_LIBRARY(TEST_PLUGIN SHARED cmSimpleCommandPlugin.c)
#TARGET_LINK_LIBRARIES(TEST_PLUGIN CMakeLib)
IF(BUILD_TESTING)
ADD_TEST(DumpDocumentation ${CMake_BINARY_DIR}/Source/DumpDocumentation
${CMake_BINARY_DIR}/CMakeDoc.html)
......
......@@ -12,7 +12,7 @@
#include "CMakeCommandLineInfo.h"
#include "../cmCacheManager.h"
#include "../cmake.h"
#include "../cmMakefileGenerator.h"
#include "../cmGlobalGenerator.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
......@@ -52,7 +52,7 @@ class CAboutDlg : public CDialog
public:
CAboutDlg();
// Dialog Data
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
......@@ -146,7 +146,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
m_oldCX = -1;
m_deltaXRemainder = 0;
m_CMakeInstance = 0;
m_CMakeInstance = new cmake;
}
void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
......@@ -184,15 +184,15 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
ON_WM_SIZE()
ON_WM_SIZE()
ON_WM_GETMINMAXINFO()
ON_BN_CLICKED(IDC_OK, OnOk)
ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator)
ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator)
ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton)
ON_BN_CLICKED(IDCANCEL, OnCancel)
ON_BN_CLICKED(IDC_AdvancedValues, OnAdvancedValues)
ON_BN_DOUBLECLICKED(IDC_AdvancedValues, OnDoubleclickedAdvancedValues)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_AdvancedValues, OnAdvancedValues)
ON_BN_DOUBLECLICKED(IDC_AdvancedValues, OnDoubleclickedAdvancedValues)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
......@@ -245,7 +245,6 @@ BOOL CMakeSetupDialog::OnInitDialog()
SetIcon(m_hIcon, FALSE); // Set small icon
// Load source and build dirs from registry
this->LoadFromRegistry();
this->m_CMakeInstance = new cmake;
std::vector<std::string> names;
this->m_CMakeInstance->GetRegisteredGenerators(names);
for(std::vector<std::string>::iterator i = names.begin();
......@@ -266,8 +265,8 @@ BOOL CMakeSetupDialog::OnInitDialog()
// Set the version number
char tmp[1024];
sprintf(tmp,"Version %d.%d - %s", cmMakefile::GetMajorVersion(),
cmMakefile::GetMinorVersion(), cmMakefile::GetReleaseVersion());
sprintf(tmp,"Version %d.%d - %s", cmake::GetMajorVersion(),
cmake::GetMinorVersion(), cmake::GetReleaseVersion());
SetDlgItemText(IDC_CMAKE_VERSION, tmp);
this->UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
......@@ -560,38 +559,37 @@ void CMakeSetupDialog::RunCMake(bool generateProjectFiles)
this->UpdateData();
// always save the current gui values to disk
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
this->LoadCacheFromDiskToGUI();
m_OKButton.EnableWindow(false);
// create the arguments for the cmake object
std::vector<std::string> args;
args.push_back((const char*)m_PathToExecutable);
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)
// setup the cmake instance
if (generateProjectFiles)
{
cmSystemTools::Error(
"Error in generation process, project files may be invalid");
if(m_CMakeInstance->Generate() != 0)
{
cmSystemTools::Error(
"Error in generation process, project files may be invalid");
}
}
// update the GUI with any new values in the caused by the
// generation process
this->LoadCacheFromDiskToGUI();
else
{
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
this->SaveToRegistry();
// path is up-to-date now
......@@ -647,6 +645,11 @@ void CMakeSetupDialog::OnChangeWhereBuild()
std::string path = this->m_WhereBuild;
cmSystemTools::ConvertToUnixSlashes(path);
// adjust the cmake instance
m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
std::string cache_file = path;
cache_file += "/CMakeCache.txt";
......
......@@ -55,7 +55,7 @@ protected:
const char *aadefault);
void ShowAdvancedValues();
void RemoveAdvancedValues();
// Dialog Data
// Dialog Data
//{{AFX_DATA(CMakeSetupDialog)
enum { IDD = IDD_CMakeSetupDialog_DIALOG };
CButton m_HelpButton;
......
......@@ -19,12 +19,14 @@ cmakewizard.o \
cmakemain.o \
cmMakeDepend.o \
cmMakefile.o \
cmMakefileGenerator.o \
cmGlobalGenerator.o \
cmLocalGenerator.o \
cmRegularExpression.o \
cmSourceFile.o \
cmSystemTools.o \
cmDirectory.o \
cmUnixMakefileGenerator.o \
cmGlobalUnixMakefileGenerator.o \
cmLocalUnixMakefileGenerator.o \
cmCommands.o \
cmTarget.o \
cmCustomCommand.o \
......@@ -39,13 +41,15 @@ cmake.o : $(DEPENDS)
cmakemain.o : $(DEPENDS)
cmMakeDepend.o : $(DEPENDS)
cmMakefile.o : $(DEPENDS)
cmMakefileGenerator.o : $(DEPENDS)
cmGlobalGenerator.o : $(DEPENDS)
cmLocalGenerator.o : $(DEPENDS)
cmAuxSourceDirectoryCommand.o : $(DEPENDS)
cmRegularExpression.o : $(DEPENDS)
cmSourceFile.o : $(DEPENDS)
cmDirectory.o : $(DEPENDS)
cmCustomCommand.o : $(DEPENDS)
cmUnixMakefileGenerator.o : $(DEPENDS)
cmGlobalUnixMakefileGenerator.o : $(DEPENDS)
cmLocalUnixMakefileGenerator.o : $(DEPENDS)
cmCommands.o : $(DEPENDS) $(srcdir)/*Command*.cxx
cmTarget.o : $(DEPENDS)
cmCacheManager.o : $(DEPENDS)
......
......@@ -52,6 +52,9 @@ void cmGlobalGenerator::ClearEnabledLanguages()
void cmGlobalGenerator::Configure()
{
// reset theLanguages
m_LanguagesEnabled = false;
// Delete any existing cmLocalGenerators
int i;
for (i = 0; i < m_LocalGenerators.size(); ++i)
......@@ -65,8 +68,8 @@ void cmGlobalGenerator::Configure()
m_LocalGenerators.push_back(lg);
// set the Start directories
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetHomeDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetHomeOutputDirectory());
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
// now do it
......@@ -124,8 +127,8 @@ void cmGlobalGenerator::LocalGenerate()
cmLocalGenerator *lg = this->CreateLocalGenerator();
// set the Start directories
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetHomeDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetHomeOutputDirectory());
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
// now do trhe configure
......
......@@ -17,6 +17,7 @@
#include "cmGlobalUnixMakefileGenerator.h"
#include "cmLocalUnixMakefileGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
cmMakefile *mf)
......@@ -25,58 +26,68 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
{
m_LanguagesEnabled = true;
// see man putenv for explaination of this stupid code....
static char envCXX[5000];
static char envCC[5000];
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
// only do for global runs
if (!m_CMakeInstance->GetLocal())
{
std::string env = "CXX=${CMAKE_CXX_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCXX, env.c_str(), 4999);
envCXX[4999] = 0;
putenv(envCXX);
}
if(mf->GetDefinition("CMAKE_C_COMPILER"))
{
std::string env = "CC=${CMAKE_C_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCC, env.c_str(), 4999);
envCC[4999] = 0;
putenv(envCC);
}
std::string output;
std::string root
= cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT"));
// if no lang specified use CXX
if(!lang )
{
lang = "CXX";
}
// if CXX or C, then enable C
if((!this->GetLanguageEnabled(lang) && lang[0] == 'C'))
{
std::string cmd = root;
cmd += "/Templates/cconfigure";
cmSystemTools::RunCommand(cmd.c_str(), output,
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str());
std::string fpath = mf->GetHomeOutputDirectory();
fpath += "/CCMakeSystemConfig.cmake";
mf->ReadListFile(NULL,fpath.c_str());
this->SetLanguageEnabled("C");
}
// if CXX
if(!this->GetLanguageEnabled(lang) || strcmp(lang, "CXX") == 0)
{
std::string cmd = root;
cmd += "/Templates/cxxconfigure";
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");
// see man putenv for explaination of this stupid code....
static char envCXX[5000];
static char envCC[5000];
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
{
std::string env = "CXX=${CMAKE_CXX_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCXX, env.c_str(), 4999);
envCXX[4999] = 0;
putenv(envCXX);
}
if(mf->GetDefinition("CMAKE_C_COMPILER"))
{
std::string env = "CC=${CMAKE_C_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCC, env.c_str(), 4999);
envCC[4999] = 0;
putenv(envCC);
}
std::string output;
std::string root
= cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT"));
// if no lang specified use CXX
if(!lang )
{
lang = "CXX";
}
// if CXX or C, then enable C
if((!this->GetLanguageEnabled(lang) && lang[0] == 'C'))
{
std::string cmd = root;
cmd += "/Templates/cconfigure";
cmSystemTools::RunCommand(cmd.c_str(), output,
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str());
std::string fpath = mf->GetHomeOutputDirectory();
fpath += "/CCMakeSystemConfig.cmake";
mf->ReadListFile(NULL,fpath.c_str());
this->SetLanguageEnabled("C");
}
// if CXX
if(!this->GetLanguageEnabled(lang) || strcmp(lang, "CXX") == 0)
{
std::string cmd = root;
cmd += "/Templates/cxxconfigure";
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
......
......@@ -97,7 +97,9 @@ void cmLocalUnixMakefileGenerator::Generate(bool fromTheTop)
this->ProcessDepends(md);
}
// 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)
......
This diff is collapsed.
......@@ -27,7 +27,7 @@
class cmFunctionBlocker;
class cmCommand;
class cmMakefileGenerator;
class cmLocalGenerator;
class cmMakeDepend;
/** \class cmMakefile
......@@ -96,11 +96,11 @@ public:
* dependent, although the interface is through a generic
* superclass.
*/
void SetMakefileGenerator(cmMakefileGenerator*);
void SetLocalGenerator(cmLocalGenerator*);
///! Get the current makefile generator.
cmMakefileGenerator* GetMakefileGenerator()
{ return m_MakefileGenerator;}
cmLocalGenerator* GetLocalGenerator()
{ return m_LocalGenerator;}
/**
* Produce the output makefile.
......@@ -485,15 +485,6 @@ public:
*/
void ExpandVariables();
/** Recursivly read and create a cmMakefile object for
* all CMakeLists.txt files in the GetSubDirectories list.
* Once the file is found, it ReadListFile is called on
* the cmMakefile created for it. CreateObject is called on
* the prototype to create a cmMakefileGenerator for each cmMakefile that
* is created.
*/
void FindSubDirectoryCMakeListsFiles(std::vector<cmMakefile*>& makefiles);
/**
* find what source group this source is in
*/
......@@ -519,14 +510,9 @@ public:
* Set/Get the name of the parent directories CMakeLists file
* given a current CMakeLists file name
*/
void SetCacheManager(cmCacheManager *cm) {
this->m_CacheManager = cm; }
cmCacheManager *GetCacheManager() {
return m_CacheManager; }
cmCacheManager *GetCacheManager() const;
protected:
cmCacheManager *m_CacheManager;
// add link libraries and directories to the target
void AddGlobalLinkInformation(const char* name, cmTarget& target);
......@@ -573,7 +559,7 @@ protected:
DefinitionMap m_Definitions;
RegisteredCommandsMap m_Commands;
std::vector<cmCommand*> m_UsedCommands;
cmMakefileGenerator* m_MakefileGenerator;
cmLocalGenerator* m_LocalGenerator;
bool IsFunctionBlocked(const char *name, std::vector<std::string> const& args);
private:
......
This diff is collapsed.
......@@ -18,18 +18,81 @@
// running cmake. Most cmake based GUIS should primarily create an instance
// of this class and communicate with it.
#include "cmMakefile.h"
#include "cmStandardIncludes.h"
#include "cmSystemTools.h"
class cmGlobalGenerator;
class cmLocalGenerator;
class cmCacheManager;
class cmMakefile;
class cmake
{
public:
///! construct an instance of cmake
cmake();
///! destruct an instance of cmake
~cmake();
/**
* Generate the SourceFilesList from the SourceLists. This should only be
* done once to be safe.
* Return major and minor version numbers for cmake.
*/
void Usage(const char *program);
static unsigned int GetMajorVersion();
static unsigned int GetMinorVersion();
static const char *GetReleaseVersion();
//@{
/**
* Set/Get the home directory (or output directory) in the project. The
* home directory is the top directory of the project. It is where
* cmake was run. Remember that CMake processes
* CMakeLists files by recursing up the tree starting at the StartDirectory
* and going up until it reaches the HomeDirectory.
*/
void SetHomeDirectory(const char* dir);
const char* GetHomeDirectory() const
{
return m_cmHomeDirectory.c_str();
}
void SetHomeOutputDirectory(const char* lib);
const char* GetHomeOutputDirectory() const
{
return m_HomeOutputDirectory.c_str();
}
//@}
//@{
/**
* Set/Get the start directory (or output directory). The start directory
* is the directory of the CMakeLists.txt file that started the current
* round of processing. Remember that CMake processes CMakeLists files by
* recursing up the tree starting at the StartDirectory and going up until
* it reaches the HomeDirectory.
*/
void SetStartDirectory(const char* dir)
{
m_cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(m_cmStartDirectory);
}
const char* GetStartDirectory() const
{
return m_cmStartDirectory.c_str();
}
void SetStartOutputDirectory(const char* lib)
{
m_StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(m_StartOutputDirectory);
}
const char* GetStartOutputDirectory() const
{
return m_StartOutputDirectory.c_str();
}
//@}
/**
* Handle a command line invocation of cmake.
*/
int Run(const std::vector<std::string>&args);
/**
* Generate the SourceFilesList from the SourceLists. This should only be
......@@ -41,7 +104,35 @@ class cmake
* If you only want to parse the CMakeLists.txt files,
* but not actually generate the makefiles, use buildMakefiles = false.
*/
int Generate(const std::vector<std::string>&, bool buildMakefiles = true);
int Generate();
/**
* Configure the cmMakefiles. This routine will create a GlobalGenerator if
* one has not already been set. It will then Call Configure on the
* GlobalGenerator. This in turn will read in an process all the CMakeList
* files for the tree. It will not produce any actual Makefiles, or
* workspaces. Generate does that. */
int Configure(const char *cmakeexec, const std::vector<std::string> *args = 0);
///! Create a GlobalGenerator
cmGlobalGenerator* CreateGlobalGenerator(const char* name);
///! Return the global generator assigned to this instance of cmake
cmGlobalGenerator* GetGlobalGenerator() { return m_GlobalGenerator; };
///! Return the global generator assigned to this instance of cmake
void SetGlobalGenerator(cmGlobalGenerator *);
///! Get the names of the current registered generators
void GetRegisteredGenerators(std::vector<std::string>& names);
///! get the cmCachemManager used by this invocation of cmake
cmCacheManager *GetCacheManager() { return m_CacheManager; }
/**
* Given a variable name, return its value (as a string).
*/
const char* GetCacheDefinition(const char*) const;
/**
* Execute commands during the build process. Supports options such
......@@ -49,36 +140,43 @@ class cmake
*/
static int CMakeCommand(std::vector<std::string>&);
/**
* Is cmake in the process of a local cmake invocation. If so, we know the
* cache is already configured and ready to go.
*/
bool GetLocal()
{
return m_Local;
}
///! Display command line useage
void Usage(const char *program);
///! Parse command line arguments
void SetArgs(cmMakefile& builder, const std::vector<std::string>&);
void SetArgs(const std::vector<std::string>&);
protected:
cmGlobalGenerator *m_GlobalGenerator;
cmCacheManager *m_CacheManager;
std::string m_cmHomeDirectory;
std::string m_HomeOutputDirectory;
std::string m_cmStartDirectory;
std::string m_StartOutputDirectory;
///! Parse command line arguments that might set cache values
void SetCacheArgs(cmMakefile& builder, const std::vector<std::string>&);
void SetCacheArgs(const std::vector<std::string>&);
///! read in a cmake list file to initialize the cache
void ReadListFile(const char *path);
/**
* Generate CMAKE_ROOT and CMAKE_COMMAND cache entries
*/
int AddCMakePaths(const std::vector<std::string>&);
int AddCMakePaths(const char *arg0);
/**
* constructor
*/
cmake();
~cmake();
///! used by Run
int LocalGenerate();
///! Create a named generator
cmMakefileGenerator* CreateGenerator(const char* name);
///! Register a generator
void RegisterGenerator(cmMakefileGenerator*);
///! Get the names of the current registered generators
void GetRegisteredGenerators(std::vector<std::string>& names);
///! get the cmCachemManager used by this invocation of cmake
cmCacheManager *GetCacheManager() {
return &m_CacheManager; }
protected:
std::map<cmStdString, cmMakefileGenerator*> m_RegisteredGenerators;
cmCacheManager m_CacheManager;
private:
bool m_Verbose;
bool m_Local;
......
......@@ -55,6 +55,6 @@ int main(int ac, char** av)
return 0;
}
cmake cm;
int ret = cm.Generate(args);
int ret = cm.Run(args);
return ret;
}
......@@ -115,7 +115,7 @@ int main (int argc, char **argv)
std::cout << "Generating build files...\n";
cmake cm;
if (cm.Generate(args) != 0)
if (cm.Run(args) != 0)
{
std::cerr << "Error: cmake execution failed\n";
// return to the original directory
......@@ -126,7 +126,7 @@ int main (int argc, char **argv)
cmake cm2;
std::cout << "Generating build files (again)...\n";
if (cm2.Generate(args) != 0)
if (cm2.Run(args) != 0)
{
std::cerr << "Error: cmake execution failed\n";
// return to the original directory
......
......@@ -98,7 +98,7 @@ void cmakewizard::RunWizard(std::vector<std::string> const& args)
asked = false;
// run cmake
this->ShowMessage("Please wait while cmake processes CMakeLists.txt files....\n");
make.Generate(args);
make.Configure(args[0].c_str(),&args);
this->ShowMessage("\n");
// load the cache from disk
cmCacheManager *cachem = make.GetCacheManager();
......@@ -140,5 +140,6 @@ void cmakewizard::RunWizard(std::vector<std::string> const& args)
cachem->SaveCache(cmSystemTools::GetCurrentWorkingDirectory().c_str());
}
while(asked);
make.Generate();
this->ShowMessage("CMake complete, run make to build project.\n");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment