当前位置: 首页>>代码示例>>C++>>正文


C++ clBuildEvent::SetCommand方法代码示例

本文整理汇总了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);
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:49,代码来源:CMakePlugin.cpp

示例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") );
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:19,代码来源:qmakeplugin.cpp

示例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()) );
}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:20,代码来源:qmakeplugin.cpp


注:本文中的clBuildEvent::SetCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。