本文整理汇总了C++中clBuildEvent::SetCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ clBuildEvent::SetCommand方法的具体用法?C++ clBuildEvent::SetCommand怎么用?C++ clBuildEvent::SetCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clBuildEvent
的用法示例。
在下文中一共展示了clBuildEvent::SetCommand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSettingsManager
void
CMakePlugin::ProcessBuildEvent(clBuildEvent& event, wxString param)
{
wxString project = event.GetProjectName();
const wxString config = event.GetConfigurationName();
// Get settings
const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);
// Doesn't exists or not enabled
if (!settings || !settings->enabled) {
// Unable to export makefile
event.Skip();
return;
}
// Project has parent project
if (!settings->parentProject.IsEmpty()) {
// Add project name as target
param = project + " " + param;
// Build parent project
project = settings->parentProject;
}
// Workspace directory
const wxFileName workspaceDir = GetWorkspaceDirectory();
// Use relative path
wxFileName projectDir = GetProjectDirectory(project);
projectDir.MakeRelativeTo(workspaceDir.GetFullPath());
const wxString projectDirEsc = projectDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);
// Build command
wxString cmd = "$(MAKE)";
if (!projectDirEsc.IsEmpty())
cmd += " -C \"" + projectDirEsc + "\"";
// Add makefile
cmd += " -f \"" + project + ".mk\"";
// Add optional parameters
if (!param.IsEmpty())
cmd += " " + param;
// The build command is simple make call with different makefile
event.SetCommand(cmd);
}
示例2: OnGetCleanCommand
void QMakePlugin::OnGetCleanCommand(clBuildEvent& event)
{
QmakePluginData::BuildConfPluginData bcpd;
wxString project = event.GetProjectName();
wxString config = event.GetConfigurationName();
if ( !DoGetData(project, config, bcpd) ) {
event.Skip();
return;
}
if ( !bcpd.m_enabled ) {
event.Skip();
return;
}
event.SetCommand( DoGetBuildCommand(project, config, event.IsProjectOnly()) + wxT(" clean") );
}
示例3: OnGetBuildCommand
void QMakePlugin::OnGetBuildCommand(clBuildEvent& event)
{
QmakePluginData::BuildConfPluginData bcpd;
wxString project = event.GetProjectName();
wxString config = event.GetConfigurationName();
if ( !DoGetData(project, config, bcpd) ) {
event.Skip();
return;
}
if ( !bcpd.m_enabled ) {
event.Skip();
return;
}
// we avoid calling event.Skip() to override the default build system by this one
event.SetCommand( DoGetBuildCommand(project, config, event.IsProjectOnly()) );
}