(!
msg.m_Buffer) {
97 switch(
msg.m_Severity) {
108 if(strlen(
msg.m_File) != 0) {
109cerr <<
msg.m_File <<
": ";
118 if(strlen(
msg.m_File) == 0) {
124cerr <<
"("<<
msg.m_Line <<
")";
133 switch(
msg.m_Severity) {
152cerr <<
msg.m_ErrCode <<
": ";
174 #ifdef COMBINED_EXCLUDE 182 constlist<string> implicit_exclude_dirs =
184 ITERATE(list<string>, p, implicit_exclude_dirs) {
185 const string& dir = *p;
198 structPIsExcludedMakefileIn
202PIsExcludedMakefileIn(
const string& root_src_dir)
203:m_RootSrcDir(
CDirEntry::NormalizePath(root_src_dir))
205ProcessDir(root_src_dir);
208 booloperator() (
constTValueType& item)
const 212 constlist<string> implicit_exclude_dirs =
214 ITERATE(list<string>, p, implicit_exclude_dirs) {
215 const string& dir = *p;
228TMakefiles m_Makefiles;
230 voidProcessDir(
const string& dir_name)
235 stringname = (*i)->GetName();
236 if( name ==
"."|| name ==
".."||
240 stringpath = (*i)->GetPath();
242 if( (*i)->IsFile() &&
243name ==
"Makefile.in.msvc") {
249 else if( (*i)->IsDir() ) {
256 boolIsExcplicitlyIncluded(
const string& project_base_dir)
const 258 stringdir = project_base_dir;
261 if(dir == m_RootSrcDir)
264TMakefiles::const_iterator p =
265m_Makefiles.find(path);
266 if( p != m_Makefiles.end() ) {
268(p->second)->GetString(
"Common",
"ExcludeProject");
269 if(
val==
"FALSE")
282 template<
classT1,
classT2,
classV>
classCCombine
285CCombine(
constT1& t1,
constT2& t2)
289 booloperator() (
constV& v)
const 291 returnm_T1(v) && m_T2(v);
306 constlist<string> implicit_exclude_dirs =
308 ITERATE(list<string>, p, implicit_exclude_dirs) {
309 const string& dir = *p;
314 "Excluded: project "<< project.
m_Name 315<<
" by ProjectTree/ImplicitExclude");
324 "Excluded: project "<< project.
m_Name 325<<
" by Makefile."<< project.
m_Name<<
".*." 326<<
GetApp().GetRegSettings().m_MakefilesExt);
343!
GetApp().IsAllowedProjectTag(project) ) {
346 "Excluded due to proj_tag; this project tags: "<< unmet);
361!
GetApp().m_CustomConfiguration.DoesValueContain(
362 "__AllowedProjects",
365 "Excluded by user request");
382 "Excluded due to unmet requirement: " 399 "Excluded unused external");
439 if(logfile !=
"STDERR") {
463 context+=
" projects tree builder application";
468arg_desc->AddPositional(
"root",
469 "Root directory of the build tree. "\
470 "This directory ends with \"c++\".",
473arg_desc->AddPositional(
"subtree",
474 "Subtree, or a file with a list of subtrees to build."\
475 " Examples: src/corelib/ scripts/projects/ncbi_cpp.lst",
478arg_desc->AddPositional(
"solution",
479 "MSVC Solution to build.",
482arg_desc->AddFlag (
"dll",
483 "Dll(s) will be built instead of static libraries.",
486arg_desc->AddFlag (
"nobuildptb",
487 "Exclude \"build PTB\" step from CONFIGURE project.");
489arg_desc->AddFlag (
"ext",
490 "Use external libraries instead of missing in-tree ones.");
491arg_desc->AddFlag (
"nws",
492 "Do not scan the whole source tree for missing projects.");
493arg_desc->AddOptionalKey(
"extroot",
"external_build_root",
494 "Subtree in which to look for external libraries.",
497arg_desc->AddOptionalKey(
"projtag",
"project_tag",
498 "Expression. Include only projects that match."\
499 " Example: \"core && (test || !demo)\"",
502 #if defined(NCBI_XCODE_BUILD) || defined(PSEUDO_XCODE) 503arg_desc->AddOptionalKey(
"ide",
"xcode_version",
504 "Target version of Xcode, for example: 30",
506arg_desc->AddOptionalKey(
"arch",
"architecture",
507 "Target architecture, for example: ppc, i386",
509 #elif defined(NCBI_COMPILER_MSVC) 510arg_desc->AddOptionalKey(
"ide",
"msvc_version",
511 "Target version of MS Visual Studio, for example: 1200, 1400, 1500",
513arg_desc->AddOptionalKey(
"arch",
"platform",
514 "Target platform, for example: Win32, x64",
518arg_desc->AddFlag (
"cfg",
519 "Show GUI to confirm configuration parameters (MS Windows only).");
520arg_desc->AddFlag (
"i",
521 "Run interactively. Can only be used by PTB GUI shell!");
522arg_desc->AddFlag (
"dtdep",
523 "Add dependency on datatool where needed.");
524arg_desc->AddFlag (
"noadddep",
525 "Do not add missing dependencies.");
526arg_desc->AddDefaultKey(
"libdep",
"LibraryDependencies",
527 "Analyze dependencies and generate library info for linker on Unix",
530arg_desc->AddOptionalKey(
"args",
"args_file",
531 "Read arguments from a file",
543 boolreported =
false;
546 boolreal_cycle =
false;
549host =
tree[*m].m_DllHost;
550 if(m == cycle.begin()) {
553real_cycle = (host0 != host) || (host0.empty() && host.empty());
562 stringstr_chain(
"Dependency cycle found: ");
565 if(
n!= cycle.begin()) {
568str_chain += proj_id.
Id();
572CCyclicDepends::TDependsChain::const_iterator
i= cycle.end();
582 "Removing LIB dependency: "<<
prev.Id() <<
" - "<<
last.Id());
587 PTB_INFO(
"No dependency cycles found.");
608 PTB_INFO(
"Cancelled by request.");
613 PTB_INFO(
"Cancelled by request.");
626 #if DO_PATCHTREEMAKEFILES 653 PTB_INFO(
"Cancelled by request.");
661 PTB_INFO(
"Checking project requirements...");
663 #ifdef COMBINED_EXCLUDE 669CCombine<PIsExcludedMakefileIn,
672logical_combine(p_make_in, p_project_makefile);
703 PTB_INFO(
"Checking project inter-dependencies...");
712 "More than one target with this name");
724 PTB_INFO(
"Creating projects...");
743 #if NCBI_COMPILER_MSVC 744 PTB_INFO(
"Generating MSBuild projects...");
747list<SConfigInfo> dll_configs;
748 constlist<SConfigInfo>* configurations = 0;
755configurations = &dll_configs;
757 _TRACE(
"Static build");
761 ITERATE(list<SConfigInfo>, p , *configurations) {
762str_config += p->GetConfigFullName() +
" ";
764 PTB_INFO(
"Building configurations: "<< str_config);
772CMsvcProjectGenerator prj_gen(*configurations);
773CMsvcProjectGenerator::GeneratePropertySheets();
775prj_gen.Generate(p->second);
782CMsvcMasterProjectGenerator master_prj_gen(projects_tree,
784utility_projects_dir);
786master_prj_gen.SaveProject();
797CMsvcConfigureProjectGenerator configure_generator(
801utility_projects_dir,
807configure_generator.SaveProject(
false, &prj_gen);
808configure_generator.SaveProject(
true, &prj_gen);
814 stringindex_prj_guid, index_prj_name;
817CreateUtilityProject(
" INDEX, see here: ", *configurations, &xmlprj);
819SaveIfNewer(index_prj_path, xmlprj);
825 stringutils[] = {
"_DATASPEC_ALL_",
"-DATASPEC-ALL-",
826 "_LIBS_ALL_",
"-LIBS-ALL-",
827 "_BUILD_ALL_",
"-BUILD-ALL-"};
828vector<string> utils_id;
829 int i= 0, num_util = 3;
831 for(
i= 0;
i< num_util; ++
i) {
832 stringprj_file(utils[
i*2]);
833 stringprj_name(utils[
i*2+1]);
839utils_id.push_back(prj_path);
842CreateUtilityProject(prj_name, *configurations, &xmlprj);
843SaveIfNewer(prj_path, xmlprj);
849prj_gen.Generate(prj_item);
850utils_id.push_back(prj_item.
m_GUID);
851utils_id.push_back(prj_item.
m_Name);
857 stringcomposite_name =
"_TAG_"+ composite->first;
858 stringcomposite_filter = composite->second;
863utils_id.push_back(prj_path);
866CreateUtilityProject(composite_name, *configurations, &xmlprj);
867SaveIfNewer(prj_path, xmlprj);
873prj_gen.Generate(prj_item);
874utils_id.push_back(prj_item.
m_GUID);
875utils_id.push_back(prj_item.
m_Name);
877utils_id.push_back(composite_filter);
883CMsvcSolutionGenerator sln_gen(*configurations);
885sln_gen.AddProject(p->second);
890sln_gen.AddUtilityProject( master_prj_gen.GetPath(),
891master_prj_gen.GetVisualStudioProject().GetAttlist().GetProjectGUID(),
892master_prj_gen.GetVisualStudioProject().GetAttlist().GetName());
894sln_gen.AddUtilityProject( index_prj_path, index_prj_guid, index_prj_name);
897 stringcfg_path, cfg_guid, cfg_name;
898configure_generator.GetVisualStudioProject(cfg_path, cfg_guid, cfg_name,
false);
899sln_gen.AddConfigureProject( cfg_path, cfg_guid, cfg_name);
901configure_generator.GetVisualStudioProject(cfg_path, cfg_guid, cfg_name,
true);
902sln_gen.AddConfigureProject( cfg_path, cfg_guid, cfg_name);
906 for(
i= 0;
i< num_util; ++
i) {
909sln_gen.AddAsnAllProject( utils_id[u], utils_id[u+1], utils_id[u+2]);
913sln_gen.AddLibsAllProject( utils_id[u], utils_id[u+1], utils_id[u+2]);
917sln_gen.AddBuildAllProject( utils_id[u], utils_id[u+1], utils_id[u+2]);
921sln_gen.AddTagProject( utils_id[u], utils_id[u+1], utils_id[u+2], utils_id[u+3]);
930list<string> enabled, disabled;
938 #if defined(NCBI_XCODE_BUILD) || defined(PSEUDO_XCODE) 939 PTB_INFO(
"Generating XCode projects...");
942list<SConfigInfo> dll_configs;
943 constlist<SConfigInfo>* configurations = 0;
950configurations = &dll_configs;
952 _TRACE(
"Static build");
956 ITERATE(list<SConfigInfo>, p , *configurations) {
957str_config += p->GetConfigFullName() +
" ";
959 PTB_INFO(
"Building configurations: "<< str_config);
967CMacProjectGenerator prj_gen(*configurations, projects_tree);
971list<string> enabled, disabled;
985dep.
insert(lib_dep_name);
988 if(visited.
find(lib_dep_name) != visited.
end() ||
989lib_dep_name == lib_name) {
992visited.
insert(lib_dep_name);
993 if(!lib_dep->second.m_DatatoolSources.empty() ||
994!lib_dep->second.m_ExportHeaders.empty() ||
995lib->second.m_UnconditionalDepends.find(lib_dep->first) !=
996lib->second.m_UnconditionalDepends.end()) {
997dep.
insert(lib_dep_name);
999 ITERATE(list<CProjKey>, p, lib_dep->second.m_Depends) {
1015 if(!ofs.is_open()) {
1020ofs <<
"# This file was generated by PROJECT_TREE_BUILDER v" 1026ofs <<
"# This is tricky part; it might work incorrectly on some platforms"<< endl;
1028ofs <<
"MARK=$(if $(MARK2),,$(eval MARK2=$(shell date +%Y%m%d%H%M%S)))$(MARK2)"<< endl;
1029ofs <<
"MARK:sh =date +%Y%m%d%H%M%S"<< endl;
1031ofs <<
"prefix=.ncbi.signal."<< endl;
1032ofs <<
"s=$(prefix)$(MARK)"<< endl;
1033ofs <<
"sign=rm -f $(prefix)*.$@; touch $(s).$@"<< endl;
1038ofs <<
"# Use empty MTARGET to build a project;"<< endl;
1039ofs <<
"# MTARGET=clean - to clean, or MTARGET=purge - to purge"<< endl;
1040ofs <<
"MTARGET ="<< endl << endl;
1043ofs <<
"top_srcdir="<<
m_Root<< endl;
1047ofs <<
"# Non-redundant flags (will be overridden for GNU Make to avoid"<< endl;
1048ofs <<
"# --jobserver-fds=* proliferation)"<< endl;
1049ofs <<
"MFLAGS_NR = $(MFLAGS)"<< endl;
1050ofs <<
"SKIP_PRELIMINARIES= sources= configurables=configurables.null"<< endl;
1053list<string> all_dirs;
1064ofs <<
"all_dirs =";
1065 ITERATE(list<string>, p, all_dirs) {
1066ofs <<
" \\"<<endl <<
" "<< *p;
1068ofs << endl << endl;
1070ofs <<
"include $(top_srcdir)/src/build-system/Makefile.is_gmake"<< endl;
1071ofs <<
"include $(top_srcdir)/src/build-system/Makefile.meta.$(is_gmake)"<< endl;
1074 stringdotreal(
".real");
1075 stringdotfiles(
".files");
1078ofs <<
"all_projects =";
1090ofs << endl << endl;
1092ofs <<
"ptb_all :"<< endl
1093<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) ptb_all"<< dotreal
1094<<
" MTARGET=$(MTARGET)";
1095ofs << endl << endl;
1096ofs <<
"ptb_all"<< dotreal <<
" :"<<
" $(all_projects:%=%"<< dotreal <<
")";
1097ofs << endl << endl;
1100ofs <<
"all_libraries =";
1111ofs << endl << endl;
1113ofs <<
"all_libs :"<< endl
1114<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) all_libs"<< dotreal
1115<<
" MTARGET=$(MTARGET)";
1116ofs << endl << endl;
1117ofs <<
"all_libs"<< dotreal <<
" :"<<
" $(all_libraries:%=%"<< dotreal <<
")";
1118ofs << endl << endl;
1121ofs <<
"all_dataspec =";
1130 if(p->second.m_DatatoolSources.empty()) {
1135ofs << endl << endl;
1137ofs <<
"all_files :"<< endl
1138<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) all_files"<< dotreal;
1139ofs << endl << endl;
1140ofs <<
"all_files"<< dotreal <<
" :"<<
" $(all_dataspec:%=%"<< dotreal <<
")";
1141ofs << endl << endl;
1144ofs <<
"all_apps =";
1154ofs << endl << endl;
1157ofs <<
"all_unix =";
1167ofs << endl << endl;
1170ofs <<
"all_excluded =";
1180ofs << endl << endl;
1184vector<string> existing_composite_names;
1191 stringcomposite_name =
"TAG_"+ composite->first;
1192 stringcomposite_filter = composite->second;
1193vector<string> matching;
1207 if(!matching.empty()) {
1208existing_composite_names.push_back(composite_name);
1209ofs << composite_name <<
"_projects =";
1210 ITERATE(vector<string>, c, matching) {
1211ofs <<
" \\"<<endl <<
" "<< *c;
1213ofs << endl << endl;
1215ofs << composite_name <<
" :"<< endl
1216<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) "<< composite_name << dotreal
1217<<
" MTARGET=$(MTARGET)";
1218ofs << endl << endl;
1219ofs << composite_name << dotreal <<
" :"<<
" $(" 1220<< composite_name <<
"_projects"<<
":%=%"<< dotreal <<
")";
1221ofs << endl << endl;
1230<< endl <<
"\t@echo Build all projects" 1231<< endl <<
"\t@echo \" make -f $(MINPUT) -j 12 ptb_all\"" 1232<< endl <<
"\t@echo Build a project, for example, xncbi.lib" 1233<< endl <<
"\t@echo \" make -f $(MINPUT) -j 12 xncbi.lib\"" 1234<< endl <<
"\t@echo Clean project intermediate files" 1235<< endl <<
"\t@echo \" make -f $(MINPUT) -j 12 xncbi.lib MTARGET=clean\"" 1236<< endl <<
"\t@echo Clean project intermediate and output files" 1237<< endl <<
"\t@echo \" make -f $(MINPUT) -j 12 xncbi.lib MTARGET=purge\"" 1238<< endl <<
"\t@echo Target lists: " 1239<< endl <<
"\t@echo \" list-all - list all targets\"" 1240<< endl <<
"\t@echo \" list-apps - list all applications\"" 1241<< endl <<
"\t@echo \" list-libs - list all libraries\"" 1242<< endl <<
"\t@echo \" list-unix - list all native Unix projects\"" 1243<< endl <<
"\t@echo \" list-excluded - list 'excluded' targets\"" 1244<< endl <<
"\t@echo \" list-tags - list composite targets\"" 1245<< endl <<
"\t@echo \" list-tag-TagName - list all targets in a composite target TagName\"";
1246ofs << endl << endl;
1249<< endl <<
"\t@echo" 1250<< endl <<
"\t@echo" 1251<< endl <<
"\t@echo --------------------------------------" 1252<< endl <<
"\t@echo APPLICATIONS" 1253<< endl <<
"\t@echo" 1254<< endl <<
"\t@for i in $(all_apps); do echo $$i; done" 1255<< endl <<
"\t@echo" 1256<< endl <<
"\t@echo" 1257<< endl <<
"\t@echo --------------------------------------" 1258<< endl <<
"\t@echo LIBRARIES" 1259<< endl <<
"\t@echo" 1260<< endl <<
"\t@for i in $(all_libraries); do echo $$i; done" 1261<< endl <<
"\t@echo" 1262<< endl <<
"\t@echo" 1263<< endl <<
"\t@echo --------------------------------------" 1264<< endl <<
"\t@echo UNIX PROJECTS" 1265<< endl <<
"\t@echo" 1266<< endl <<
"\t@for i in $(all_unix); do echo $$i; done";
1268 if(!existing_composite_names.empty()) {
1270<< endl <<
"\t@echo" 1271<< endl <<
"\t@echo" 1272<< endl <<
"\t@echo --------------------------------------" 1273<< endl <<
"\t@echo COMPOSITE TARGETS" 1274<< endl <<
"\t@echo";
1275 ITERATE(vector<string>, c, existing_composite_names) {
1276ofs << endl <<
"\t@echo "<< *c;
1280<< endl <<
"\t@echo" 1281<< endl <<
"\t@echo" 1282<< endl <<
"\t@echo --------------------------------------" 1283<< endl <<
"\t@echo DIRECTORIES" 1284<< endl <<
"\t@echo" 1285<< endl <<
"\t@for i in $(all_dirs); do echo $$i/; done";
1286ofs << endl << endl;
1287ofs <<
"list-apps :" 1288<< endl <<
"\t@for i in $(all_apps); do echo $$i; done";
1289ofs << endl << endl;
1290ofs <<
"list-libs :" 1291<< endl <<
"\t@for i in $(all_libraries); do echo $$i; done";
1292ofs << endl << endl;
1293ofs <<
"list-unix :" 1294<< endl <<
"\t@for i in $(all_unix); do echo $$i; done";
1295ofs << endl << endl;
1296ofs <<
"list-excluded :" 1297<< endl <<
"\t@for i in $(all_excluded); do echo $$i; done";
1298ofs << endl << endl;
1300ofs <<
"list-tags :";
1301 if(!existing_composite_names.empty()) {
1302 ITERATE(vector<string>, c, existing_composite_names) {
1303ofs << endl <<
"\t@echo "<< *c;
1306ofs << endl << endl;
1307 ITERATE(vector<string>, c, existing_composite_names) {
1308ofs <<
"list-tag-"<< *c <<
" :" 1309<< endl <<
"\t@for i in $("<< *c <<
"_projects); do echo $$i; done";
1310ofs << endl << endl;
1314 stringdatatool_key;
1317 if(!datatool.empty()) {
1331 boolhasDataspec = !p->second.m_DatatoolSources.empty();
1332 stringtarget, target_app, target_lib, target_user;
1333list<string> dependencies;
1337target_app = target_lib = target_user =
"\"\"";
1339target_app = p->second.m_Name;
1341target_user = p->second.m_Name;
1343target_lib = p->second.m_Name;
1345target_lib = p->second.m_Name;
1357 booldepfound =
false;
1358 stringdll(
GetDllHost(projects_tree, proj_key.
Id()));
1366 error=
"@echo ERROR: this project depends on missing "+
1375 ITERATE(list<CProjKey>,
i, p->second.m_Depends) {
1379 if(
GetSite().IsLibWithChoice(
id.Id()) ) {
1395 "Project "+ p->first.Id() +
" depends on missing project "+
id.Id());
1406 copy(lib_guid.
begin(), lib_guid.
end(), back_inserter(dependencies));
1407dependencies.sort();
1408dependencies.unique();
1412list<string> new_dependencies;
1414 ITERATE(list<string>, d, dependencies) {
1415 if(*d == datatool_key) {
1420!
n->second.m_DatatoolSources.empty()) {
1421new_dependencies.push_back(*d + dotfiles);
1424new_dependencies.push_back(*d);
1426dependencies = new_dependencies;
1432path_to_target[rel_path].push_back(target);
1436 stringparent_path, prev_parent(rel_path);
1441path_to_target[parent_path].push_back(prev_parent +
".real");
1443path_to_target[parent_path].push_back(prev_parent);
1445 if(parent_path == stop_path) {
1448prev_parent = parent_path;
1453 #if NCBI_COMPILER_MSVC 1459ofs << target <<
" : "<< rel_path <<
"$(s)."<< target <<
".real";
1460ofs << endl << endl;
1461ofs << rel_path <<
"$(s)."<< target <<
".real"<<
" :"<< endl
1462<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) "<< target <<
".real" 1463<<
" MTARGET=$(MTARGET) MARK=$(MARK)";
1464ofs << endl << endl;
1465ofs << target <<
".real"<<
" :";
1466 ITERATE(list<string>, d, dependencies) {
1469ofs << endl <<
"\t";
1470 if(!
error.empty()) {
1471ofs <<
error<< endl <<
"\t@exit 1"<< endl <<
"\t";
1477ofs <<
"cd "<< rel_path <<
"; $(MAKE) $(MFLAGS_NR)" 1478<<
" APP_PROJ="<< target_app
1479<<
" LIB_PROJ="<< target_lib
1480<<
" $(MTARGET)"<< endl
1481<<
"\t@"<<
"cd "<< rel_path <<
"; $(sign)";
1482ofs << endl << endl;
1484ofs << target <<
" :"<< endl
1485<<
"\t$(MAKE) $(MFLAGS) -f $(MINPUT) "<< target << dotreal
1486<<
" MTARGET=$(MTARGET)";
1487ofs << endl << endl;
1488ofs << target << dotreal <<
" :";
1491dataspec_dirs.
insert(rel_path);
1493 ITERATE(list<string>, d, dependencies) {
1494 if(*d == datatool_key) {
1495dataspec_dirs.
insert(rel_path);
1497ofs <<
" "<< *d << dotreal;
1500ofs <<
" "<< rel_path << dotfiles << dotreal;
1503ofs << endl <<
"\t";
1504 if(!
error.empty()) {
1505ofs <<
error<< endl <<
"\t@exit 1"<< endl <<
"\t";
1511ofs <<
"cd "<< rel_path <<
" && ";
1513ofs <<
" NCBI_BUT_EXPENDABLE=' (but expendable)'";
1515ofs <<
" $(MAKE) $(MFLAGS)" 1516<<
" APP_PROJ="<< target_app
1517<< (p->second.m_IsMetallib ?
" LIB_PROJ=\"\" METAL_PROJ=":
" LIB_PROJ=") << target_lib
1518<<
" UNIX_PROJ="<< target_user
1521ofs <<
" $(SKIP_PRELIMINARIES)";
1523ofs << endl << endl;
1526ofs << target << dotfiles <<
" :"<< endl
1527<<
"\t$(MAKE) $(MFLAGS) -f $(MINPUT) $(SKIP_PRELIMINARIES) " 1528<< target << dotfiles << dotreal;
1529ofs << endl << endl;
1530ofs << target << dotfiles << dotreal <<
" :";
1531ofs <<
" "<< rel_path << dotfiles << dotreal;
1532ofs << endl << endl;
1537 constlist<string>& liborder =
m_LibraryOrder[ p->second.m_MkName];
1542 if(
m_LibDep&& (!liborder.empty() || !lib3order.empty())) {
1544 if(ofs.is_open()) {
1545 if(!liborder.empty()) {
1546ofs <<
"GENERATED_LIB_ORDER = -l"<<
NStr::Join(liborder,
" -l") << endl;
1548 if(!lib3order.empty()) {
1549ofs <<
"GENERATED_LIB3PARTY_ORDER =";
1550 ITERATE( list<string>, l3, lib3order) {
1556ofs <<
"-framework ";
1559}
else if(l3->at(0) !=
'-'&&
1560l3->find_first_of(
"$/.") == string::npos) {
1577 for( pt = path_to_target.
begin(); pt != path_to_target.
end(); ++pt) {
1578 stringtarget(pt->first);
1579ofs <<
".PHONY : "<< target << endl << endl;
1580ofs << target <<
" :"<< endl
1581<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) "<< target << dotreal
1582<<
" MTARGET=$(MTARGET)";
1583ofs << endl << endl;
1584ofs << target << dotreal <<
" :";
1585 if(!pt->second.
empty()) {
1586list< string > tt(pt->second);
1593ofs <<
" "<<
NStr::Join( tt, dotreal +
" ") << dotreal;
1595ofs << endl << endl;
1598ofs << target << dotfiles <<
" :"<< endl
1599<<
"\t$(MAKE) $(MFLAGS_NR) -f $(MINPUT) "<< target << dotfiles << dotreal
1600<<
" MTARGET=$(MTARGET)";
1601ofs << endl << endl;
1602ofs << target << dotfiles << dotreal <<
" :";
1603 if(
m_Dtdep&& !datatool_key.empty() &&
1604dataspec_dirs.
find(target) != dataspec_dirs.
end()) {
1605ofs <<
" "<< datatool_key << dotreal;
1607ofs << endl <<
"\t";
1609ofs <<
"cd "<< target <<
" && $(MAKE) $(MFLAGS) sources";
1610ofs << endl << endl;
1616 constlist<SConfigInfo>* configs,
1617list<string>& list_enabled, list<string>& list_disabled)
1619 PTB_INFO(
"Generating Features_And_Packages files...");
1626 ITERATE(list<SConfigInfo>, c , *configs) {
1630 "features_and_packages.txt");
1632 "features_and_packages_disabled.txt");
1634list<string> cfg_enabled, cfg_disabled;
1636cfg_enabled.push_back(
"MT");
1638cfg_enabled.push_back(
"MT");
1639cfg_enabled.push_back(
"Debug");
1641cfg_enabled.push_back(
"MT");
1643cfg_enabled.push_back(
"MT");
1644cfg_enabled.push_back(
"Debug");
1647cfg_enabled.push_back(
"Debug");
1650cfg_enabled.push_back(
"DLL");
1654cfg_enabled.insert(cfg_enabled.end(), epackages.
begin(), epackages.
end());
1656list<string> std_features;
1658cfg_enabled.insert(cfg_enabled.end(), std_features.begin(), std_features.end());
1660list<string> features;
1662 ITERATE(list<string>, s, features) {
1663 if(
GetSite().IsProvided(*s)) {
1664cfg_enabled.push_back(*s);
1666cfg_disabled.push_back(*s);
1672cfg_disabled.insert(cfg_disabled.end(), dpackages.
begin(), dpackages.
end());
1676list<string>::iterator
i;
1677 for(
i=cfg_enabled.begin();
i!= cfg_enabled.end();) {
1678 if(
i->at(0) ==
'-') {
1679cfg_disabled.push_back(
i->substr(1));
1680list<string>::iterator j =
i++;
1681cfg_enabled.erase(j);
1686 for(
i=cfg_disabled.begin();
i!= cfg_disabled.end();) {
1687 if(
i->at(0) ==
'-') {
1688cfg_enabled.push_back(
i->substr(1));
1689list<string>::iterator j =
i++;
1690cfg_disabled.erase(j);
1696cfg_enabled.unique();
1697cfg_disabled.sort();
1698cfg_disabled.unique();
1704 for(
const string& e : cfg_enabled) {
1712 for(
const string& e : cfg_disabled) {
1716list_enabled.insert(list_enabled.end(), cfg_enabled.begin(), cfg_enabled.end());
1717list_disabled.insert(list_disabled.end(), cfg_disabled.begin(), cfg_disabled.end());
1719list_enabled.sort();
1720list_enabled.unique();
1721list_disabled.sort();
1722list_disabled.unique();
1726 constlist<string>& enabled,
constlist<string>& disabled)
1730 ITERATE(list<SConfigInfo>, p , configs) {
1732 stringfile_dst_path;
1743 PTB_INFO(
"===========================================================");
1747 for(
const auto& cfg : configs) {
1748str_config +=
" "+ cfg.GetConfigFullName();
1750 PTB_INFO(
"CONFIGURATIONS: "<< str_config);
1751 PTB_INFO(
"FEATURES AND PACKAGES: ");
1752 stringstr_pkg =
" enabled: ";
1753 ITERATE( list<string>, p, enabled) {
1754 if(str_pkg.length() > 70) {
1761 if(!str_pkg.empty()) {
1764str_pkg =
" disabled: ";
1765 ITERATE( list<string>, p, disabled) {
1766 if(str_pkg.length() > 70) {
1773 if(!str_pkg.empty()) {
1782 PTB_INFO(
" If a package is present in both lists,");
1783 PTB_INFO(
" it is disabled in SOME configurations only");
1784 PTB_INFO(
" For details see 'features_and_packages' files in");
1785 PTB_INFO(
" "<< str_path <<
"/%ConfigurationName%");
1786 PTB_INFO(
"===========================================================");
1792 PTB_INFO(
"Generating check.sh.list files...");
1795string::size_type
n= output_dir.find_last_of(
'.');
1796 if(
n!= string::npos) {
1797output_dir = output_dir.substr(0,
n);
1800output_dir +=
".check";
1801 ITERATE(list<SConfigInfo>, c , *configs) {
1802 stringcfg(c->GetConfigFullName());
1804 CDirdir(file_path);
1813list<string> all_cmd;
1822all_cmd.push_back(*
cmd);
1825 PTB_INFO(
"Project: "<< p->first.Id() <<
": CHECK_CMD disabled in "<< cfg);
1831ofs << *
cmd<< endl;
1839 stringfile_path(
m_Solution+
"_generated_files.txt");
1847 if(ofs.is_open()) {
1862 stringfile_path(
m_Solution+
"_watchers.txt");
1864 if(ofs.is_open()) {
1880 boolextroot =
false;
1881 boolargfile =
false;
1884 if( args[
"args"] ) {
1885argsfile = args[
"args"].AsString();
1891argsfile +
" not found");
1895root = args[
"root"].AsString();
1896 if(root ==
"\"\"") {
1899 if(argfile && root.empty()) {
1908 m_Subtree= args[
"subtree"].AsString();
1963 #if defined(NCBI_COMPILER_MSVC) || defined(NCBI_XCODE_BUILD) || defined(PSEUDO_XCODE) 1984extroot = (
bool)args[
"extroot"];
1988 if(
const CArgValue&
t= args[
"projtag"] ) {
1996 #if defined(NCBI_COMPILER_MSVC) || defined(NCBI_XCODE_BUILD) || defined(PSEUDO_XCODE) 2001 const CArgValue& arch = args[
"arch"];
2010 stringentry[] = {
"",
"",
""};
2012entry[0] =
"ThirdPartyBasePath";
2013entry[1] =
"ThirdParty_C_ncbi";
2016entry[0] =
"XCode_ThirdPartyBasePath";
2017entry[1] =
"XCode_ThirdParty_C_ncbi";
2022 for(
intj=0; !entry[j].empty(); ++j) {
2030 #if defined(NCBI_COMPILER_MSVC) 2036 m_LibDep= args[
"libdep"].AsBoolean();
2056 stringsrc =
GetConfig().
Get(
"ProjectTree",
"src");
2064 if(
t== try_dir) {
2074 string tmp(
GetConfig().
Get(
"ProjectTree",
"CustomConfiguration"));
2075 if(!
tmp.empty()) {
2079 if( !sln_dir.
Exists() ) {
2095 for(
intj=0; !entry[j].empty(); ++j) {
2134 #if defined(NCBI_COMPILER_MSVC) || defined(NCBI_XCODE_BUILD) || defined(PSEUDO_XCODE) 2144 for(
intj=0; !entry[j].empty(); ++j) {
2161 GetSite().IsProvided(
"Ncbi_Unicode",
false) &&
2162 GetSite().IsProvided(
"Ncbi-Unicode",
false))) {
2165 if(
GetSite().IsProvided(
"Ncbi_Unicode",
false)) {
2166add =
"Ncbi-Unicode";
2168add =
"Ncbi_Unicode";
2170 stringsection(
"__EnabledUserRequests");
2173 if(!
value.empty()) {
2181 if(!
tmp.empty()) {
2190 for(
intj=0; !entry[j].empty(); ++j) {
2219 const string& enum_val)
const 2224enum_name +
"::"+ enum_val);
2231 const string& filename)
const 2239ofs <<
"+++++++++++++++++++++++++\n";
2240ofs << p->first << endl;
2241p->second.Dump(ofs);
2242ofs <<
"-------------------------\n";
2272 stringname(
GetApp().
GetSite().GetConfigureEntry(
"MetaData"));
2273 if(!name.empty()) {
2274files->push_back( name);
2293 stringname =
m_Dll?
"DllConfigurations":
"Configurations";
2294 const string& config_str
2296list<string> configs_list;
2376 if(!tagsfile.empty()) {
2385list<string> depsfile;
2389 if(!depsfile.empty()) {
2390 ITERATE(list<string>, d, depsfile) {
2391 PTB_INFO(
"Library dependencies graph: "<< *d);
2397 stringinclude =
GetConfig().
Get(
"ProjectTree",
"include");
2406 stringsrc =
GetConfig().
Get(
"ProjectTree",
"src");
2415 PTB_INFO(
"Project list or subtree: "<< subtree);
2423 stringcompilers =
GetConfig().
Get(
"ProjectTree",
"compilers");
2432 stringimplicit_exclude_str
2433=
GetConfig().
Get(
"ProjectTree",
"ImplicitExclude");
2434list<string> implicit_exclude_list;
2438 ITERATE(list<string>, p, implicit_exclude_list) {
2439 const string& subdir = *p;
2465 GetConfig().
Get(
"ProjectTree",
"CustomMetaData");
2510 return "_generate_all_objects";
2543 return GetConfig().
Get(
"Datatool",
"CommandLine");
2555 const CProjItem& project,
const string* filter
)
const 2558list<string>::const_iterator
i;
2562project.
GetPath() +
": Unregistered project tag: "+ *
i);
2567 if(filter ==
NULL) {
2571 if(filter->empty() || *filter ==
"*") {
2580parser.
Parse(filter->c_str());
2587 if( ifs.is_open() ) {
2590 if(line.empty() || line[0] ==
'#') {
2593list<string> values;
2594 if(line.find(
'=') != string::npos) {
2596 if(values.size() > 1) {
2605 ITERATE(list<string>,v,values) {
2620list<string> locations;
2621 stringlocstr(
GetConfig().
Get(
"ProjectTree",
"DepGraph"));
2623 for(list<string>::const_iterator
l= locations.begin();
l!= locations.end(); ++
l) {
2626found.push_back(fileloc.
GetPath());
2629 return!found.empty();
2636 if( ifs.is_open() ) {
2639 if(line.empty() || line[0] ==
'#') {
2642list<string> values;
2644 if(values.size() < 2) {
2647list<string>::const_iterator
l= values.begin();
2649 stringsecond = *
l++;
2650 stringthird = values.size() > 2 ? (*
l++) :
string();
2652list<string> first_list;
2660list<string> third_list;
2661 #if DO_PATCHTREEMAKEFILES 2662 if(!third.empty()) {
2663third_list.push_back(third);
2670 if(stripped !=
"NCBI_C_ncbi") {
2671 site.ResolveDefine(stripped, resolved);
2673 if(resolved.empty()) {
2674resolved =
"@"+ stripped +
"@";
2683 ITERATE(list<string>,
f, first_list) {
2684 stringf_name(*
f);
2686f_name =
f->substr(2);
2688list<string> f_list;
2690f_name = f_list.back();
2691}
else if(
f->at(0) ==
'-') {
2699 ITERATE(list<string>,
t, third_list) {
2700 stringt_name(*
t);
2702 boolis_lib =
false;
2703 boolis_framework =
false;
2706t_name = t_name.substr(2);
2708 if(
t!= third_list.end()) {
2709is_framework =
true;
2715is_lib =
t->at(0) !=
'-';
2717 if(*
f== t_name) {
2720 if(!is_lib && !is_framework) {
2721 if(second ==
"needs3party") {
2726 if(second ==
"includes") {
2728}
else if(second ==
"includes3party") {
2734}
else if(second ==
"needs") {
2736}
else if(second ==
"needs3party") {
2759 if(incname[0] ==
'@') {
2782 #if DO_PATCHTREEMAKEFILES 2793list<string> libdep;
2794fc.
GetValue(
"USES_LIBRARIES", libdep);
2795 if(!libdep.empty()) {
2800 ITERATE(list<string>,
l, libdep) {
2801list<string> dep_list;
2803 if(dep.at(0) ==
'#') {
2810 if(stripped !=
"NCBI_C_ncbi") {
2811 site.ResolveDefine(stripped, resolved);
2813 if(resolved.empty()) {
2814resolved =
"@"+ stripped +
"@";
2822 ITERATE(list<string>, d, dep_list) {
2825 if(dep_name.at(0) ==
'-'|| libname == dep_name) {
2838 #if DO_PATCHTREEMAKEFILES 2844vector< set<string> > graph;
2848 done.push_back(d->first);
2851 for(
size_ts= 0; s<graph.size(); ++s) {
2866 if(find(
done.begin(),
done.end(), *d) !=
done.end()) {
2867 done.push_back(*d);
2869 "Library dependency cycle found: "<<
NStr::Join(
done,
" - "));
2874 done.push_back(*d);
2875 for(
boolfound=
false; !found; ) {
2876 for(
size_ts= 0; !found && s<graph.size(); ++s) {
2877 if(graph[s].find(*d) != graph[s].end()) {
2878graphset =
max(graphset,s);
2888 if(!dependents.
empty()) {
2891 if(graphset < graph.size()) {
2892graph[graphset].insert(dep);
2896graph.push_back(
t);
2903 string data(raw_data), raw_macro, macro, definition;
2904string::size_type start, end,
done= 0;
2905 while((start =
data.find(
"$(",
done)) != string::npos) {
2906end =
data.find(
")", start);
2907 if(end == string::npos) {
2911raw_macro =
data.substr(start,end-start+1);
2916 if(!definition.empty()) {
2931 if(!definition.empty()) {
2948 const string& project,
const string& dir,
const string& watcher)
2950 if(watcher.empty()) {
2966 m_ProjWatchers.push_back( project +
", "+ path +
", "+ watcher );
2975p->second.m_External =
false;
2989utility_projects_dir =
2991utility_projects_dir =
2993 returnutility_projects_dir;
Utility class for distinguish between static and dll builds.
EBuildType GetType(void) const
static void FindCyclesNew(const TProjects &tree, TDependsCycles *cycles)
list< CProjKey > TDependsChain
Distribution if source files by lib projects Uses in dll project to separate source files to groups b...
void Parse(const char *str)
CExprSymbol * AddSymbol(const char *name, VT value)
const CExprValue & GetResult(void) const
static void PatchTreeMakefiles(const CProjectItemsTree &prj_tree)
static string GetVcprojExt(void)
static EMsvcPlatform GetMsvcPlatform(void)
list< SConfigInfo > m_ConfigInfo
static string GetMsvcSection(void)
static const string & GetMsvcPlatformName(void)
static void IdentifyPlatform(void)
static string GetConfigNameKeyword(void)
static EMsvcVersion GetMsvcVersion(void)
static string GetMsvcRegSection(void)
virtual bool IsExcludeProject(bool default_val) const
Configurator for msvc projects:
void Configure(CMsvcSite &site, const list< SConfigInfo > &configs, const string &root_dir)
void CreateConfH(CMsvcSite &site, const list< SConfigInfo > &configs, const string &root_dir)
CMsvcPrjProjectContext â.
static const set< string > & GetEnabledPackages(const string &config_name)
static bool IsRequiresOk(const CProjItem &prj, string *unmet)
static const set< string > & GetDisabledPackages(const string &config_name)
const CMsvcCombinedProjectMakefile & GetMsvcProjectMakefile(void) const
void GetStandardFeatures(list< string > &features) const
void GetRequiresInfo(const SConfigInfo &config, list< string > &list_enabled, list< string > &list_disabled) const
bool IsProvided(const string &thing, bool deep=true, const SConfigInfo *cfg=nullptr) const
void GetConfigurableRequests(list< string > &features) const
static CNcbiApplication * Instance(void)
Singleton method.
CProjBulderAppException â.
string GetDatatoolId(void) const
unique_ptr< CMsvcSite > m_MsvcSite
set< string > m_Frameworks
unique_ptr< CDllSrcFilesDistr > m_DllSrcFilesDistr
void CreateFeaturesAndPackagesFiles(const list< SConfigInfo > *configs, list< string > &enabled, list< string > &disabled)
virtual void Init(void)
Initialize the application.
void ReportProjectWatchers(void)
void UpdateDepGraph(CProjectTreeBuilder::TFiles &files)
void GetBuildConfigs(list< SConfigInfo > *configs)
bool IsAllowedProjectTag(const CProjItem &project, const string *filter=NULL) const
void ParseArguments(void)
Parse program arguments.
void AddCustomMetaData(const string &file)
const CBuildType & GetBuildType(void)
bool InsertDep(vector< set< string > > &graph, const string &dep, list< string > &done)
CSimpleMakeFileContents m_CustomConfiguration
bool FindDepGraph(const string &root, list< string > &found) const
friend CProjBulderApp & GetApp(void)
Singleton.
unique_ptr< CProjectItemsTree > m_WholeTree
map< string, string > m_CompositeProjectTags
void GenerateUnixProjects(CProjectItemsTree &projects_tree)
string GetDatatoolPathForLib(void) const
virtual void Exit(void)
Cleanup on application exit.
void GetCustomConfH(list< string > *files) const
int EnumOpt(const string &enum_name, const string &enum_val) const
ShortCut for enums.
map< string, list< string > > m_3PartyLibraryOrder
void ReportGeneratedFiles(void)
void GenerateMsvcProjects(CProjectItemsTree &projects_tree)
unique_ptr< SProjectTreeInfo > m_ProjectTreeInfo
string GetDataspecProjId(void) const
map< string, set< string > > m_GraphDepIncludes
void GenerateMacProjects(CProjectItemsTree &projects_tree)
CDllSrcFilesDistr & GetDllFilesDistr(void)
virtual int Run(void)
Run the application.
unique_ptr< CMsvcMetaMakefile > m_MsvcMetaMakefile
void CollectDep(const string &libname, const string &depname)
set< string > m_RegisteredProjectTags
const CMsvcMetaMakefile & GetMetaMakefile(void)
string GetUtilityProjectsDir(void) const
map< string, size_t > m_GraphDepRank
list< string > m_CustomConfH
set< string > m_3PartyLibs
string GetDatatoolPathForApp(void) const
void RegisterGeneratedFile(const string &file)
bool ConfirmConfiguration(void)
map< string, list< string > > m_LibraryOrder
void GenerateSummary(const list< SConfigInfo > configs, const list< string > &enabled, const list< string > &disabled)
void VerifyArguments(void)
string GetUtilityProjectsSrcDir(void)
void RegisterSuspiciousProject(const CProjKey &proj)
list< string > m_ProjWatchers
void SetConfFileData(const string &src, const string &dest)
void RegisterProjectWatcher(const string &project, const string &dir, const string &watcher)
void ExcludeUnrequestedProjects(CProjectItemsTree &tree) const
void AddCustomConfH(const string &file)
const SProjectTreeInfo & GetProjectTreeInfo(void)
void GetMetaDataFiles(list< string > *files) const
string GetConfigureMacro(string data)
bool UseAbsolutePath(const string &path) const
string ProcessLocationMacros(string data)
const CProjectItemsTree & GetWholeTree(void)
void DumpFiles(const TFiles &files, const string &filename) const
string GetDatatoolCommandLine(void) const
const CMsvc7RegSettings & GetRegSettings(void)
const CProjectItemsTree * m_IncompleteBuildTree
list< string > m_GeneratedFiles
void ExcludeProjectsByTag(CProjectItemsTree &tree) const
unique_ptr< CBuildType > m_BuildType
map< string, set< string > > m_GraphDepFlags
list< string > m_CustomMetaData
void LoadDepGraph(const string &filename)
bool IsScanningWholeTree(void) const
set< CProjKey > m_SuspiciousProj
void LoadProjectTags(const string &filename)
unique_ptr< CMsvc7RegSettings > m_MsvcRegSettings
void CreateCheckList(const list< SConfigInfo > *configs, CProjectItemsTree &projects_tree)
map< string, set< string > > m_GraphDepPrecedes
bool Gui_ConfirmConfiguration(void)
void CollectLibToLibDependencies(CProjectItemsTree &projects_tree, set< string > &dep, set< string > &visited, CProjectItemsTree::TProjects::const_iterator &lib, CProjectItemsTree::TProjects::const_iterator &lib_dep)
const CMsvcSite & GetSite(void)
const CProjectItemsTree * m_CurrentBuildTree
string GetProjectTreeRoot(void) const
list< CProjKey > m_Depends
What projects this project is depend upon (IDs).
TProjType m_ProjType
Type of the project.
EMakeFileType m_MakeType
Type of the project.
string m_ID
ID of atomic project.
string GetPath(void) const
string m_GUID
project GUID
set< string > m_CheckConfigs
list< string > m_ProjTags
string m_Name
Name of atomic project.
string m_SourcesBaseDir
Base directory of source files (....c++/src/a/ )
list< string > m_CheckInfo
const string & Id(void) const
void VerifyDataspecProj(void)
void VerifyExternalDepends(void)
static bool VerifyBuildOrder(const CProjItem &item, list< string > dependencies, const CProjectItemsTree &tree)
static void BuildProjectTree(const IProjectFilter *filter, const string &root_src_path, CProjectItemsTree *tree)
Build project tree and include all projects this tree depends upon.
static string GetAllowedTagsInfo(const string &file_full_path)
CSimpleMakeFileContents â.
static void LoadFrom(const string &file_path, CSimpleMakeFileContents *fc)
void RemoveDefinition(const string &key)
bool GetPathValue(const string &key, string &value) const
void AddDefinition(const string &key, const string &value)
bool GetValue(const string &key, string &value) const
void Save(const string &filename) const
static string StripDefine(const string &define)
static bool StripSuffix(string &libname, string *suffix=nullptr)
static bool IsDefine(const string ¶m)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
CVisualStudioProject â.
Windows-specific command-line logger This is used to format error output in such a way that the Windo...
unique_ptr< CDiagHandler > m_OrigHandler
CWindowsCmdErrorHandler()
~CWindowsCmdErrorHandler()
string m_AppName
the original diagnostics handler
void Post(const SDiagMessage &msg)
post a message
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
pre_order_iterator end() const
void Print(const CCompactSAMApplication::AlignInfo &ai)
bool CreateConfigurableFile(const string &src_path, const string &dst_path, const string &config_name)
string ConfigurableFileSuffix(const string &config_name)
std::ofstream out("events_result.xml")
main entry point for tests
@ eMakeType_ExcludedByReq
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
const CNcbiEnvironment & GetEnvironment(void) const
Get the application's cached environment.
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
CVersionInfo GetVersion(void) const
Get the program version information.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
virtual bool LoadConfig(CNcbiRegistry ®, const string *conf, CNcbiRegistry::TFlags reg_flags)
Load settings from the configuration file to the registry.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const string & GetConfigPath(void) const
Get the full path to the configuration file (if any) we ended up using.
const string & GetProgramDisplayName(void) const
Get the application's "display" name.
CNcbiRegistry & GetRWConfig(void)
Get the application's cached configuration parameters, accessible for read-write for an application's...
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
void SetVersion(const CVersionInfo &version)
Set the version number for the program.
virtual const string & AsString(void) const =0
Get the argument's string value.
virtual int AsInteger(void) const =0
Get the argument's integer value.
@ eBoolean
{'true', 't', 'false', 'f'}, case-insensitive
@ eString
An arbitrary string.
@ eInteger
Convertible into an integer number (int or Int8)
CDiagContext & GetDiagContext(void)
Get diag context instance.
void SetLogRate_Limit(ELogRate_Type type, unsigned int limit)
CDiagHandler * GetDiagHandler(bool take_ownership=false, bool *current_ownership=0)
Get the currently set diagnostic handler class.
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
void SetDiagHandler(CDiagHandler *handler, bool can_delete=true)
Set the diagnostic handler using the specified diagnostic handler class.
TDiagPostFlags SetDiagPostAllFlags(TDiagPostFlags flags)
Set global post flags to "flags".
static void SetLogTruncate(bool value)
Set log file truncation flag.
string GetLogFile(EDiagFileType file_type)
Get log file name for the given log type.
@ eDPF_DateTime
Include date and time.
@ eDPF_Log
Print the posted message only; without severity, location, prefix, etc.
@ eDPF_All
All flags (except for the "unusual" ones!)
@ eLogRate_Err
Error log.
@ eDiag_Trace
Trace message.
@ eDiag_Info
Informational message.
@ eDiag_Error
Error message.
@ eDiag_Warning
Warning message.
@ eDiag_Fatal
Fatal error â guarantees exit(or abort)
@ eDiag_Critical
Critical error message.
const string & Get(const string &name, bool *found=NULL) const
Get environment value by name.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)
Normalize a path.
string GetDir(EIfEmptyPath mode=eIfEmptyPath_Current) const
Get the directory component for this directory entry.
static bool IsAbsolutePath(const string &path)
Check if a "path" is absolute for the current OS.
virtual bool Exists(void) const
Check the entry existence.
static string DeleteTrailingPathSeparator(const string &path)
Delete trailing path separator, if any.
bool CreatePath(TCreateFlags flags=fCreate_Default) const
Create the directory path recursively possibly more than one at a time.
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
static string AddTrailingPathSeparator(const string &path)
Add trailing path separator, if needed.
virtual bool Exists(void) const
Check if directory "dirname" exists.
static string CreateRelativePath(const string &path_from, const string &path_to)
Create a relative path between two points in the file system specified by their absolute paths.
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
static string ConvertToOSPath(const string &path)
Convert "path" on any OS to the current OS-dependent path.
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
static string GetCwd(void)
Get the current working directory.
string GetName(void) const
Get the base entry name with extension (if any).
const string & GetPath(void) const
Get entry path.
string GetExt(void) const
Get extension name.
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
virtual int GetInt(const string §ion, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get integer value of specified parameter name.
virtual string GetString(const string §ion, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static bool StringToBool(const CTempString str)
Convert string to bool.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static int strncasecmp(const char *s1, const char *s2, size_t n)
Case-insensitive comparison of two zero-terminated strings, narrowed to the specified number of chara...
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static SIZE_TYPE FindCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case sensitive search.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
void Start(void)
Start the timer.
@ eCurrent
Use current time. See also CCurrentTime.
virtual string Print(void) const
Print version information.
const TProjectGUID & GetProjectGUID(void) const
Get the ProjectGUID member data.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
const TName & GetName(void) const
Get the Name member data.
CBioseq_Base_Info & GetBase(CTSE_Info &tse, const CBioObjectId &id)
void CreateDllBuildTree(const CProjectItemsTree &tree_src, CProjectItemsTree *tree_dst)
string GetDllHost(const CProjectItemsTree &tree, const string &lib)
#define LIST_SEPARATOR_LIBS
#define LIST_SEPARATOR
Separator for list values in registry.
void LoadConfigInfoByNames(const CNcbiRegistry ®istry, const list< string > &config_names, list< SConfigInfo > *configs)
CProjKey CreateProjKey(const string &project_name)
string CreateProjectName(const CProjKey &project_id)
Project naming schema.
bool IsSubdir(const string &abs_parent_dir, const string &abs_dir)
Is abs_dir a parent of abs_parent_dir.
void EraseIf(C &cont, const P &pred)
Erase if predicate is true.
const TYPE & Get(const CNamedParameterList *param)
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Defines: CTimeFormat - storage class for time format.
std::istream & in(std::istream &in_, double &x_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
CProjBulderApp & GetApp(void)
access to App singleton
int NcbiSys_main(int argc, TXChar *argv[])
const char * s_ptb_skipconfig
static void s_ReportDependenciesStatus(const CCyclicDepends::TDependsCycles &cycles, CProjectItemsTree::TProjects &tree)
CProjItem CreateUtilityProjectItem(const string &prj_dir, const string &name)
string ParentDir(const string &dir_abs)
#define PTB_ERROR_EX(file, err_code, msg)
@ ePTB_ConfigurationError
#define PTB_WARNING_EX(file, err_code, msg)
#define PTB_ERROR(file, msg)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
CProjectItemsTree::TProjects::value_type TValueType
bool operator()(const TValueType &item) const
CProjectItemsTree::TProjects::value_type TValueType
bool operator()(const TValueType &item) const
bool operator()(const TValueType &item) const
CProjectItemsTree::TProjects::value_type TValueType
bool operator()(const TValueType &item) const
CProjectItemsTree::TProjects::value_type TValueType
bool operator()(const TValueType &item) const
CProjectItemsTree::TProjects::value_type TValueType
@ rtMultiThreadedDebugDLL
string GetConfigFullName(void) const
static bool IsConfigurableDefine(const string &define)
Abstraction of project tree general information.
string m_Compilers
<compilers> branch of tree
list< string > m_ImplicitExcludedAbsDirs
Branch of tree to be implicit exclude from build.
static CS_CONTEXT * context
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4