本文整理汇总了C++中ProjectSettingsPtr::GetFirstBuildConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectSettingsPtr::GetFirstBuildConfiguration方法的具体用法?C++ ProjectSettingsPtr::GetFirstBuildConfiguration怎么用?C++ ProjectSettingsPtr::GetFirstBuildConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectSettingsPtr
的用法示例。
在下文中一共展示了ProjectSettingsPtr::GetFirstBuildConfiguration方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoInitialize
void BatchBuildDlg::DoInitialize()
{
// load the previously saved batch build file
wxFileName fn(WorkspaceST::Get()->GetWorkspaceFileName());
fn.SetExt(wxT("batch_build"));
wxString content;
wxArrayString arr;
if (ReadFileWithConversion(fn.GetFullPath(), content)) {
arr = wxStringTokenize(content, wxT("\n"), wxTOKEN_STRTOK);
for (size_t i=0; i<arr.GetCount(); i++) {
int idx = m_checkListConfigurations->Append(arr.Item(i));
m_checkListConfigurations->Check((unsigned int)idx);
}
}
// loop over all projects, for each project collect all available
// build configurations and add them to the check list control
wxArrayString projects;
WorkspaceST::Get()->GetProjectList(projects);
for (size_t i=0; i<projects.GetCount(); i++) {
ProjectPtr p = ManagerST::Get()->GetProject(projects.Item(i));
if (p) {
ProjectSettingsPtr settings = p->GetSettings();
if (settings) {
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while (bldConf) {
wxString item(p->GetName() + wxT(" | ") + bldConf->GetName());
int where = arr.Index(item);
if (where == wxNOT_FOUND) {
// append this item
m_checkListConfigurations->Append(item);
} else {
// this item already been added,
// remove it from the arr and continue
arr.RemoveAt((size_t)where);
}
bldConf = settings->GetNextBuildConfiguration(cookie);
}
}
}
}
// check to see which configuration was left in 'arr'
// and remove them from the checklistbox
for (size_t i=0; i<arr.GetCount(); i++) {
int where = m_checkListConfigurations->FindString(arr.Item(i));
if (where != wxNOT_FOUND) {
m_checkListConfigurations->Delete((unsigned int)where);
}
}
arr.clear();
if (m_checkListConfigurations->GetCount()>0) {
m_checkListConfigurations->Select(0);
}
}
示例2: RenameConfiguration
void EditConfigurationDialog::RenameConfiguration(const wxString &oldName, const wxString &newName)
{
ProjectSettingsPtr settings = ManagerST::Get()->GetProjectSettings(m_projectName);
if(settings){
BuildConfigPtr bldConf = settings->GetBuildConfiguration(oldName);
if(bldConf){
settings->RemoveConfiguration(oldName);
bldConf->SetName(newName);
settings->SetBuildConfiguration(bldConf);
//save changes
ManagerST::Get()->SetProjectSettings(m_projectName, settings);
//update the control
m_configurationsList->Clear();
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while(bldConf){
m_configurationsList->Append(bldConf->GetName());
bldConf = settings->GetNextBuildConfiguration(cookie);
}
if(m_configurationsList->GetCount()>0)
m_configurationsList->SetSelection(0);
}
}
}
示例3: UpdateProjectPage
void NewProjectWizard::UpdateProjectPage()
{
// update the description
if(m_projectData.m_srcProject) {
wxString desc = m_projectData.m_srcProject->GetDescription();
desc = desc.Trim().Trim(false);
desc.Replace(wxT("\t"), wxT(" "));
// select the correct compiler
ProjectSettingsPtr settings = m_projectData.m_srcProject->GetSettings();
if(settings) {
ProjectSettingsCookie ck;
BuildConfigPtr buildConf = settings->GetFirstBuildConfiguration(ck);
if(buildConf) {
m_choiceCompiler->SetStringSelection(buildConf->GetCompilerType());
m_choiceDebugger->SetStringSelection(buildConf->GetDebuggerType());
}
}
}
// Restore previous selections
wxString lastCompiler = clConfig::Get().Read("CxxWizard/Compiler", wxString());
wxString lastDebugger = clConfig::Get().Read("CxxWizard/Debugger", wxString());
wxString lastBuilder = clConfig::Get().Read("CxxWizard/BuildSystem", wxString("Default"));
if(!lastDebugger.IsEmpty()) {
int where = m_choiceDebugger->FindString(lastDebugger);
if(where != wxNOT_FOUND) {
m_choiceDebugger->SetSelection(where);
}
}
if(!lastCompiler.IsEmpty()) {
int where = m_choiceCompiler->FindString(lastCompiler);
if(where != wxNOT_FOUND) {
m_choiceCompiler->SetSelection(where);
}
}
{
int where = m_choiceBuildSystem->FindString(lastBuilder);
if(where != wxNOT_FOUND) {
m_choiceBuildSystem->SetSelection(where);
}
}
}
示例4: UpdateProjectPage
void NewProjectWizard::UpdateProjectPage()
{
//update the description
if ( m_projectData.m_srcProject ) {
wxString desc = m_projectData.m_srcProject->GetDescription();
desc = desc.Trim().Trim(false);
desc.Replace(wxT("\t"), wxT(" "));
// m_txtDescription->SetValue( desc );
// select the correct compiler
ProjectSettingsPtr settings = m_projectData.m_srcProject->GetSettings();
if (settings) {
ProjectSettingsCookie ck;
BuildConfigPtr buildConf = settings->GetFirstBuildConfiguration(ck);
if (buildConf) {
m_choiceCompiler->SetStringSelection( buildConf->GetCompilerType() );
m_choiceCompiler->SetStringSelection( buildConf->GetDebuggerType() );
}
}
}
}
示例5: LoadProjectConfiguration
void ConfigurationManagerDlg::LoadProjectConfiguration(const wxString &projectName)
{
std::map<int, ConfigEntry>::iterator iter = m_projSettingsMap.begin();
for (; iter != m_projSettingsMap.end(); iter++) {
if (iter->second.project == projectName) {
iter->second.choiceControl->Clear();
ProjectSettingsPtr proSet = ManagerST::Get()->GetProjectSettings(projectName);
if (proSet) {
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = proSet->GetFirstBuildConfiguration(cookie);
while (bldConf) {
iter->second.choiceControl->Append(bldConf->GetName());
bldConf = proSet->GetNextBuildConfiguration(cookie);
}
//append the EDIT & NEW commands
iter->second.choiceControl->Append(clCMD_EDIT);
iter->second.choiceControl->Append(clCMD_NEW);
//select the build configuration according to the build matrix
BuildMatrixPtr matrix = ManagerST::Get()->GetWorkspaceBuildMatrix();
if (!matrix) {
return;
}
wxString configName = matrix->GetProjectSelectedConf(m_choiceConfigurations->GetStringSelection(), projectName);
int match = iter->second.choiceControl->FindString(configName);
if (match != wxNOT_FOUND) {
iter->second.choiceControl->SetStringSelection(configName);
} else {
iter->second.choiceControl->SetSelection(0);
}
return;
}
}
}
}
示例6: AddEntry
void ConfigurationManagerDlg::AddEntry(const wxString &projectName, const wxString &selectedConf)
{
wxFlexGridSizer *mainSizer = dynamic_cast<wxFlexGridSizer*>(m_scrolledWindow->GetSizer());
if (!mainSizer) return;
wxArrayString choices;
wxChoice *choiceConfig = new wxChoice( m_scrolledWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices, 0 );
// Get all configuration of the project
ProjectSettingsPtr settings = ManagerST::Get()->GetProjectSettings(projectName);
if (settings) {
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while (bldConf) {
choiceConfig->Append(bldConf->GetName());
bldConf = settings->GetNextBuildConfiguration(cookie);
}
}
choiceConfig->Append(clCMD_NEW);
choiceConfig->Append(clCMD_EDIT);
ConnectChoice(choiceConfig, ConfigurationManagerDlg::OnConfigSelected);
wxStaticText *text = new wxStaticText( m_scrolledWindow, wxID_ANY, projectName, wxDefaultPosition, wxDefaultSize, 0 );
int where = choiceConfig->FindString(selectedConf);
if (where == wxNOT_FOUND) {
where = 0;
}
choiceConfig->SetSelection(where);
mainSizer->Add(text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
mainSizer->Add(choiceConfig, 1, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, 5);
ConfigEntry entry;
entry.project = projectName;
entry.projectSettings = settings;
entry.choiceControl = choiceConfig;
m_projSettingsMap[choiceConfig->GetId()] = entry;
}
示例7: showSettingsDialogFor
void MacBundler::showSettingsDialogFor(ProjectPtr project)
{
// project->GetSettings()->GetGlobalSettings();
// project->GetSettings()->GetBuildConfiguration(name);
ProjectSettingsCookie cookie;
ProjectSettingsPtr settings = project->GetSettings();
if(not settings) {
wxMessageBox(_("Cannot continue, impossible to access project settings."));
return;
}
std::map<wxString, BuildConfigPtr> configs;
wxArrayString choices;
// TODO: allow putting the rules in the config root and not in every target
BuildConfigPtr buildConfig = settings->GetFirstBuildConfiguration(cookie);
while(buildConfig) {
configs[buildConfig->GetName()] = buildConfig;
choices.Add(buildConfig->GetName());
buildConfig = settings->GetNextBuildConfiguration(cookie);
}
bool accepted = false;
bool generateInfoPlistFile = false;
bool generateIcon = false;
wxArrayString targetsToSet;
wxString iconName(wxT("icon.icns"));
{
BundleConfigDialog configDlg(project, m_mgr->GetTheApp()->GetTopWindow(), choices, m_mgr);
configDlg.ShowModal();
accepted = configDlg.getResults(targetsToSet, &generateInfoPlistFile, &generateIcon);
iconName = configDlg.getIconDestName();
if(accepted and generateInfoPlistFile) {
wxFileName projPath = project->GetFileName();
projPath.SetFullName(wxT(""));
const wxString projectDirName = projPath.GetFullPath();
const wxString infoPlistFile = projectDirName + wxT("/Info.plist");
if(wxFileExists(infoPlistFile)) {
int out = wxMessageBox(wxString::Format(_("The following file:\n%s\nalready exists, overwrite it?\n"),
infoPlistFile.c_str()),
_("Warning"),
wxYES_NO);
if(out == wxYES) {
wxTextFile file;
file.Open(infoPlistFile);
file.Clear();
configDlg.writeInfoPlistFile(file);
file.Close();
}
} else {
wxTextFile file;
if(not file.Create(infoPlistFile)) {
wxMessageBox(_("Could not create Info.plist file\n") + infoPlistFile);
} else {
configDlg.writeInfoPlistFile(file);
file.Close();
}
}
if(wxFileExists(infoPlistFile)) {
// FIXME: if the file was already present, it will be added again and appear twice in the file tree
wxArrayString paths;
paths.Add(infoPlistFile);
m_mgr->CreateVirtualDirectory(project->GetName(), wxT("osx"));
m_mgr->AddFilesToVirtualFolder(project->GetName() + wxT(":osx"), paths);
}
} // nend if create info.plist
if(accepted and generateIcon) {
wxString iconSourcePath = configDlg.getIconSource();
if(not iconSourcePath.IsEmpty()) {
// sips doesn't like double slashes in path names
iconSourcePath.Replace(wxT("//"), wxT("/"));
wxFileName projPath = project->GetFileName();
projPath.SetFullName(wxT(""));
const wxString projectDirName = projPath.GetFullPath();
wxString iconFileDest = projectDirName + wxT("/") + configDlg.getIconDestName();
// sips doesn't like double slashes in path names
iconFileDest.Replace(wxT("//"), wxT("/"));
std::cout << "Copying icon '" << iconSourcePath.mb_str() << "' to project\n";
if(iconSourcePath.EndsWith(wxT(".icns"))) {
if(not wxCopyFile(iconSourcePath, iconFileDest)) {
wxMessageBox(_("Sorry, could not copy icon"));
}
} else {
wxString cmd =
wxT("sips -s format icns '") + iconSourcePath + wxT("' --out '") + iconFileDest + wxT("'");
//.........这里部分代码省略.........
示例8: wxDialog
EditConfigurationDialog::EditConfigurationDialog( wxWindow* parent, const wxString &projectName, int id, wxString title, wxPoint pos, wxSize size, int style )
: wxDialog( parent, id, title, pos, size, style )
, m_projectName(projectName)
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizer15;
bSizer15 = new wxBoxSizer( wxVERTICAL );
m_panel6 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxHORIZONTAL );
m_configurationsList = new wxListBox( m_panel6, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizer17->Add( m_configurationsList, 1, wxALL|wxEXPAND, 5 );
ProjectSettingsPtr settings = ManagerST::Get()->GetProjectSettings(m_projectName);
if(settings){
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while(bldConf){
m_configurationsList->Append(bldConf->GetName());
bldConf = settings->GetNextBuildConfiguration(cookie);
}
}
if(m_configurationsList->GetCount() > 0)
m_configurationsList->SetSelection(0);
wxBoxSizer* bSizer18;
bSizer18 = new wxBoxSizer( wxVERTICAL );
m_buttonDelete = new wxButton( m_panel6, wxID_ANY, wxT("&Delete"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer18->Add( m_buttonDelete, 0, wxALL, 5 );
m_buttonRename = new wxButton( m_panel6, wxID_ANY, wxT("&Rename"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer18->Add( m_buttonRename, 0, wxALL, 5 );
bSizer17->Add( bSizer18, 0, wxEXPAND, 5 );
m_panel6->SetSizer( bSizer17 );
m_panel6->Layout();
bSizer17->Fit( m_panel6 );
bSizer15->Add( m_panel6, 1, wxALL|wxEXPAND, 5 );
m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer15->Add( m_staticline9, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizer16;
bSizer16 = new wxBoxSizer( wxHORIZONTAL );
m_buttonClose = new wxButton( this, wxID_OK, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer16->Add( m_buttonClose, 0, wxALL, 5 );
bSizer15->Add( bSizer16, 0, wxALIGN_CENTER, 5 );
this->SetSizer( bSizer15 );
this->Layout();
ConnectListBoxDClick(m_configurationsList, EditConfigurationDialog::OnItemDclick);
ConnectButton(m_buttonClose, EditConfigurationDialog::OnButtonClose);
ConnectButton(m_buttonRename, EditConfigurationDialog::OnButtonRename);
ConnectButton(m_buttonDelete, EditConfigurationDialog::OnButtonDelete);
}
示例9: RemoveProject
bool clCxxWorkspace::RemoveProject(const wxString& name, wxString& errMsg)
{
ProjectPtr proj = FindProjectByName(name, errMsg);
if(!proj) {
return false;
}
// remove the associated build configuration with this
// project
RemoveProjectFromBuildMatrix(proj);
// remove the project from the internal map
std::map<wxString, ProjectPtr>::iterator iter = m_projects.find(proj->GetName());
if(iter != m_projects.end()) {
m_projects.erase(iter);
}
// update the xml file
wxXmlNode* root = m_doc.GetRoot();
wxXmlNode* child = root->GetChildren();
while(child) {
if(child->GetName() == wxT("Project") && child->GetPropVal(wxT("Name"), wxEmptyString) == name) {
if(child->GetPropVal(wxT("Active"), wxEmptyString).CmpNoCase(wxT("Yes")) == 0) {
// the removed project was active,
// select new project to be active
if(!m_projects.empty()) {
std::map<wxString, ProjectPtr>::iterator iter = m_projects.begin();
SetActiveProject(iter->first, true);
}
}
root->RemoveChild(child);
delete child;
break;
}
child = child->GetNext();
}
// go over the dependencies list of each project and remove the project
iter = m_projects.begin();
for(; iter != m_projects.end(); iter++) {
ProjectPtr p = iter->second;
if(p) {
wxArrayString configs;
// populate the choice control with the list of available configurations for this project
ProjectSettingsPtr settings = p->GetSettings();
if(settings) {
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while(bldConf) {
configs.Add(bldConf->GetName());
bldConf = settings->GetNextBuildConfiguration(cookie);
}
}
// update each configuration of this project
for(size_t i = 0; i < configs.GetCount(); i++) {
wxArrayString deps = p->GetDependencies(configs.Item(i));
int where = deps.Index(name);
if(where != wxNOT_FOUND) {
deps.RemoveAt((size_t)where);
}
// update the configuration
p->SetDependencies(deps, configs.Item(i));
}
}
}
return SaveXmlFile();
}
示例10: AddProjectToBuildMatrix
void clCxxWorkspace::AddProjectToBuildMatrix(ProjectPtr prj)
{
if(!prj) {
wxMessageBox(_("AddProjectToBuildMatrix was called with NULL project"), _("CodeLite"), wxICON_WARNING | wxOK);
return;
}
BuildMatrixPtr matrix = GetBuildMatrix();
wxString selConfName = matrix->GetSelectedConfigurationName();
std::list<WorkspaceConfigurationPtr> wspList = matrix->GetConfigurations();
std::list<WorkspaceConfigurationPtr>::iterator iter = wspList.begin();
for(; iter != wspList.end(); iter++) {
WorkspaceConfigurationPtr workspaceConfig = (*iter);
WorkspaceConfiguration::ConfigMappingList prjList = workspaceConfig->GetMapping();
wxString wspCnfName = workspaceConfig->GetName();
ProjectSettingsCookie cookie;
// getSettings is a bit misleading, since it actually create new instance which represents the layout
// of the XML
ProjectSettingsPtr settings = prj->GetSettings();
BuildConfigPtr prjBldConf = settings->GetFirstBuildConfiguration(cookie);
BuildConfigPtr matchConf;
if(!prjBldConf) {
// the project does not have any settings, create new one and add it
prj->SetSettings(settings);
settings = prj->GetSettings();
prjBldConf = settings->GetFirstBuildConfiguration(cookie);
matchConf = prjBldConf;
} else {
matchConf = prjBldConf;
// try to locate the best match to add to the workspace
while(prjBldConf) {
wxString projBldConfName = prjBldConf->GetName();
if(wspCnfName == projBldConfName) {
// we found a suitable match use it instead of the default one
matchConf = prjBldConf;
break;
}
prjBldConf = settings->GetNextBuildConfiguration(cookie);
}
}
ConfigMappingEntry entry(prj->GetName(), matchConf->GetName());
prjList.push_back(entry);
(*iter)->SetConfigMappingList(prjList);
matrix->SetConfiguration((*iter));
}
// and set the configuration name
matrix->SetSelectedConfigurationName(selConfName);
// this will also reset the build matrix pointer
SetBuildMatrix(matrix);
}