~ubuntu-branches/ubuntu/precise/cmake/precise-updates

« back to all changes in this revision

Viewing changes to Source/cmTargetLinkLibrariesCommand.cxx

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-01-17 23:04:07 UTC
  • mfrom: (1.13.6)
  • Revision ID: package-import@ubuntu.com-20120117230407-14cdb6g0mxmh29bl
Tags: 2.8.7-0ubuntu1
* New upstream release
  - Add increase_ctest_test_timeout.diff to increase timeout period
    of a test

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
  bool haveLLT = false;
96
96
 
97
97
  // Start with primary linking and switch to link interface
98
 
  // specification when the keyword is encountered.
99
 
  this->DoingInterface = false;
 
98
  // specification if the keyword is encountered as the first argument.
 
99
  this->CurrentProcessingState = ProcessingLinkLibraries;
100
100
 
101
101
  // add libraries, nothe that there is an optional prefix
102
102
  // of debug and optimized than can be used
104
104
    {
105
105
    if(args[i] == "LINK_INTERFACE_LIBRARIES")
106
106
      {
107
 
      this->DoingInterface = true;
 
107
      this->CurrentProcessingState = ProcessingLinkInterface;
108
108
      if(i != 1)
109
109
        {
110
110
        this->Makefile->IssueMessage(
115
115
        return true;
116
116
        }
117
117
      }
 
118
    else if(args[i] == "LINK_PUBLIC")
 
119
      {
 
120
      if(i != 1 && this->CurrentProcessingState != ProcessingPrivateInterface)
 
121
        {
 
122
        this->Makefile->IssueMessage(
 
123
          cmake::FATAL_ERROR,
 
124
          "The LINK_PUBLIC or LINK_PRIVATE option must appear as the second "
 
125
          "argument, just after the target name."
 
126
          );
 
127
        return true;
 
128
        }
 
129
      this->CurrentProcessingState = ProcessingPublicInterface;
 
130
      }
 
131
    else if(args[i] == "LINK_PRIVATE")
 
132
      {
 
133
      if(i != 1 && this->CurrentProcessingState != ProcessingPublicInterface)
 
134
        {
 
135
        this->Makefile->IssueMessage(
 
136
          cmake::FATAL_ERROR,
 
137
          "The LINK_PUBLIC or LINK_PRIVATE option must appear as the second "
 
138
          "argument, just after the target name."
 
139
          );
 
140
        return true;
 
141
        }
 
142
      this->CurrentProcessingState = ProcessingPrivateInterface;
 
143
      }
118
144
    else if(args[i] == "debug")
119
145
      {
120
146
      if(haveLLT)
186
212
    cmSystemTools::SetFatalErrorOccured();
187
213
    }
188
214
 
189
 
  // If the INTERFACE option was given, make sure the
190
 
  // LINK_INTERFACE_LIBRARIES property exists.  This allows the
191
 
  // command to be used to specify an empty link interface.
192
 
  if(this->DoingInterface &&
 
215
  // If any of the LINK_ options were given, make sure the
 
216
  // LINK_INTERFACE_LIBRARIES target property exists.
 
217
  // Use of any of the new keywords implies awareness of
 
218
  // this property. And if no libraries are named, it should
 
219
  // result in an empty link interface.
 
220
  if(this->CurrentProcessingState != ProcessingLinkLibraries &&
193
221
     !this->Target->GetProperty("LINK_INTERFACE_LIBRARIES"))
194
222
    {
195
223
    this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
217
245
                                            cmTarget::LinkLibraryType llt)
218
246
{
219
247
  // Handle normal case first.
220
 
  if(!this->DoingInterface)
 
248
  if(this->CurrentProcessingState != ProcessingLinkInterface)
221
249
    {
222
250
    this->Makefile
223
251
      ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
224
 
    return;
 
252
    if (this->CurrentProcessingState != ProcessingPublicInterface)
 
253
      {
 
254
      // Not LINK_INTERFACE_LIBRARIES or LINK_PUBLIC, do not add to interface.
 
255
      return;
 
256
      }
225
257
    }
226
258
 
227
259
  // Get the list of configurations considered to be DEBUG.