本文整理汇总了C++中ProjectSettingsPtr::SetBuildConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectSettingsPtr::SetBuildConfiguration方法的具体用法?C++ ProjectSettingsPtr::SetBuildConfiguration怎么用?C++ ProjectSettingsPtr::SetBuildConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectSettingsPtr
的用法示例。
在下文中一共展示了ProjectSettingsPtr::SetBuildConfiguration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
示例2: showSettingsDialogFor
//.........这里部分代码省略.........
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("'");
std::cout << cmd.mb_str() << std::endl;
wxExecute(cmd, wxEXEC_SYNC);
if(not wxFileExists(iconFileDest)) {
wxMessageBox(_("Sorry, could not convert selected icon to icns format"));
}
}
// FIXME: if the file was already present, it will be added again and appear twice in the file tree
if(wxFileExists(iconFileDest)) {
wxArrayString paths;
paths.Add(iconFileDest);
m_mgr->CreateVirtualDirectory(project->GetName(), wxT("osx"));
m_mgr->AddFilesToVirtualFolder(project->GetName() + wxT(":osx"), paths);
}
} // end if icon not null
} // end if generate icon
}
if(!accepted) return;
for(int n = 0; n < targetsToSet.GetCount(); n++) {
BuildConfigPtr buildConfig = configs[targetsToSet[n]];
wxString outputFileName = buildConfig->GetOutputFileName();
wxString output = wxT("$(ProjectName).app/Contents/MacOS/$(ProjectName)");
buildConfig->SetOutputFileName(wxT("$(IntermediateDirectory)/") + output);
buildConfig->SetCommand(wxT("./") + output);
if(generateInfoPlistFile or generateIcon) {
// get existing custom makefile targets, if any
wxString customPreBuild = buildConfig->GetPreBuildCustom();
wxString deps, rules;
deps = customPreBuild.BeforeFirst(wxT('\n'));
rules = customPreBuild.AfterFirst(wxT('\n'));
rules = rules.Trim();
rules = rules.Trim(false);
deps = deps.Trim();
deps = deps.Trim(false);
if(generateInfoPlistFile) {
// augment existing rules with new rules to manage Info.plist file
deps.Append(wxT(" $(IntermediateDirectory)/$(ProjectName).app/Contents/Info.plist"));
rules.Append(wxString(wxT("\n## rule to copy the Info.plist file into the bundle\n")) +
wxT("$(IntermediateDirectory)/$(ProjectName).app/Contents/Info.plist: Info.plist\n") +
wxT("\tmkdir -p '$(IntermediateDirectory)/$(ProjectName).app/Contents' && cp -f "
"Info.plist '$(IntermediateDirectory)/$(ProjectName).app/Contents/Info.plist'"));
}
if(generateIcon) {
// augment existing rules with new rules to manage Info.plist file
deps.Append(wxT(" $(IntermediateDirectory)/$(ProjectName).app/Contents/Resources/") + iconName);
rules.Append(
wxT("\n## rule to copy the icon file into the "
"bundle\n$(IntermediateDirectory)/$(ProjectName).app/Contents/Resources/") +
iconName + wxT(": ") + iconName +
wxT("\n\tmkdir -p '$(IntermediateDirectory)/$(ProjectName).app/Contents/Resources/' && cp -f ") +
iconName + wxT(" '$(IntermediateDirectory)/$(ProjectName).app/Contents/Resources/") + iconName +
wxT("'"));
}
// set the new rules
rules = rules.Trim();
rules = rules.Trim(false);
deps = deps.Trim();
deps = deps.Trim(false);
wxString prebuilstep;
prebuilstep << deps << wxT("\n");
prebuilstep << rules;
prebuilstep << wxT("\n");
// Set the content only if there is real content to add
wxString tmpPreBuildStep(prebuilstep);
tmpPreBuildStep.Trim().Trim(false);
buildConfig->SetPreBuildCustom(prebuilstep);
} // end if
settings->SetBuildConfiguration(buildConfig);
} // end for
project->SetSettings(settings);
}
示例3: AddConfiguration
void VcImporter::AddConfiguration(ProjectSettingsPtr settings, wxXmlNode* config)
{
// configuration name
wxString name = XmlUtils::ReadString(config, wxT("Name"));
name = name.BeforeFirst(wxT('|'));
name.Replace(wxT(" "), wxT("_"));
BuildConfigPtr le_conf(new BuildConfig(NULL));
le_conf->SetName(name);
le_conf->SetIntermediateDirectory(XmlUtils::ReadString(config, wxT("IntermediateDirectory")));
// get the compiler settings
wxXmlNode* cmpNode = XmlUtils::FindNodeByName(config, wxT("Tool"), wxT("VCCLCompilerTool"));
// get the include directories
le_conf->SetIncludePath(SplitString(XmlUtils::ReadString(cmpNode, wxT("AdditionalIncludeDirectories"))));
le_conf->SetPreprocessor(XmlUtils::ReadString(cmpNode, wxT("PreprocessorDefinitions")));
// Select the best compiler for the import process (we select g++ by default)
le_conf->SetCompilerType(m_compiler);
// Get the configuration type
long type = XmlUtils::ReadLong(config, wxT("ConfigurationType"), 1);
wxString projectType;
wxString errMsg;
switch(type) {
case 2: // dll
projectType = Project::DYNAMIC_LIBRARY;
break;
case 4: // static library
projectType = Project::STATIC_LIBRARY;
break;
case 1: // exe
default:
projectType = Project::EXECUTABLE;
break;
}
le_conf->SetProjectType(projectType);
// if project type is DLL or Executable, copy linker settings as well
if(settings->GetProjectType(le_conf->GetName()) == Project::EXECUTABLE ||
settings->GetProjectType(le_conf->GetName()) == Project::DYNAMIC_LIBRARY) {
wxXmlNode* linkNode = XmlUtils::FindNodeByName(config, wxT("Tool"), wxT("VCLinkerTool"));
if(linkNode) {
wxString outputFileName(XmlUtils::ReadString(linkNode, wxT("OutputFile")));
#ifndef __WXMSW__
outputFileName.Replace(wxT(".dll"), wxT(".so"));
outputFileName.Replace(wxT(".exe"), wxT(""));
#endif
le_conf->SetOutputFileName(outputFileName);
// read in the additional libraries & libpath
wxString libs = XmlUtils::ReadString(linkNode, wxT("AdditionalDependencies"));
// libs is a space delimited string
wxStringTokenizer tk(libs, wxT(" "));
libs.Empty();
while(tk.HasMoreTokens()) {
libs << tk.NextToken() << wxT(";");
}
le_conf->SetLibraries(libs);
le_conf->SetLibPath(XmlUtils::ReadString(linkNode, wxT("AdditionalLibraryDirectories")));
}
} else {
// static library
wxXmlNode* libNode = XmlUtils::FindNodeByName(config, wxT("Tool"), wxT("VCLibrarianTool"));
if(libNode) {
wxString outputFileName(XmlUtils::ReadString(libNode, wxT("OutputFile")));
outputFileName.Replace(wxT("\\"), wxT("/"));
wxString outputFileNameOnly = outputFileName.AfterLast(wxT('/'));
wxString outputFilePath = outputFileName.BeforeLast(wxT('/'));
if(m_compilerLowercase.Contains(wxT("gnu"))) {
if(outputFileNameOnly.StartsWith(wxT("lib")) == false) {
outputFileNameOnly.Prepend(wxT("lib"));
}
outputFileName.Clear();
outputFileName << outputFilePath << wxT("/") << outputFileNameOnly;
outputFileName.Replace(wxT(".lib"), wxT(".a"));
}
le_conf->SetOutputFileName(outputFileName);
}
}
// add the configuration
settings->SetBuildConfiguration(le_conf);
}