⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msvc_prj_generator.cpp

📁 ncbi源码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
            //PreprocessorDefinitions            BIND_TOOLS(tool,                        msvc_tool.ResourceCompiler(),                        PreprocessorDefinitions);                        conf->SetTool().push_back(tool);        }}        {{            //WebServiceProxyGenerator            CRef<CTool> tool(new CTool(""));            //Name            BIND_TOOLS(tool, msvc_tool.WebServiceProxyGenerator(), Name);            conf->SetTool().push_back(tool);        }}        {{            //XMLDataGenerator            CRef<CTool> tool(new CTool(""));            //Name            BIND_TOOLS(tool, msvc_tool.XMLDataGenerator(), Name);            conf->SetTool().push_back(tool);        }}        {{            //ManagedWrapperGenerator            CRef<CTool> tool(new CTool(""));            //Name            BIND_TOOLS(tool, msvc_tool.ManagedWrapperGenerator(), Name);            conf->SetTool().push_back(tool);        }}        {{            //AuxiliaryManagedWrapperGenerator            CRef<CTool> tool(new CTool(""));            //Name            BIND_TOOLS(tool,                        msvc_tool.AuxiliaryManagedWrapperGenerator(),                       Name);            conf->SetTool().push_back(tool);        }}        xmlprj.SetConfigurations().SetConfiguration().push_back(conf);    }    {{        //References        xmlprj.SetReferences("");    }}    // Collect all source, header, inline, resource files    CMsvcPrjFilesCollector      collector(project_context, prj);        // Insert sources, headers, inlines:    auto_ptr<IFilesToProjectInserter> inserter;    if (prj.m_ProjType == CProjKey::eDll) {        inserter.reset(new CDllProjectFilesInserter                                    (&xmlprj,                                     CProjKey(prj.m_ProjType, prj.m_ID),                                      project_configs,                                      project_context.ProjectDir()));    } else {        inserter.reset(new CBasicProjectsFilesInserter                                      (&xmlprj,                                      prj.m_ID,                                      project_configs,                                       project_context.ProjectDir()));    }    ITERATE(list<string>, p, collector.SourceFiles()) {        //Include collected source files        const string& rel_source_file = *p;        inserter->AddSourceFile(rel_source_file);    }    ITERATE(list<string>, p, collector.HeaderFiles()) {        //Include collected header files        const string& rel_source_file = *p;        inserter->AddHeaderFile(rel_source_file);    }    ITERATE(list<string>, p, collector.InlineFiles()) {        //Include collected inline files        const string& rel_source_file = *p;        inserter->AddInlineFile(rel_source_file);    }    inserter->Finalize();    {{        //Resource Files - header files - empty        CRef<CFilter> filter(new CFilter());        filter->SetAttlist().SetName("Resource Files");        filter->SetAttlist().SetFilter            ("rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx");        ITERATE(list<string>, p, collector.ResourceFiles()) {            //Include collected header files            CRef<CFFile> file(new CFFile());            file->SetAttlist().SetRelativePath(*p);            CRef< CFilter_Base::C_FF::C_E > ce(new CFilter_Base::C_FF::C_E());            ce->SetFile(*file);            filter->SetFF().SetFF().push_back(ce);        }        xmlprj.SetFiles().SetFilter().push_back(filter);    }}    {{        //Custom Build files        const list<SCustomBuildInfo>& info_list =             project_context.GetCustomBuildInfo();        if ( !info_list.empty() ) {            CRef<CFilter> filter(new CFilter());            filter->SetAttlist().SetName("Custom Build Files");            filter->SetAttlist().SetFilter("");                        ITERATE(list<SCustomBuildInfo>, p, info_list) {                 const SCustomBuildInfo& build_info = *p;                AddCustomBuildFileToFilter(filter,                                            project_configs,                                            project_context.ProjectDir(),                                           build_info);            }            xmlprj.SetFiles().SetFilter().push_back(filter);        }    }}    {{        //Datatool files        if ( !prj.m_DatatoolSources.empty() ) {                        CRef<CFilter> filter(new CFilter());            filter->SetAttlist().SetName("Datatool Files");            filter->SetAttlist().SetFilter("");            ITERATE(list<CDataToolGeneratedSrc>, p, prj.m_DatatoolSources) {                const CDataToolGeneratedSrc& src = *p;                SCustomBuildInfo build_info;                s_CreateDatatoolCustomBuildInfo(prj,                                               project_context,                                               src,                                               &build_info);                AddCustomBuildFileToFilter(filter,                                            project_configs,                                            project_context.ProjectDir(),                                            build_info);            }            xmlprj.SetFiles().SetFilter().push_back(filter);        }    }}    {{        //Globals        xmlprj.SetGlobals("");    }}    string project_path = CDirEntry::ConcatPath(project_context.ProjectDir(),                                                 project_context.ProjectName());    project_path += MSVC_PROJECT_FILE_EXT;    SaveIfNewer(project_path, xmlprj);}static void s_CreateDatatoolCustomBuildInfo(const CProjItem&              prj,                                     const CMsvcPrjProjectContext& context,                                     const CDataToolGeneratedSrc&  src,                                                                        SCustomBuildInfo*             build_info){    build_info->Clear();    //SourceFile    build_info->m_SourceFile =         CDirEntry::ConcatPath(src.m_SourceBaseDir, src.m_SourceFile);    //CommandLine    //exe location - path is supposed to be relative encoded    string tool_exe_location("");    if (prj.m_ProjType == CProjKey::eApp)        tool_exe_location = GetApp().GetDatatoolPathForApp();    else if (prj.m_ProjType == CProjKey::eLib)        tool_exe_location = GetApp().GetDatatoolPathForLib();    else if (prj.m_ProjType == CProjKey::eDll)        tool_exe_location = GetApp().GetDatatoolPathForApp();    else        return;    //command line    string tool_cmd_prfx = GetApp().GetDatatoolCommandLine();    tool_cmd_prfx += " -or ";    tool_cmd_prfx +=         CDirEntry::CreateRelativePath(GetApp().GetProjectTreeInfo().m_Src,                                      src.m_SourceBaseDir);    tool_cmd_prfx += " -oR ";    tool_cmd_prfx += CDirEntry::CreateRelativePath(context.ProjectDir(),                                         GetApp().GetProjectTreeInfo().m_Root);    string tool_cmd(tool_cmd_prfx);    if ( !src.m_ImportModules.empty() ) {        tool_cmd += " -M \"";        tool_cmd += NStr::Join(src.m_ImportModules, " ");        tool_cmd += '"';    }    build_info->m_CommandLine =         "@echo on\n" + tool_exe_location + " " + tool_cmd;    //Description    build_info->m_Description =         "Using datatool to create a C++ object from ASN/DTD $(InputPath)";    //Outputs#if 0    string data_tool_src_base;    CDirEntry::SplitPath(src.m_SourceFile, NULL, &data_tool_src_base);    string outputs = "$(InputDir)" + data_tool_src_base + "__.cpp;";    outputs += "$(InputDir)" + data_tool_src_base + "___.cpp;";    build_info->m_Outputs = outputs;#endif    build_info->m_Outputs = "$(InputDir)$(InputName).files;";    //Additional Dependencies    build_info->m_AdditionalDependencies = "$(InputDir)$(InputName).def;";}END_NCBI_SCOPE/* * =========================================================================== * $Log: msvc_prj_generator.cpp,v $ * Revision 1000.2  2004/06/16 17:02:30  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.35 * * Revision 1.35  2004/06/10 15:16:46  gorelenk * Changed macrodefines to be comply with GCC 3.4.0 . * * Revision 1.34  2004/05/26 18:01:46  gorelenk * Changed CMsvcProjectGenerator::Generate : * Changed insertion fo source files, headers, inlines. * Changed s_CreateDatatoolCustomBuildInfo : * used $(InputDir)$(InputName).files as a datatool sources custom build step * output. * * Revision 1.33  2004/05/21 21:41:41  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.32  2004/05/10 19:55:08  gorelenk * Changed CMsvcProjectGenerator::Generate . * * Revision 1.31  2004/05/10 14:28:01  gorelenk * Changed implementation CMsvcProjectGenerator::Generate . * * Revision 1.30  2004/04/30 13:57:01  dicuccio * Fixed project generation to correct dependency rules for datatool-generated * code. * * Revision 1.29  2004/03/18 22:44:26  gorelenk * Changed implementation of CMsvcProjectGenerator::Generate - implemented * custom builds only in available configurations. * * Revision 1.28  2004/03/16 21:26:26  gorelenk * Added generation dependencies from $(InputDir)$(InputName).def * to s_CreateDatatoolCustomBuildInfo. * * Revision 1.27  2004/03/15 22:22:01  gorelenk * Changed implementation of s_CreateDatatoolCustomBuildInfo. * * Revision 1.26  2004/03/10 16:39:56  gorelenk * Changed LOG_POST inside CMsvcProjectGenerator::Generate. * * Revision 1.25  2004/03/08 23:35:04  gorelenk * Changed implementation of CMsvcProjectGenerator::Generate. * * Revision 1.24  2004/03/05 20:31:54  gorelenk * Files collecting functionality was moved to separate class : * CMsvcPrjFilesCollector. * * Revision 1.23  2004/03/05 18:07:22  gorelenk * Changed implementation of s_CreateDatatoolCustomBuildInfo . * * Revision 1.22  2004/02/25 20:19:36  gorelenk * Changed implementation of function s_IsInsideDatatoolSourceDir. * * Revision 1.21  2004/02/25 19:42:35  gorelenk * Changed implementation of function s_IsProducedByDatatool. * * Revision 1.20  2004/02/24 21:03:06  gorelenk * Added checking of config availability to implementation of * member-function Generate of class CMsvcProjectGenerator. * * Revision 1.19  2004/02/23 20:42:57  gorelenk * Added support of MSVC ResourceCompiler tool. * * Revision 1.18  2004/02/20 22:53:26  gorelenk * Added analysis of ASN projects depends. * * Revision 1.17  2004/02/13 23:11:10  gorelenk * Changed implementation of function s_CreateDatatoolCustomBuildInfo - added * list of output files to generated SCustomBuildInfo. * * Revision 1.16  2004/02/13 20:31:20  gorelenk * Changed source relative path for datatool input files. * * Revision 1.15  2004/02/12 16:27:57  gorelenk * Changed generation of command line for datatool. * * Revision 1.14  2004/02/10 18:09:12  gorelenk * Added definitions of functions SaveIfNewer and PromoteIfDifferent * - support for file overwriting only if it was changed. * * Revision 1.13  2004/02/06 23:14:59  gorelenk * Implemented support of ASN projects, semi-auto configure, * CPPFLAGS support. Second working version. * * Revision 1.12  2004/02/05 00:02:08  gorelenk * Added support of user site and  Makefile defines. * * Revision 1.11  2004/02/03 17:20:47  gorelenk * Changed implementation of method Generate of class CMsvcProjectGenerator. * * Revision 1.10  2004/01/30 20:46:55  gorelenk * Added support of ASN projects. * * Revision 1.9  2004/01/29 15:48:58  gorelenk * Support of projects fitering transfered to CProjBulderApp class * * Revision 1.8  2004/01/28 17:55:48  gorelenk * += For msvc makefile support of : *                 Requires tag, ExcludeProject tag, *                 AddToProject section (SourceFiles and IncludeDirs), *                 CustomBuild section. * += For support of user local site. * * Revision 1.7  2004/01/26 19:27:28  gorelenk * += MSVC meta makefile support * += MSVC project makefile support * * Revision 1.6  2004/01/22 17:57:54  gorelenk * first version * * =========================================================================== */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -