Changeset 521 for CMT


Ignore:
Timestamp:
Sep 17, 2009, 5:31:10 PM (15 years ago)
Author:
rybkin
Message:

See C.L. 408

Location:
CMT/HEAD
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r520 r521  
     12009-09-17    <rybkin@lal.in2p3.fr> 408
     2
     3        * source/cmt.h: Declare function Cmt::configure_devenv_tag
     4        * source/cmt_parser.cxx: Implement Cmt::configure_devenv_tag making
     5        use of command specified by macro "devenv_command" to retrieve version
     6        of Microsoft (R) Visual Studio and define a corresponding tag
     7        * mgr/requirements: For Windows, set macro devenv_command to "devenv /?"
     8        (can be overridden via CMTHOME requirements file)
     9        * mgr/VisualC.nmake: Update
     10       
    1112009-09-10    <rybkin@lal.in2p3.fr> 407
    212
  • CMT/HEAD/mgr/VisualC.nmake

    r497 r521  
    1414msdevdll=/dll
    1515msdevdllflags=/MT /D "_USRDLL" /D "WDLL_EXPORTS"
    16 ppcmd=/I
     16devenv_command=devenv /?
    1717preproc=cl.exe
    1818cpp=cl.exe
  • CMT/HEAD/mgr/requirements

    r520 r521  
    207207      VC7debug        "0"
    208208
     209macro devenv_command      "" \
     210      WIN32               "devenv /?" \
    209211
    210212#
  • CMT/HEAD/source/cmt.h

    r459 r521  
    9999  static void configure_tags (Use* use);
    100100  static void configure_uname_tag ();
     101  static void configure_devenv_tag ();
    101102  static void configure_version_tag ();
    102103  //  static void configure_cmt_message ();
  • CMT/HEAD/source/cmt_parser.cxx

    r516 r521  
    13141314
    13151315      tag = Tag::add (uname, PriorityUname, "uname", 0);
     1316      tag->mark ();
     1317    }
     1318}
     1319
     1320//----------------------------------------------------------
     1321void Cmt::configure_devenv_tag ()
     1322{
     1323  cmt_string devenv_command;
     1324  Symbol* devenv_command_macro = Symbol::find ("devenv_command");
     1325  if (0 == devenv_command_macro) return;
     1326
     1327  devenv_command = devenv_command_macro->resolve_macro_value ();
     1328  if (devenv_command == "") return;
     1329  devenv_command += " 2>&1";
     1330
     1331  cmt_string output;
     1332  if (0 != CmtSystem::execute (devenv_command, output)) return;
     1333  cmt_string devenv;
     1334  int pos;
     1335  pos = output.find ("Microsoft");
     1336  if (pos != cmt_string::npos) devenv = "vs";
     1337  else return;
     1338
     1339  //
     1340  // Make the output as one single big line.
     1341  //
     1342
     1343  output.replace_all ("\n", " ");
     1344  output.replace_all ("\r", " ");
     1345
     1346  CmtSystem::cmt_string_vector words;
     1347  CmtSystem::split (output, " \t", words);
     1348
     1349  cmt_string version;
     1350  bool need_version (false);
     1351  for (int i = 0; i < words.size (); i++)
     1352    {
     1353      if (need_version && words[i] != "")
     1354        {
     1355          version = words[i];
     1356          break;
     1357        }
     1358      if (words[i] == "Version")
     1359        need_version = true;
     1360    }
     1361
     1362  if (version == "")
     1363    {
     1364      devenv += "00";
     1365    }
     1366  else
     1367    {
     1368      CmtSystem::cmt_string_vector nbrs;
     1369      CmtSystem::split (version, ".", nbrs);
     1370      if (1 == nbrs.size ())
     1371        devenv += nbrs[0];
     1372      else
     1373        devenv += nbrs[0] + nbrs[1];
     1374    }
     1375
     1376  if (devenv != "")
     1377    {
     1378      Tag* tag;
     1379
     1380      tag = Tag::add (devenv, PriorityUname, "devenv", 0);
    13161381      tag->mark ();
    13171382    }
     
    56045669     
    56055670      use_home_requirements ();
     5671
     5672      configure_devenv_tag ();
    56065673
    56075674      break;
Note: See TracChangeset for help on using the changeset viewer.