~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Source/cmOrderDirectories.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=========================================================================
2
 
 
3
 
  Program:   CMake - Cross-Platform Makefile Generator
4
 
  Module:    $RCSfile: cmOrderDirectories.cxx,v $
5
 
  Language:  C++
6
 
  Date:      $Date: 2008-12-31 15:14:30 $
7
 
  Version:   $Revision: 1.4.2.2 $
8
 
 
9
 
  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
10
 
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
11
 
 
12
 
     This software is distributed WITHOUT ANY WARRANTY; without even
13
 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
 
     PURPOSE.  See the above copyright notices for more information.
15
 
 
16
 
=========================================================================*/
 
1
/*============================================================================
 
2
  CMake - Cross Platform Makefile Generator
 
3
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
 
4
 
 
5
  Distributed under the OSI-approved BSD License (the "License");
 
6
  see accompanying file Copyright.txt for details.
 
7
 
 
8
  This software is distributed WITHOUT ANY WARRANTY; without even the
 
9
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
10
  See the License for more information.
 
11
============================================================================*/
17
12
#include "cmOrderDirectories.h"
18
13
 
19
14
#include "cmGlobalGenerator.h"
372
367
//----------------------------------------------------------------------------
373
368
void
374
369
cmOrderDirectories
 
370
::AddLanguageDirectories(std::vector<std::string> const& dirs)
 
371
{
 
372
  this->LanguageDirectories.insert(this->LanguageDirectories.end(),
 
373
                                   dirs.begin(), dirs.end());
 
374
}
 
375
 
 
376
//----------------------------------------------------------------------------
 
377
void
 
378
cmOrderDirectories
375
379
::SetImplicitDirectories(std::set<cmStdString> const& implicitDirs)
376
380
{
377
381
  this->ImplicitDirectories = implicitDirs;
393
397
  // Add user directories specified for inclusion.  These should be
394
398
  // indexed first so their original order is preserved as much as
395
399
  // possible subject to the constraints.
396
 
  for(std::vector<std::string>::const_iterator
397
 
        di = this->UserDirectories.begin();
398
 
      di != this->UserDirectories.end(); ++di)
399
 
    {
400
 
    // We never explicitly specify implicit link directories.
401
 
    if(this->ImplicitDirectories.find(*di) !=
402
 
       this->ImplicitDirectories.end())
403
 
      {
404
 
      continue;
405
 
      }
406
 
 
407
 
    // Skip the empty string.
408
 
    if(di->empty())
409
 
      {
410
 
      continue;
411
 
      }
412
 
 
413
 
    // Add this directory.
414
 
    this->AddOriginalDirectory(*di);
415
 
    }
 
400
  this->AddOriginalDirectories(this->UserDirectories);
416
401
 
417
402
  // Add directories containing constraints.
418
403
  for(unsigned int i=0; i < this->ConstraintEntries.size(); ++i)
419
404
    {
420
405
    this->ConstraintEntries[i]->AddDirectory();
421
406
    }
 
407
 
 
408
  // Add language runtime directories last.
 
409
  this->AddOriginalDirectories(this->LanguageDirectories);
422
410
}
423
411
 
424
412
//----------------------------------------------------------------------------
439
427
}
440
428
 
441
429
//----------------------------------------------------------------------------
 
430
void
 
431
cmOrderDirectories
 
432
::AddOriginalDirectories(std::vector<std::string> const& dirs)
 
433
{
 
434
  for(std::vector<std::string>::const_iterator di = dirs.begin();
 
435
      di != dirs.end(); ++di)
 
436
    {
 
437
    // We never explicitly specify implicit link directories.
 
438
    if(this->ImplicitDirectories.find(*di) !=
 
439
       this->ImplicitDirectories.end())
 
440
      {
 
441
      continue;
 
442
      }
 
443
 
 
444
    // Skip the empty string.
 
445
    if(di->empty())
 
446
      {
 
447
      continue;
 
448
      }
 
449
 
 
450
    // Add this directory.
 
451
    this->AddOriginalDirectory(*di);
 
452
    }
 
453
}
 
454
 
 
455
//----------------------------------------------------------------------------
442
456
struct cmOrderDirectoriesCompare
443
457
{
444
458
  typedef std::pair<int, int> ConflictPair;