~ubuntu-branches/ubuntu/jaunty/cmake/jaunty-security

« back to all changes in this revision

Viewing changes to Source/cmOrderLinkDirectories.h

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2006-06-18 16:34:11 UTC
  • mfrom: (1.4.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060618163411-pi234s3v6jwlcmof
Tags: 2.4.2-1
* New upstream release (Closes: #338324)
* Put cmake .vim files into /usr/share/vim/addons/plugin/
  where they can be used. (Closes: #366663)
* Install cmake-mode.el so it can be used. (Closes: #366664)
* Ensure cmake FindKDE locates KDE libraries on Debian
  based distributions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   CMake - Cross-Platform Makefile Generator
4
4
  Module:    $RCSfile: cmOrderLinkDirectories.h,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2005/11/23 17:33:39 $
7
 
  Version:   $Revision: 1.8.2.2 $
 
6
  Date:      $Date: 2006/05/14 19:22:43 $
 
7
  Version:   $Revision: 1.17.2.1 $
8
8
 
9
9
  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
10
10
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
49
49
public:
50
50
  cmOrderLinkDirectories();
51
51
  ///! set link information from the target
52
 
  void SetLinkInformation(cmTarget&, cmTarget::LinkLibraryType,
53
 
                          const char* targetLibrary);
 
52
  void SetLinkInformation(const char* targetName,
 
53
                          const std::vector<std::string>& linkLibraries,
 
54
                          const std::vector<std::string>& linkDirectories,
 
55
                          const cmTargetManifest& manifest,
 
56
                          const char* configSubdir);
54
57
  ///! Compute the best order for -L paths from GetLinkLibraries
55
58
  bool DetermineLibraryPathOrder();
56
59
  ///! Get the results from DetermineLibraryPathOrder
57
60
  void GetLinkerInformation(std::vector<cmStdString>& searchPaths,
58
61
                            std::vector<cmStdString>& linkItems)
59
62
  {
60
 
    linkItems = m_LinkItems;
61
 
    searchPaths = m_SortedSearchPaths;
 
63
    linkItems = this->LinkItems;
 
64
    searchPaths = this->SortedSearchPaths;
62
65
  }
63
66
  // should be set from CMAKE_STATIC_LIBRARY_SUFFIX,
64
67
  // CMAKE_SHARED_LIBRARY_SUFFIX
65
68
  // CMAKE_LINK_LIBRARY_SUFFIX
66
69
  void AddLinkExtension(const char* e)
67
70
    {
68
 
      m_LinkExtensions.push_back(e);
 
71
    if(e && *e)
 
72
      {
 
73
      this->LinkExtensions.push_back(e);
 
74
      }
69
75
    }
70
76
  // should be set from CMAKE_STATIC_LIBRARY_PREFIX
71
77
  void SetLinkPrefix(const char* s)
72
78
    {
73
 
      m_LinkPrefix = s;
 
79
    if(s)
 
80
      {
 
81
      this->LinkPrefix = s;
 
82
      }
74
83
    }
75
84
  // Return any warnings if the exist
76
85
  std::string GetWarnings();
87
96
  friend struct cmOrderLinkDirectoriesCompare;
88
97
  void DebugOn() 
89
98
    {
90
 
      m_Debug = true;
 
99
      this->Debug = true;
91
100
    }
92
101
  
93
102
private:
96
105
                                 std::vector<cmStdString>& libs,
97
106
                                 std::vector<cmStdString>& sortedPaths);
98
107
  void PrepareLinkTargets();
99
 
  bool LibraryInDirectory(const char* dir, const char* lib);
100
 
  void FindLibrariesInSeachPaths();
 
108
  bool LibraryInDirectory(const char* desiredLib,
 
109
                          const char* dir, const char* lib);
 
110
  void FindLibrariesInSearchPaths();
101
111
  void FindIndividualLibraryOrders();
102
112
  void PrintMap(const char* name,
103
113
                std::map<cmStdString, std::vector<cmStdString> >& m);
 
114
  void PrintVector(const char* name,
 
115
                   std::vector<std::pair<cmStdString, 
 
116
                   std::vector<cmStdString> > >& m);
104
117
  void OrderPaths(std::vector<cmStdString>& paths);
105
118
  bool FindPathNotInDirectoryToAfterList(cmStdString& path);
106
119
  std::string NoCaseExpression(const char* str);
 
120
  bool LibraryMayConflict(const char* desiredLib,
 
121
                          const char* dir, const char* fname);
107
122
private:
 
123
  // set of files that will exist when the build occurs
 
124
  std::set<cmStdString> ManifestFiles;
108
125
  // map from library to directories that it is in other than its full path
109
 
  std::map<cmStdString, std::vector<cmStdString> > m_LibraryToDirectories;
 
126
  std::map<cmStdString, std::vector<cmStdString> > LibraryToDirectories;
110
127
  // map from directory to vector of directories that must be after it
111
 
  std::map<cmStdString, std::vector<cmStdString> > m_DirectoryToAfterList;
 
128
  std::vector<std::pair<cmStdString, std::vector<cmStdString> > > 
 
129
  DirectoryToAfterList;
 
130
  std::set<cmStdString> DirectoryToAfterListEmitted;
112
131
  // map from full path to a Library struct
113
 
  std::map<cmStdString, Library> m_FullPathLibraries;
 
132
  std::map<cmStdString, Library> FullPathLibraries;
114
133
  // libraries that are found in multiple directories
115
 
  std::vector<Library> m_MultiDirectoryLibraries;
 
134
  std::vector<Library> MultiDirectoryLibraries;
116
135
  // libraries that are only found in one directory
117
 
  std::vector<Library> m_SingleDirectoryLibraries;
 
136
  std::vector<Library> SingleDirectoryLibraries;
118
137
  // This is a vector of all the link objects -lm or m
119
 
  std::vector<cmStdString> m_LinkItems;
 
138
  std::vector<cmStdString> LinkItems;
120
139
  // Unprocessed link items
121
 
  std::vector<cmStdString> m_RawLinkItems;
 
140
  std::vector<cmStdString> RawLinkItems;
122
141
  // This vector holds the sorted -L paths
123
 
  std::vector<cmStdString> m_SortedSearchPaths;
 
142
  std::vector<cmStdString> SortedSearchPaths;
 
143
  // This vector holds the -F paths
 
144
  std::set<cmStdString> EmittedFrameworkPaths;
124
145
  // This is the set of -L paths unsorted, but unique
125
 
  std::set<cmStdString> m_LinkPathSet;
 
146
  std::set<cmStdString> LinkPathSet;
126
147
  // the names of link extensions
127
 
  std::vector<cmStdString> m_LinkExtensions;
 
148
  std::vector<cmStdString> LinkExtensions;
128
149
  // the names of link prefixes
129
 
  cmStdString m_LinkPrefix;
 
150
  cmStdString LinkPrefix;
130
151
  // set of directories that can not be put in the correct order
131
 
  std::set<cmStdString> m_ImposibleDirectories;
 
152
  std::set<cmStdString> ImpossibleDirectories;
132
153
  // Name of target
133
 
  cmStdString m_TargetName;
 
154
  cmStdString TargetName;
 
155
  // Subdirectory used for this configuration if any.
 
156
  cmStdString ConfigSubdir;
134
157
  // library regular expressions
135
 
  cmsys::RegularExpression m_RemoveLibraryExtension;
136
 
  cmsys::RegularExpression m_ExtractBaseLibraryName;
137
 
  cmsys::RegularExpression m_ExtractBaseLibraryNameNoPrefix;
138
 
  bool m_Debug;
 
158
  cmsys::RegularExpression RemoveLibraryExtension;
 
159
  cmsys::RegularExpression ExtractBaseLibraryName;
 
160
  cmsys::RegularExpression ExtractBaseLibraryNameNoPrefix;
 
161
  cmsys::RegularExpression SplitFramework;
 
162
  bool Debug;
139
163
};
140
164
 
141
165
#endif