Browse Source

added new cmake - uploaded2-3-base-stable-PPA

mango 2 years ago
parent
commit
6f01048ee1
100 changed files with 38338 additions and 0 deletions
  1. 24
    0
      c/cmake-3.5.1/.gitattributes
  2. 18
    0
      c/cmake-3.5.1/.hooks-config.bash
  3. 1
    0
      c/cmake-3.5.1/.pc/.quilt_patches
  4. 1
    0
      c/cmake-3.5.1/.pc/.quilt_series
  5. 1
    0
      c/cmake-3.5.1/.pc/.version
  6. 135
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmFLTKWrapUICommand.cxx
  7. 1472
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmInstallCommand.cxx
  8. 905
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmInstallTargetGenerator.cxx
  9. 3165
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmLocalGenerator.cxx
  10. 405
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmLocalGenerator.h
  11. 5195
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmMakefile.cxx
  12. 975
    0
      c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmMakefile.h
  13. 1708
    0
      c/cmake-3.5.1/.pc/FindBoost_add_-lpthread_#563479.diff/Modules/FindBoost.cmake
  14. 7
    0
      c/cmake-3.5.1/.pc/applied-patches
  15. 3176
    0
      c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Source/cmLocalGenerator.cxx
  16. 5207
    0
      c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Source/cmMakefile.cxx
  17. 976
    0
      c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Source/cmMakefile.h
  18. 3
    0
      c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Tests/AliasTarget/subdir/CMakeLists.txt
  19. 5479
    0
      c/cmake-3.5.1/.pc/fix-ftbfs-on-kfreebsd.patch/Source/kwsys/SystemInformation.cxx
  20. 1350
    0
      c/cmake-3.5.1/.pc/qt_import_dir_variable.diff/Modules/FindQt4.cmake
  21. 1727
    0
      c/cmake-3.5.1/.pc/ubuntu_boost-multiarch.patch/Modules/FindBoost.cmake
  22. 26
    0
      c/cmake-3.5.1/.pc/ubuntu_cmake-crosscompile.patch/Modules/AutogenInfo.cmake.in
  23. 130
    0
      c/cmake-3.5.1/.pc/ubuntu_cmake-crosscompile.patch/Modules/CMakeDetermineCompiler.cmake
  24. 193
    0
      c/cmake-3.5.1/.pc/ubuntu_cmake-crosscompile.patch/Modules/CMakeDetermineSystem.cmake
  25. 604
    0
      c/cmake-3.5.1/.pc/ubuntu_cmake-crosscompile.patch/Modules/FindPkgConfig.cmake
  26. 354
    0
      c/cmake-3.5.1/.pc/ubuntu_cmake-crosscompile.patch/Modules/GNUInstallDirs.cmake
  27. 4
    0
      c/cmake-3.5.1/Auxiliary/CMakeLists.txt
  28. 8
    0
      c/cmake-3.5.1/Auxiliary/bash-completion/CMakeLists.txt
  29. 158
    0
      c/cmake-3.5.1/Auxiliary/bash-completion/cmake
  30. 68
    0
      c/cmake-3.5.1/Auxiliary/bash-completion/cpack
  31. 92
    0
      c/cmake-3.5.1/Auxiliary/bash-completion/ctest
  32. 21
    0
      c/cmake-3.5.1/Auxiliary/cmake-help.vim
  33. 93
    0
      c/cmake-3.5.1/Auxiliary/cmake-indent.vim
  34. 398
    0
      c/cmake-3.5.1/Auxiliary/cmake-mode.el
  35. 89
    0
      c/cmake-3.5.1/Auxiliary/cmake-syntax.vim
  36. 53
    0
      c/cmake-3.5.1/Auxiliary/cmake.m4
  37. 220
    0
      c/cmake-3.5.1/CMakeCPack.cmake
  38. 290
    0
      c/cmake-3.5.1/CMakeCPackOptions.cmake.in
  39. 1
    0
      c/cmake-3.5.1/CMakeGraphVizOptions.cmake
  40. 696
    0
      c/cmake-3.5.1/CMakeLists.txt
  41. BIN
      c/cmake-3.5.1/CMakeLogo.gif
  42. 34
    0
      c/cmake-3.5.1/CONTRIBUTING.rst
  43. 20
    0
      c/cmake-3.5.1/CTestConfig.cmake
  44. 111
    0
      c/cmake-3.5.1/CTestCustom.cmake.in
  45. 90
    0
      c/cmake-3.5.1/CompileFlags.cmake
  46. 57
    0
      c/cmake-3.5.1/Copyright.txt
  47. 18
    0
      c/cmake-3.5.1/DartConfig.cmake
  48. 119
    0
      c/cmake-3.5.1/Help/command/FIND_XXX.txt
  49. 12
    0
      c/cmake-3.5.1/Help/command/FIND_XXX_ORDER.txt
  50. 29
    0
      c/cmake-3.5.1/Help/command/FIND_XXX_ROOT.txt
  51. 23
    0
      c/cmake-3.5.1/Help/command/add_compile_options.rst
  52. 208
    0
      c/cmake-3.5.1/Help/command/add_custom_command.rst
  53. 111
    0
      c/cmake-3.5.1/Help/command/add_custom_target.rst
  54. 27
    0
      c/cmake-3.5.1/Help/command/add_definitions.rst
  55. 23
    0
      c/cmake-3.5.1/Help/command/add_dependencies.rst
  56. 80
    0
      c/cmake-3.5.1/Help/command/add_executable.rst
  57. 162
    0
      c/cmake-3.5.1/Help/command/add_library.rst
  58. 36
    0
      c/cmake-3.5.1/Help/command/add_subdirectory.rst
  59. 66
    0
      c/cmake-3.5.1/Help/command/add_test.rst
  60. 24
    0
      c/cmake-3.5.1/Help/command/aux_source_directory.rst
  61. 12
    0
      c/cmake-3.5.1/Help/command/break.rst
  62. 45
    0
      c/cmake-3.5.1/Help/command/build_command.rst
  63. 15
    0
      c/cmake-3.5.1/Help/command/build_name.rst
  64. 25
    0
      c/cmake-3.5.1/Help/command/cmake_host_system_information.rst
  65. 41
    0
      c/cmake-3.5.1/Help/command/cmake_minimum_required.rst
  66. 85
    0
      c/cmake-3.5.1/Help/command/cmake_parse_arguments.rst
  67. 96
    0
      c/cmake-3.5.1/Help/command/cmake_policy.rst
  68. 111
    0
      c/cmake-3.5.1/Help/command/configure_file.rst
  69. 12
    0
      c/cmake-3.5.1/Help/command/continue.rst
  70. 30
    0
      c/cmake-3.5.1/Help/command/create_test_sourcelist.rst
  71. 73
    0
      c/cmake-3.5.1/Help/command/ctest_build.rst
  72. 39
    0
      c/cmake-3.5.1/Help/command/ctest_configure.rst
  73. 39
    0
      c/cmake-3.5.1/Help/command/ctest_coverage.rst
  74. 12
    0
      c/cmake-3.5.1/Help/command/ctest_empty_binary_directory.rst
  75. 29
    0
      c/cmake-3.5.1/Help/command/ctest_memcheck.rst
  76. 14
    0
      c/cmake-3.5.1/Help/command/ctest_read_custom_files.rst
  77. 15
    0
      c/cmake-3.5.1/Help/command/ctest_run_script.rst
  78. 16
    0
      c/cmake-3.5.1/Help/command/ctest_sleep.rst
  79. 25
    0
      c/cmake-3.5.1/Help/command/ctest_start.rst
  80. 65
    0
      c/cmake-3.5.1/Help/command/ctest_submit.rst
  81. 90
    0
      c/cmake-3.5.1/Help/command/ctest_test.rst
  82. 27
    0
      c/cmake-3.5.1/Help/command/ctest_update.rst
  83. 18
    0
      c/cmake-3.5.1/Help/command/ctest_upload.rst
  84. 45
    0
      c/cmake-3.5.1/Help/command/define_property.rst
  85. 10
    0
      c/cmake-3.5.1/Help/command/else.rst
  86. 10
    0
      c/cmake-3.5.1/Help/command/elseif.rst
  87. 22
    0
      c/cmake-3.5.1/Help/command/enable_language.rst
  88. 13
    0
      c/cmake-3.5.1/Help/command/enable_testing.rst
  89. 10
    0
      c/cmake-3.5.1/Help/command/endforeach.rst
  90. 10
    0
      c/cmake-3.5.1/Help/command/endfunction.rst
  91. 10
    0
      c/cmake-3.5.1/Help/command/endif.rst
  92. 10
    0
      c/cmake-3.5.1/Help/command/endmacro.rst
  93. 10
    0
      c/cmake-3.5.1/Help/command/endwhile.rst
  94. 24
    0
      c/cmake-3.5.1/Help/command/exec_program.rst
  95. 76
    0
      c/cmake-3.5.1/Help/command/execute_process.rst
  96. 57
    0
      c/cmake-3.5.1/Help/command/export.rst
  97. 28
    0
      c/cmake-3.5.1/Help/command/export_library_dependencies.rst
  98. 358
    0
      c/cmake-3.5.1/Help/command/file.rst
  99. 33
    0
      c/cmake-3.5.1/Help/command/find_file.rst
  100. 0
    0
      c/cmake-3.5.1/Help/command/find_library.rst

+ 24
- 0
c/cmake-3.5.1/.gitattributes View File

@@ -0,0 +1,24 @@
1
+.gitattributes   export-ignore
2
+.hooks*          export-ignore
3
+
4
+bootstrap        crlf=input
5
+configure        crlf=input
6
+*.[1-9]          crlf=input
7
+*.sh             crlf=input
8
+*.sh.in          crlf=input
9
+
10
+*.bat           -crlf
11
+*.bat.in        -crlf
12
+*.dsp           -crlf
13
+*.dsptemplate   -crlf
14
+*.dsw           -crlf
15
+*.pfx           -crlf
16
+*.png           -crlf
17
+*.sln           -crlf
18
+*.vcproj        -crlf
19
+
20
+*.c              whitespace=tab-in-indent
21
+*.h              whitespace=tab-in-indent
22
+*.cxx            whitespace=tab-in-indent
23
+*.txt            whitespace=tab-in-indent
24
+*.cmake          whitespace=tab-in-indent

+ 18
- 0
c/cmake-3.5.1/.hooks-config.bash View File

@@ -0,0 +1,18 @@
1
+#=============================================================================
2
+# CMake - Cross Platform Makefile Generator
3
+# Copyright 2000-2011 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
+#=============================================================================
12
+
13
+# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg)
14
+# during git commit after local hooks have been installed.
15
+
16
+hooks_chain_pre_commit="Utilities/Git/pre-commit"
17
+hooks_chain_commit_msg="Utilities/Git/commit-msg"
18
+hooks_chain_prepare_commit_msg="Utilities/Git/prepare-commit-msg"

+ 1
- 0
c/cmake-3.5.1/.pc/.quilt_patches View File

@@ -0,0 +1 @@
1
+debian/patches

+ 1
- 0
c/cmake-3.5.1/.pc/.quilt_series View File

@@ -0,0 +1 @@
1
+series

+ 1
- 0
c/cmake-3.5.1/.pc/.version View File

@@ -0,0 +1 @@
1
+2

+ 135
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmFLTKWrapUICommand.cxx View File

@@ -0,0 +1,135 @@
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
+============================================================================*/
12
+#include "cmFLTKWrapUICommand.h"
13
+
14
+#include "cmSourceFile.h"
15
+
16
+// cmFLTKWrapUICommand
17
+bool cmFLTKWrapUICommand
18
+::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
19
+{
20
+  if(args.size() < 2 )
21
+    {
22
+    this->SetError("called with incorrect number of arguments");
23
+    return false;
24
+    }
25
+
26
+  // what is the current source dir
27
+  std::string cdir = this->Makefile->GetCurrentSourceDirectory();
28
+  const char* fluid_exe =
29
+    this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE");
30
+
31
+  // get parameter for the command
32
+  this->Target = args[0];  // Target that will use the generated files
33
+
34
+  // get the list of GUI files from which .cxx and .h will be generated
35
+  std::string outputDirectory = this->Makefile->GetCurrentBinaryDirectory();
36
+
37
+  {
38
+  // Some of the generated files are *.h so the directory "GUI"
39
+  // where they are created have to be added to the include path
40
+  std::vector<std::string> outputDirectories;
41
+  outputDirectories.push_back(outputDirectory);
42
+  this->Makefile->AddIncludeDirectories( outputDirectories );
43
+  }
44
+
45
+  for(std::vector<std::string>::const_iterator i = (args.begin() + 1);
46
+      i != args.end(); i++)
47
+    {
48
+    cmSourceFile *curr = this->Makefile->GetSource(*i);
49
+    // if we should use the source GUI
50
+    // to generate .cxx and .h files
51
+    if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
52
+      {
53
+      std::string outName = outputDirectory;
54
+      outName += "/";
55
+      outName += cmSystemTools::GetFilenameWithoutExtension(*i);
56
+      std::string hname = outName;
57
+      hname += ".h";
58
+      std::string origname = cdir + "/" + *i;
59
+      // add starting depends
60
+      std::vector<std::string> depends;
61
+      depends.push_back(origname);
62
+      depends.push_back(fluid_exe);
63
+      std::string cxxres = outName;
64
+      cxxres += ".cxx";
65
+
66
+      cmCustomCommandLine commandLine;
67
+      commandLine.push_back(fluid_exe);
68
+      commandLine.push_back("-c"); // instructs Fluid to run in command line
69
+      commandLine.push_back("-h"); // optionally rename .h files
70
+      commandLine.push_back(hname);
71
+      commandLine.push_back("-o"); // optionally rename .cxx files
72
+      commandLine.push_back(cxxres);
73
+      commandLine.push_back(origname);// name of the GUI fluid file
74
+      cmCustomCommandLines commandLines;
75
+      commandLines.push_back(commandLine);
76
+
77
+      // Add command for generating the .h and .cxx files
78
+      std::string no_main_dependency = "";
79
+      const char* no_comment = 0;
80
+      const char* no_working_dir = 0;
81
+      this->Makefile->AddCustomCommandToOutput(cxxres,
82
+                                           depends, no_main_dependency,
83
+                                           commandLines, no_comment,
84
+                                           no_working_dir);
85
+      this->Makefile->AddCustomCommandToOutput(hname,
86
+                                           depends, no_main_dependency,
87
+                                           commandLines, no_comment,
88
+                                           no_working_dir);
89
+
90
+      cmSourceFile *sf = this->Makefile->GetSource(cxxres);
91
+      sf->AddDepend(hname.c_str());
92
+      sf->AddDepend(origname.c_str());
93
+      this->GeneratedSourcesClasses.push_back(sf);
94
+      }
95
+    }
96
+
97
+  // create the variable with the list of sources in it
98
+  size_t lastHeadersClass = this->GeneratedSourcesClasses.size();
99
+  std::string sourceListValue;
100
+  for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
101
+    {
102
+    if (classNum)
103
+      {
104
+      sourceListValue += ";";
105
+      }
106
+    sourceListValue += this->GeneratedSourcesClasses[classNum]->GetFullPath();
107
+    }
108
+  std::string varName = this->Target;
109
+  varName += "_FLTK_UI_SRCS";
110
+  this->Makefile->AddDefinition(varName, sourceListValue.c_str());
111
+
112
+  return true;
113
+}
114
+
115
+void cmFLTKWrapUICommand::FinalPass()
116
+{
117
+  // people should add the srcs to the target themselves, but the old command
118
+  // didn't support that, so check and see if they added the files in and if
119
+  // they didn;t then print a warning and add then anyhow
120
+  cmTarget* target = this->Makefile->FindTarget(this->Target);
121
+  if(!target)
122
+    {
123
+    std::string msg =
124
+      "FLTK_WRAP_UI was called with a target that was never created: ";
125
+    msg += this->Target;
126
+    msg +=".  The problem was found while processing the source directory: ";
127
+    msg += this->Makefile->GetCurrentSourceDirectory();
128
+    msg += ".  This FLTK_WRAP_UI call will be ignored.";
129
+    cmSystemTools::Message(msg.c_str(),"Warning");
130
+    return;
131
+    }
132
+}
133
+
134
+
135
+

+ 1472
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmInstallCommand.cxx
File diff suppressed because it is too large
View File


+ 905
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmInstallTargetGenerator.cxx View File

@@ -0,0 +1,905 @@
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
+============================================================================*/
12
+#include "cmInstallTargetGenerator.h"
13
+
14
+#include "cmComputeLinkInformation.h"
15
+#include "cmGeneratorExpression.h"
16
+#include "cmGlobalGenerator.h"
17
+#include "cmLocalGenerator.h"
18
+#include "cmMakefile.h"
19
+#include "cmGeneratorTarget.h"
20
+#include "cmake.h"
21
+#include "cmGeneratorTarget.h"
22
+
23
+#include <assert.h>
24
+
25
+//----------------------------------------------------------------------------
26
+cmInstallTargetGenerator
27
+::cmInstallTargetGenerator(const std::string& targetName,
28
+                           const char* dest, bool implib,
29
+                           const char* file_permissions,
30
+                           std::vector<std::string> const& configurations,
31
+                           const char* component,
32
+                           MessageLevel message,
33
+                           bool optional):
34
+  cmInstallGenerator(dest, configurations, component, message),
35
+  TargetName(targetName),
36
+  Target(0),
37
+  FilePermissions(file_permissions),
38
+  ImportLibrary(implib),
39
+  Optional(optional)
40
+{
41
+  this->ActionsPerConfig = true;
42
+  this->NamelinkMode = NamelinkModeNone;
43
+}
44
+
45
+//----------------------------------------------------------------------------
46
+cmInstallTargetGenerator
47
+::~cmInstallTargetGenerator()
48
+{
49
+}
50
+
51
+//----------------------------------------------------------------------------
52
+void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
53
+{
54
+  // Warn if installing an exclude-from-all target.
55
+  if(this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
56
+    {
57
+    std::ostringstream msg;
58
+    msg << "WARNING: Target \"" << this->Target->GetName()
59
+        << "\" has EXCLUDE_FROM_ALL set and will not be built by default "
60
+        << "but an install rule has been provided for it.  CMake does "
61
+        << "not define behavior for this case.";
62
+    cmSystemTools::Message(msg.str().c_str(), "Warning");
63
+    }
64
+
65
+  // Perform the main install script generation.
66
+  this->cmInstallGenerator::GenerateScript(os);
67
+}
68
+
69
+//----------------------------------------------------------------------------
70
+void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
71
+                                                    const std::string& config,
72
+                                                    Indent const& indent)
73
+{
74
+  // Compute the build tree directory from which to copy the target.
75
+  std::string fromDirConfig;
76
+  if(this->Target->NeedRelinkBeforeInstall(config))
77
+    {
78
+    fromDirConfig =
79
+        this->Target->GetLocalGenerator()->GetCurrentBinaryDirectory();
80
+    fromDirConfig += cmake::GetCMakeFilesDirectory();
81
+    fromDirConfig += "/CMakeRelink.dir/";
82
+    }
83
+  else
84
+    {
85
+    fromDirConfig =
86
+        this->Target->GetDirectory(config, this->ImportLibrary);
87
+    fromDirConfig += "/";
88
+    }
89
+  std::string toDir =
90
+    this->ConvertToAbsoluteDestination(this->GetDestination(config));
91
+  toDir += "/";
92
+
93
+  // Compute the list of files to install for this target.
94
+  std::vector<std::string> filesFrom;
95
+  std::vector<std::string> filesTo;
96
+  std::string literal_args;
97
+  cmState::TargetType targetType = this->Target->GetType();
98
+  cmInstallType type = cmInstallType();
99
+  switch(targetType)
100
+    {
101
+    case cmState::EXECUTABLE: type = cmInstallType_EXECUTABLE; break;
102
+    case cmState::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break;
103
+    case cmState::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break;
104
+    case cmState::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break;
105
+    case cmState::INTERFACE_LIBRARY:
106
+      // Not reachable. We never create a cmInstallTargetGenerator for
107
+      // an INTERFACE_LIBRARY.
108
+      assert(0 && "INTERFACE_LIBRARY targets have no installable outputs.");
109
+      break;
110
+    case cmState::OBJECT_LIBRARY:
111
+    case cmState::UTILITY:
112
+    case cmState::GLOBAL_TARGET:
113
+    case cmState::UNKNOWN_LIBRARY:
114
+      this->Target->GetLocalGenerator()->IssueMessage(cmake::INTERNAL_ERROR,
115
+        "cmInstallTargetGenerator created with non-installable target.");
116
+      return;
117
+    }
118
+  if(targetType == cmState::EXECUTABLE)
119
+    {
120
+    // There is a bug in cmInstallCommand if this fails.
121
+    assert(this->NamelinkMode == NamelinkModeNone);
122
+
123
+    std::string targetName;
124
+    std::string targetNameReal;
125
+    std::string targetNameImport;
126
+    std::string targetNamePDB;
127
+    this->Target->GetExecutableNames(targetName, targetNameReal,
128
+                                     targetNameImport, targetNamePDB,
129
+                                     config);
130
+    if(this->ImportLibrary)
131
+      {
132
+      std::string from1 = fromDirConfig + targetNameImport;
133
+      std::string to1 = toDir + targetNameImport;
134
+      filesFrom.push_back(from1);
135
+      filesTo.push_back(to1);
136
+      std::string targetNameImportLib;
137
+      if(this->Target->GetImplibGNUtoMS(targetNameImport,
138
+                                        targetNameImportLib))
139
+        {
140
+        filesFrom.push_back(fromDirConfig + targetNameImportLib);
141
+        filesTo.push_back(toDir + targetNameImportLib);
142
+        }
143
+
144
+      // An import library looks like a static library.
145
+      type = cmInstallType_STATIC_LIBRARY;
146
+      }
147
+    else
148
+      {
149
+      std::string from1 = fromDirConfig + targetName;
150
+      std::string to1 = toDir + targetName;
151
+
152
+      // Handle OSX Bundles.
153
+      if(this->Target->IsAppBundleOnApple())
154
+        {
155
+        cmMakefile const* mf = this->Target->Target->GetMakefile();
156
+
157
+        // Install the whole app bundle directory.
158
+        type = cmInstallType_DIRECTORY;
159
+        literal_args += " USE_SOURCE_PERMISSIONS";
160
+        from1 += ".app";
161
+
162
+        // Tweaks apply to the binary inside the bundle.
163
+        to1 += ".app/";
164
+        if(!mf->PlatformIsAppleIos())
165
+          {
166
+          to1 += "Contents/MacOS/";
167
+          }
168
+        to1 += targetName;
169
+        }
170
+      else
171
+        {
172
+        // Tweaks apply to the real file, so list it first.
173
+        if(targetNameReal != targetName)
174
+          {
175
+          std::string from2 = fromDirConfig + targetNameReal;
176
+          std::string to2 = toDir += targetNameReal;
177
+          filesFrom.push_back(from2);
178
+          filesTo.push_back(to2);
179
+          }
180
+        }
181
+
182
+      filesFrom.push_back(from1);
183
+      filesTo.push_back(to1);
184
+      }
185
+    }
186
+  else
187
+    {
188
+    std::string targetName;
189
+    std::string targetNameSO;
190
+    std::string targetNameReal;
191
+    std::string targetNameImport;
192
+    std::string targetNamePDB;
193
+    this->Target->GetLibraryNames(targetName, targetNameSO,
194
+                                          targetNameReal,
195
+                                  targetNameImport, targetNamePDB,
196
+                                  config);
197
+    if(this->ImportLibrary)
198
+      {
199
+      // There is a bug in cmInstallCommand if this fails.
200
+      assert(this->NamelinkMode == NamelinkModeNone);
201
+
202
+      std::string from1 = fromDirConfig + targetNameImport;
203
+      std::string to1 = toDir + targetNameImport;
204
+      filesFrom.push_back(from1);
205
+      filesTo.push_back(to1);
206
+      std::string targetNameImportLib;
207
+      if(this->Target->GetImplibGNUtoMS(targetNameImport,
208
+                                        targetNameImportLib))
209
+        {
210
+        filesFrom.push_back(fromDirConfig + targetNameImportLib);
211
+        filesTo.push_back(toDir + targetNameImportLib);
212
+        }
213
+
214
+      // An import library looks like a static library.
215
+      type = cmInstallType_STATIC_LIBRARY;
216
+      }
217
+    else if(this->Target->IsFrameworkOnApple())
218
+      {
219
+      // There is a bug in cmInstallCommand if this fails.
220
+      assert(this->NamelinkMode == NamelinkModeNone);
221
+
222
+      // Install the whole framework directory.
223
+      type = cmInstallType_DIRECTORY;
224
+      literal_args += " USE_SOURCE_PERMISSIONS";
225
+
226
+      std::string from1 = fromDirConfig + targetName;
227
+      from1 = cmSystemTools::GetFilenamePath(from1);
228
+
229
+      // Tweaks apply to the binary inside the bundle.
230
+      std::string to1 = toDir + targetNameReal;
231
+
232
+      filesFrom.push_back(from1);
233
+      filesTo.push_back(to1);
234
+      }
235
+    else if(this->Target->IsCFBundleOnApple())
236
+      {
237
+      // Install the whole app bundle directory.
238
+      type = cmInstallType_DIRECTORY;
239
+      literal_args += " USE_SOURCE_PERMISSIONS";
240
+
241
+      std::string targetNameBase = targetName.substr(0, targetName.find('/'));
242
+
243
+      std::string from1 = fromDirConfig + targetNameBase;
244
+      std::string to1 = toDir + targetName;
245
+
246
+      filesFrom.push_back(from1);
247
+      filesTo.push_back(to1);
248
+      }
249
+    else
250
+      {
251
+      bool haveNamelink = false;
252
+
253
+      // Library link name.
254
+      std::string fromName = fromDirConfig + targetName;
255
+      std::string toName = toDir + targetName;
256
+
257
+      // Library interface name.
258
+      std::string fromSOName;
259
+      std::string toSOName;
260
+      if(targetNameSO != targetName)
261
+        {
262
+        haveNamelink = true;
263
+        fromSOName = fromDirConfig + targetNameSO;
264
+        toSOName = toDir + targetNameSO;
265
+        }
266
+
267
+      // Library implementation name.
268
+      std::string fromRealName;
269
+      std::string toRealName;
270
+      if(targetNameReal != targetName &&
271
+         targetNameReal != targetNameSO)
272
+        {
273
+        haveNamelink = true;
274
+        fromRealName = fromDirConfig + targetNameReal;
275
+        toRealName = toDir + targetNameReal;
276
+        }
277
+
278
+      // Add the names based on the current namelink mode.
279
+      if(haveNamelink)
280
+        {
281
+        // With a namelink we need to check the mode.
282
+        if(this->NamelinkMode == NamelinkModeOnly)
283
+          {
284
+          // Install the namelink only.
285
+          filesFrom.push_back(fromName);
286
+          filesTo.push_back(toName);
287
+          }
288
+        else
289
+          {
290
+          // Install the real file if it has its own name.
291
+          if(!fromRealName.empty())
292
+            {
293
+            filesFrom.push_back(fromRealName);
294
+            filesTo.push_back(toRealName);
295
+            }
296
+
297
+          // Install the soname link if it has its own name.
298
+          if(!fromSOName.empty())
299
+            {
300
+            filesFrom.push_back(fromSOName);
301
+            filesTo.push_back(toSOName);
302
+            }
303
+
304
+          // Install the namelink if it is not to be skipped.
305
+          if(this->NamelinkMode != NamelinkModeSkip)
306
+            {
307
+            filesFrom.push_back(fromName);
308
+            filesTo.push_back(toName);
309
+            }
310
+          }
311
+        }
312
+      else
313
+        {
314
+        // Without a namelink there will be only one file.  Install it
315
+        // if this is not a namelink-only rule.
316
+        if(this->NamelinkMode != NamelinkModeOnly)
317
+          {
318
+          filesFrom.push_back(fromName);
319
+          filesTo.push_back(toName);
320
+          }
321
+        }
322
+      }
323
+    }
324
+
325
+  // If this fails the above code is buggy.
326
+  assert(filesFrom.size() == filesTo.size());
327
+
328
+  // Skip this rule if no files are to be installed for the target.
329
+  if(filesFrom.empty())
330
+    {
331
+    return;
332
+    }
333
+
334
+  // Add pre-installation tweaks.
335
+  this->AddTweak(os, indent, config, filesTo,
336
+                 &cmInstallTargetGenerator::PreReplacementTweaks);
337
+
338
+  // Write code to install the target file.
339
+  const char* no_dir_permissions = 0;
340
+  const char* no_rename = 0;
341
+  bool optional = this->Optional || this->ImportLibrary;
342
+  this->AddInstallRule(os, this->GetDestination(config),
343
+                       type, filesFrom, optional,
344
+                       this->FilePermissions.c_str(), no_dir_permissions,
345
+                       no_rename, literal_args.c_str(),
346
+                       indent);
347
+
348
+  // Add post-installation tweaks.
349
+  this->AddTweak(os, indent, config, filesTo,
350
+                 &cmInstallTargetGenerator::PostReplacementTweaks);
351
+}
352
+
353
+//----------------------------------------------------------------------------
354
+std::string
355
+cmInstallTargetGenerator::GetDestination(std::string const& config) const
356
+{
357
+  cmGeneratorExpression ge;
358
+  return ge.Parse(this->Destination)
359
+    ->Evaluate(this->Target->GetLocalGenerator(), config);
360
+}
361
+
362
+//----------------------------------------------------------------------------
363
+std::string
364
+cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
365
+{
366
+  NameType nameType = this->ImportLibrary? NameImplib : NameNormal;
367
+  return
368
+    cmInstallTargetGenerator::GetInstallFilename(this->Target, config,
369
+                                                 nameType);
370
+}
371
+
372
+//----------------------------------------------------------------------------
373
+std::string
374
+cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target,
375
+                                             const std::string& config,
376
+                                             NameType nameType)
377
+{
378
+  std::string fname;
379
+  // Compute the name of the library.
380
+  if(target->GetType() == cmState::EXECUTABLE)
381
+    {
382
+    std::string targetName;
383
+    std::string targetNameReal;
384
+    std::string targetNameImport;
385
+    std::string targetNamePDB;
386
+    target->GetExecutableNames(targetName, targetNameReal,
387
+                               targetNameImport, targetNamePDB,
388
+                               config);
389
+    if(nameType == NameImplib)
390
+      {
391
+      // Use the import library name.
392
+      if(!target->GetImplibGNUtoMS(targetNameImport, fname,
393
+                                   "${CMAKE_IMPORT_LIBRARY_SUFFIX}"))
394
+        {
395
+        fname = targetNameImport;
396
+        }
397
+      }
398
+    else if(nameType == NameReal)
399
+      {
400
+      // Use the canonical name.
401
+      fname = targetNameReal;
402
+      }
403
+    else
404
+      {
405
+      // Use the canonical name.
406
+      fname = targetName;
407
+      }
408
+    }
409
+  else
410
+    {
411
+    std::string targetName;
412
+    std::string targetNameSO;
413
+    std::string targetNameReal;
414
+    std::string targetNameImport;
415
+    std::string targetNamePDB;
416
+    target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
417
+                            targetNameImport, targetNamePDB, config);
418
+    if(nameType == NameImplib)
419
+      {
420
+      // Use the import library name.
421
+      if(!target->GetImplibGNUtoMS(targetNameImport, fname,
422
+                                   "${CMAKE_IMPORT_LIBRARY_SUFFIX}"))
423
+        {
424
+        fname = targetNameImport;
425
+        }
426
+      }
427
+    else if(nameType == NameSO)
428
+      {
429
+      // Use the soname.
430
+      fname = targetNameSO;
431
+      }
432
+    else if(nameType == NameReal)
433
+      {
434
+      // Use the real name.
435
+      fname = targetNameReal;
436
+      }
437
+    else
438
+      {
439
+      // Use the canonical name.
440
+      fname = targetName;
441
+      }
442
+    }
443
+
444
+  return fname;
445
+}
446
+
447
+void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg)
448
+{
449
+  this->Target = lg->FindGeneratorTarget(this->TargetName);
450
+}
451
+
452
+//----------------------------------------------------------------------------
453
+void
454
+cmInstallTargetGenerator
455
+::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
456
+           std::string const& file, TweakMethod tweak)
457
+{
458
+  std::ostringstream tw;
459
+  (this->*tweak)(tw, indent.Next(), config, file);
460
+  std::string tws = tw.str();
461
+  if(!tws.empty())
462
+    {
463
+    os << indent << "if(EXISTS \"" << file << "\" AND\n"
464
+       << indent << "   NOT IS_SYMLINK \"" << file << "\")\n";
465
+    os << tws;
466
+    os << indent << "endif()\n";
467
+    }
468
+}
469
+
470
+//----------------------------------------------------------------------------
471
+void
472
+cmInstallTargetGenerator
473
+::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
474
+           std::vector<std::string> const& files, TweakMethod tweak)
475
+{
476
+  if(files.size() == 1)
477
+    {
478
+    // Tweak a single file.
479
+    this->AddTweak(os, indent, config, this->GetDestDirPath(files[0]), tweak);
480
+    }
481
+  else
482
+    {
483
+    // Generate a foreach loop to tweak multiple files.
484
+    std::ostringstream tw;
485
+    this->AddTweak(tw, indent.Next(), config, "${file}", tweak);
486
+    std::string tws = tw.str();
487
+    if(!tws.empty())
488
+      {
489
+      Indent indent2 = indent.Next().Next();
490
+      os << indent << "foreach(file\n";
491
+      for(std::vector<std::string>::const_iterator i = files.begin();
492
+          i != files.end(); ++i)
493
+        {
494
+        os << indent2 << "\"" << this->GetDestDirPath(*i) << "\"\n";
495
+        }
496
+      os << indent2 << ")\n";
497
+      os << tws;
498
+      os << indent << "endforeach()\n";
499
+      }
500
+    }
501
+}
502
+
503
+//----------------------------------------------------------------------------
504
+std::string cmInstallTargetGenerator::GetDestDirPath(std::string const& file)
505
+{
506
+  // Construct the path of the file on disk after installation on
507
+  // which tweaks may be performed.
508
+  std::string toDestDirPath = "$ENV{DESTDIR}";
509
+  if(file[0] != '/' && file[0] != '$')
510
+    {
511
+    toDestDirPath += "/";
512
+    }
513
+  toDestDirPath += file;
514
+  return toDestDirPath;
515
+}
516
+
517
+//----------------------------------------------------------------------------
518
+void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
519
+                                                    Indent const& indent,
520
+                                                    const std::string& config,
521
+                                                    std::string const& file)
522
+{
523
+  this->AddRPathCheckRule(os, indent, config, file);
524
+}
525
+
526
+//----------------------------------------------------------------------------
527
+void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
528
+                                                    Indent const& indent,
529
+                                                    const std::string& config,
530
+                                                    std::string const& file)
531
+{
532
+  this->AddInstallNamePatchRule(os, indent, config, file);
533
+  this->AddChrpathPatchRule(os, indent, config, file);
534
+  this->AddUniversalInstallRule(os, indent, file);
535
+  this->AddRanlibRule(os, indent, file);
536
+  this->AddStripRule(os, indent, file);
537
+}
538
+
539
+//----------------------------------------------------------------------------
540
+void
541
+cmInstallTargetGenerator
542
+::AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
543
+                          const std::string& config,
544
+                          std::string const& toDestDirPath)
545
+{
546
+  if(this->ImportLibrary ||
547
+     !(this->Target->GetType() == cmState::SHARED_LIBRARY ||
548
+       this->Target->GetType() == cmState::MODULE_LIBRARY ||
549
+       this->Target->GetType() == cmState::EXECUTABLE))
550
+    {
551
+    return;
552
+    }
553
+
554
+  // Fix the install_name settings in installed binaries.
555
+  std::string installNameTool = this->Target->Target->GetMakefile()
556
+      ->GetSafeDefinition("CMAKE_INSTALL_NAME_TOOL");
557
+
558
+  if(installNameTool.empty())
559
+    {
560
+    return;
561
+    }
562
+
563
+  // Build a map of build-tree install_name to install-tree install_name for
564
+  // shared libraries linked to this target.
565
+  std::map<std::string, std::string> install_name_remap;
566
+  if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
567
+    {
568
+    std::set<cmGeneratorTarget const*> const& sharedLibs
569
+                                            = cli->GetSharedLibrariesLinked();
570
+    for(std::set<cmGeneratorTarget const*>::const_iterator j
571
+        = sharedLibs.begin(); j != sharedLibs.end(); ++j)
572
+      {
573
+      cmGeneratorTarget const* tgt = *j;
574
+
575
+      // The install_name of an imported target does not change.
576
+      if(tgt->IsImported())
577
+        {
578
+        continue;
579
+        }
580
+
581
+      // If the build tree and install tree use different path
582
+      // components of the install_name field then we need to create a
583
+      // mapping to be applied after installation.
584
+      std::string for_build = tgt->GetInstallNameDirForBuildTree(config);
585
+      std::string for_install = tgt->GetInstallNameDirForInstallTree();
586
+      if(for_build != for_install)
587
+        {
588
+        // The directory portions differ.  Append the filename to
589
+        // create the mapping.
590
+        std::string fname =
591
+          this->GetInstallFilename(tgt, config, NameSO);
592
+
593
+        // Map from the build-tree install_name.
594
+        for_build += fname;
595
+
596
+        // Map to the install-tree install_name.
597
+        for_install += fname;
598
+
599
+        // Store the mapping entry.
600
+        install_name_remap[for_build] = for_install;
601
+        }
602
+      }
603
+    }
604
+
605
+  // Edit the install_name of the target itself if necessary.
606
+  std::string new_id;
607
+  if(this->Target->GetType() == cmState::SHARED_LIBRARY)
608
+    {
609
+    std::string for_build =
610
+      this->Target->GetInstallNameDirForBuildTree(config);
611
+    std::string for_install =
612
+      this->Target->GetInstallNameDirForInstallTree();
613
+
614
+    if(this->Target->IsFrameworkOnApple() && for_install.empty())
615
+      {
616
+      // Frameworks seem to have an id corresponding to their own full
617
+      // path.
618
+      // ...
619
+      // for_install = fullDestPath_without_DESTDIR_or_name;
620
+      }
621
+
622
+    // If the install name will change on installation set the new id
623
+    // on the installed file.
624
+    if(for_build != for_install)
625
+      {
626
+      // Prepare to refer to the install-tree install_name.
627
+      new_id = for_install;
628
+      new_id += this->GetInstallFilename(this->Target, config, NameSO);
629
+      }
630
+    }
631
+
632
+  // Write a rule to run install_name_tool to set the install-tree
633
+  // install_name value and references.
634
+  if(!new_id.empty() || !install_name_remap.empty())
635
+    {
636
+    os << indent << "execute_process(COMMAND \"" << installNameTool;
637
+    os << "\"";
638
+    if(!new_id.empty())
639
+      {
640
+      os << "\n" << indent << "  -id \"" << new_id << "\"";
641
+      }
642
+    for(std::map<std::string, std::string>::const_iterator
643
+          i = install_name_remap.begin();
644
+        i != install_name_remap.end(); ++i)
645
+      {
646
+      os << "\n" << indent << "  -change \""
647
+         << i->first << "\" \"" << i->second << "\"";
648
+      }
649
+    os << "\n" << indent << "  \"" << toDestDirPath << "\")\n";
650
+    }
651
+}
652
+
653
+//----------------------------------------------------------------------------
654
+void
655
+cmInstallTargetGenerator
656
+::AddRPathCheckRule(std::ostream& os, Indent const& indent,
657
+                    const std::string& config,
658
+                    std::string const& toDestDirPath)
659
+{
660
+  // Skip the chrpath if the target does not need it.
661
+  if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
662
+    {
663
+    return;
664
+    }
665
+  // Skip if on Apple
666
+  if(this->Target->Target->GetMakefile()
667
+     ->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
668
+    {
669
+    return;
670
+    }
671
+
672
+  // Get the link information for this target.
673
+  // It can provide the RPATH.
674
+  cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
675
+  if(!cli)
676
+    {
677
+    return;
678
+    }
679
+
680
+  // Get the install RPATH from the link information.
681
+  std::string newRpath = cli->GetChrpathString();
682
+
683
+  // Write a rule to remove the installed file if its rpath is not the
684
+  // new rpath.  This is needed for existing build/install trees when
685
+  // the installed rpath changes but the file is not rebuilt.
686
+  os << indent << "file(RPATH_CHECK\n"
687
+     << indent << "     FILE \"" << toDestDirPath << "\"\n"
688
+     << indent << "     RPATH \"" << newRpath << "\")\n";
689
+}
690
+
691
+//----------------------------------------------------------------------------
692
+void
693
+cmInstallTargetGenerator
694
+::AddChrpathPatchRule(std::ostream& os, Indent const& indent,
695
+                      const std::string& config,
696
+                      std::string const& toDestDirPath)
697
+{
698
+  // Skip the chrpath if the target does not need it.
699
+  if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
700
+    {
701
+    return;
702
+    }
703
+
704
+  // Get the link information for this target.
705
+  // It can provide the RPATH.
706
+  cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
707
+  if(!cli)
708
+    {
709
+    return;
710
+    }
711
+
712
+  cmMakefile* mf = this->Target->Target->GetMakefile();
713
+
714
+  if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
715
+    {
716
+    // If using install_name_tool, set up the rules to modify the rpaths.
717
+    std::string installNameTool =
718
+      mf->GetSafeDefinition("CMAKE_INSTALL_NAME_TOOL");
719
+
720
+    std::vector<std::string> oldRuntimeDirs, newRuntimeDirs;
721
+    cli->GetRPath(oldRuntimeDirs, false);
722
+    cli->GetRPath(newRuntimeDirs, true);
723
+
724
+    std::string darwin_major_version_s =
725
+      mf->GetSafeDefinition("DARWIN_MAJOR_VERSION");
726
+
727
+    std::stringstream ss(darwin_major_version_s);
728
+    int darwin_major_version;
729
+    ss >> darwin_major_version;
730
+    if(!ss.fail() && darwin_major_version <= 9 &&
731
+       (!oldRuntimeDirs.empty() || !newRuntimeDirs.empty())
732
+      )
733
+      {
734
+      std::ostringstream msg;
735
+      msg << "WARNING: Target \"" << this->Target->GetName()
736
+        << "\" has runtime paths which cannot be changed during install.  "
737
+        << "To change runtime paths, OS X version 10.6 or newer is required.  "
738
+        << "Therefore, runtime paths will not be changed when installing.  "
739
+        << "CMAKE_BUILD_WITH_INSTALL_RPATH may be used to work around"
740
+           " this limitation.";
741
+      mf->IssueMessage(cmake::WARNING, msg.str());
742
+      }
743
+    else
744
+      {
745
+      // Note: These paths are kept unique to avoid
746
+      // install_name_tool corruption.
747
+      std::set<std::string> runpaths;
748
+      for(std::vector<std::string>::const_iterator i = oldRuntimeDirs.begin();
749
+          i != oldRuntimeDirs.end(); ++i)
750
+        {
751
+        std::string runpath =
752
+          mf->GetGlobalGenerator()->ExpandCFGIntDir(*i, config);
753
+
754
+        if(runpaths.find(runpath) == runpaths.end())
755
+          {
756
+          runpaths.insert(runpath);
757
+          os << indent << "execute_process(COMMAND " << installNameTool <<"\n";
758
+          os << indent << "  -delete_rpath \"" << runpath << "\"\n";
759
+          os << indent << "  \"" << toDestDirPath << "\")\n";
760
+          }
761
+        }
762
+
763
+      runpaths.clear();
764
+      for(std::vector<std::string>::const_iterator i = newRuntimeDirs.begin();
765
+          i != newRuntimeDirs.end(); ++i)
766
+        {
767
+        std::string runpath =
768
+          mf->GetGlobalGenerator()->ExpandCFGIntDir(*i, config);
769
+
770
+        if(runpaths.find(runpath) == runpaths.end())
771
+          {
772
+          os << indent << "execute_process(COMMAND " << installNameTool <<"\n";
773
+          os << indent << "  -add_rpath \"" << runpath << "\"\n";
774
+          os << indent << "  \"" << toDestDirPath << "\")\n";
775
+          }
776
+        }
777
+      }
778
+    }
779
+  else
780
+    {
781
+    // Construct the original rpath string to be replaced.
782
+    std::string oldRpath = cli->GetRPathString(false);
783
+
784
+    // Get the install RPATH from the link information.
785
+    std::string newRpath = cli->GetChrpathString();
786
+
787
+    // Skip the rule if the paths are identical
788
+    if(oldRpath == newRpath)
789
+      {
790
+      return;
791
+      }
792
+
793
+    // Write a rule to run chrpath to set the install-tree RPATH
794
+    os << indent << "file(RPATH_CHANGE\n"
795
+       << indent << "     FILE \"" << toDestDirPath << "\"\n"
796
+       << indent << "     OLD_RPATH \"" << oldRpath << "\"\n"
797
+       << indent << "     NEW_RPATH \"" << newRpath << "\")\n";
798
+    }
799
+}
800
+
801
+//----------------------------------------------------------------------------
802
+void
803
+cmInstallTargetGenerator::AddStripRule(std::ostream& os,
804
+                                       Indent const& indent,
805
+                                       const std::string& toDestDirPath)
806
+{
807
+
808
+  // don't strip static and import libraries, because it removes the only
809
+  // symbol table they have so you can't link to them anymore
810
+  if(this->Target->GetType()==cmState::STATIC_LIBRARY || this->ImportLibrary)
811
+    {
812
+    return;
813
+    }
814
+
815
+  // Don't handle OSX Bundles.
816
+  if(this->Target->Target->GetMakefile()->IsOn("APPLE") &&
817
+     this->Target->GetPropertyAsBool("MACOSX_BUNDLE"))
818
+    {
819
+    return;
820
+    }
821
+
822
+  if(! this->Target->Target->GetMakefile()->IsSet("CMAKE_STRIP"))
823
+    {
824
+    return;
825
+    }
826
+
827
+  os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n";
828
+  os << indent << "  execute_process(COMMAND \""
829
+     << this->Target->Target->GetMakefile()->GetDefinition("CMAKE_STRIP")
830
+     << "\" \"" << toDestDirPath << "\")\n";
831
+  os << indent << "endif()\n";
832
+}
833
+
834
+//----------------------------------------------------------------------------
835
+void
836
+cmInstallTargetGenerator::AddRanlibRule(std::ostream& os,
837
+                                        Indent const& indent,
838
+                                        const std::string& toDestDirPath)
839
+{
840
+  // Static libraries need ranlib on this platform.
841
+  if(this->Target->GetType() != cmState::STATIC_LIBRARY)
842
+    {
843
+    return;
844
+    }
845
+
846
+  // Perform post-installation processing on the file depending
847
+  // on its type.
848
+  if(!this->Target->Target->GetMakefile()->IsOn("APPLE"))
849
+    {
850
+    return;
851
+    }
852
+
853
+  std::string ranlib =
854
+    this->Target->Target->GetMakefile()->GetRequiredDefinition("CMAKE_RANLIB");
855
+  if(ranlib.empty())
856
+    {
857
+    return;
858
+    }
859
+
860
+  os << indent << "execute_process(COMMAND \""
861
+     << ranlib << "\" \"" << toDestDirPath << "\")\n";
862
+}
863
+
864
+//----------------------------------------------------------------------------
865
+void
866
+cmInstallTargetGenerator
867
+::AddUniversalInstallRule(std::ostream& os,
868
+                          Indent const& indent,
869
+                          const std::string& toDestDirPath)
870
+{
871
+  cmMakefile const* mf = this->Target->Target->GetMakefile();
872
+
873
+  if(!mf->PlatformIsAppleIos() || !mf->IsOn("XCODE"))
874
+    {
875
+    return;
876
+    }
877
+
878
+  const char* xcodeVersion = mf->GetDefinition("XCODE_VERSION");
879
+  if(!xcodeVersion || cmSystemTools::VersionCompareGreater("6", xcodeVersion))
880
+    {
881
+    return;
882
+    }
883
+
884
+  switch(this->Target->GetType())
885
+    {
886
+    case cmState::EXECUTABLE:
887
+    case cmState::STATIC_LIBRARY:
888
+    case cmState::SHARED_LIBRARY:
889
+    case cmState::MODULE_LIBRARY:
890
+      break;
891
+
892
+    default:
893
+      return;
894
+    }
895
+
896
+  if(!this->Target->Target->GetPropertyAsBool("IOS_INSTALL_COMBINED"))
897
+   {
898
+   return;
899
+   }
900
+
901
+  os << indent << "include(CMakeIOSInstallCombined)\n";
902
+  os << indent << "ios_install_combined("
903
+               << "\"" << this->Target->Target->GetName() << "\" "
904
+               << "\"" << toDestDirPath << "\")\n";
905
+}

+ 3165
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmLocalGenerator.cxx
File diff suppressed because it is too large
View File


+ 405
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmLocalGenerator.h View File

@@ -0,0 +1,405 @@
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
+============================================================================*/
12
+#ifndef cmLocalGenerator_h
13
+#define cmLocalGenerator_h
14
+
15
+#include "cmStandardIncludes.h"
16
+#include "cmState.h"
17
+#include "cmake.h"
18
+#include "cmOutputConverter.h"
19
+
20
+class cmMakefile;
21
+class cmGlobalGenerator;
22
+class cmGeneratorTarget;
23
+class cmTargetManifest;
24
+class cmSourceFile;
25
+class cmCustomCommand;
26
+class cmCustomCommandGenerator;
27
+
28
+/** \class cmLocalGenerator
29
+ * \brief Create required build files for a directory.
30
+ *
31
+ * Subclasses of this abstract class generate makefiles, DSP, etc for various
32
+ * platforms. This class should never be constructed directly. A
33
+ * GlobalGenerator will create it and invoke the appropriate commands on it.
34
+ */
35
+class cmLocalGenerator : public cmOutputConverter
36
+{
37
+public:
38
+  cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile);
39
+  virtual ~cmLocalGenerator();
40
+
41
+  /**
42
+   * Generate the makefile for this directory.
43
+   */
44
+  virtual void Generate() {}
45
+
46
+  virtual void ComputeHomeRelativeOutputPath() {}
47
+
48
+  /**
49
+   * Calls TraceVSDependencies() on all targets of this generator.
50
+   */
51
+  void TraceDependencies();
52
+
53
+  virtual void AddHelperCommands() {}
54
+
55
+  /**
56
+   * Generate the install rules files in this directory.
57
+   */
58
+  void GenerateInstallRules();
59
+
60
+  /**
61
+   * Generate the test files for tests.
62
+   */
63
+  void GenerateTestFiles();
64
+
65
+  /**
66
+   * Generate a manifest of target files that will be built.
67
+   */
68
+  void ComputeTargetManifest();
69
+
70
+  bool IsRootMakefile() const;
71
+
72
+  ///! Get the makefile for this generator
73
+  cmMakefile *GetMakefile() {
74
+    return this->Makefile; }
75
+
76
+  ///! Get the makefile for this generator, const version
77
+    const cmMakefile *GetMakefile() const {
78
+      return this->Makefile; }
79
+
80
+  ///! Get the GlobalGenerator this is associated with
81
+  cmGlobalGenerator *GetGlobalGenerator() {
82
+    return this->GlobalGenerator; }
83
+  const cmGlobalGenerator *GetGlobalGenerator() const {
84
+    return this->GlobalGenerator; }
85
+
86
+  cmState* GetState() const;
87
+  cmState::Snapshot GetStateSnapshot() const;
88
+
89
+  void AddArchitectureFlags(std::string& flags,
90
+                            cmGeneratorTarget const* target,
91
+                            const std::string&lang, const std::string& config);
92
+
93
+  void AddLanguageFlags(std::string& flags, const std::string& lang,
94
+                        const std::string& config);
95
+  void AddCMP0018Flags(std::string &flags, cmGeneratorTarget const* target,
96
+                       std::string const& lang, const std::string& config);
97
+  void AddVisibilityPresetFlags(std::string &flags,
98
+                                cmGeneratorTarget const* target,
99
+                                const std::string& lang);
100
+  void AddConfigVariableFlags(std::string& flags, const std::string& var,
101
+                              const std::string& config);
102
+  void AddCompilerRequirementFlag(std::string &flags,
103
+                                  cmGeneratorTarget const* target,
104
+                                  const std::string& lang);
105
+  ///! Append flags to a string.
106
+  virtual void AppendFlags(std::string& flags, const std::string& newFlags);
107
+  virtual void AppendFlags(std::string& flags, const char* newFlags);
108
+  virtual void AppendFlagEscape(std::string& flags,
109
+                                const std::string& rawFlag);
110
+  ///! Get the include flags for the current makefile and language
111
+  std::string GetIncludeFlags(const std::vector<std::string> &includes,
112
+                              cmGeneratorTarget* target,
113
+                              const std::string& lang,
114
+                              bool forceFullPaths = false,
115
+                              bool forResponseFile = false,
116
+                              const std::string& config = "");
117
+
118
+  const std::vector<cmGeneratorTarget*> &GetGeneratorTargets() const
119
+    {
120
+      return this->GeneratorTargets;
121
+    }
122
+
123
+  const std::vector<cmGeneratorTarget*> &GetImportedGeneratorTargets() const
124
+    {
125
+      return this->ImportedGeneratorTargets;
126
+    }
127
+
128
+  void AddGeneratorTarget(cmGeneratorTarget* gt);
129
+  void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
130
+  void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt);
131
+
132
+  cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
133
+  cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
134
+
135
+  /**
136
+   * Encode a list of preprocessor definitions for the compiler
137
+   * command line.
138
+   */
139
+  void AppendDefines(std::set<std::string>& defines,
140
+                     const char* defines_list);
141
+  void AppendDefines(std::set<std::string>& defines,
142
+                     std::string defines_list)
143
+  {
144
+    this->AppendDefines(defines, defines_list.c_str());
145
+  }
146
+  void AppendDefines(std::set<std::string>& defines,
147
+                     const std::vector<std::string> &defines_vec);
148
+
149
+  /**
150
+   * Join a set of defines into a definesString with a space separator.
151
+   */
152
+  void JoinDefines(const std::set<std::string>& defines,
153
+                   std::string &definesString,
154
+                   const std::string& lang);
155
+
156
+  /** Lookup and append options associated with a particular feature.  */
157
+  void AppendFeatureOptions(std::string& flags, const std::string& lang,
158
+                            const char* feature);
159
+
160
+  const char* GetFeature(const std::string& feature,
161
+                         const std::string& config);
162
+
163
+  /** \brief Get absolute path to dependency \a name
164
+   *
165
+   * Translate a dependency as given in CMake code to the name to
166
+   * appear in a generated build file.
167
+   * - If \a name is a utility target, returns false.
168
+   * - If \a name is a CMake target, it will be transformed to the real output
169
+   *   location of that target for the given configuration.
170
+   * - If \a name is the full path to a file, it will be returned.
171
+   * - Otherwise \a name is treated as a relative path with respect to
172
+   *   the source directory of this generator.  This should only be
173
+   *   used for dependencies of custom commands.
174
+   */
175
+  bool GetRealDependency(const std::string& name, const std::string& config,
176
+                         std::string& dep);
177
+
178
+  virtual std::string ConvertToIncludeReference(std::string const& path,
179
+                                                OutputFormat format = SHELL,
180
+                                                bool forceFullPaths = false);
181
+
182
+  /** Called from command-line hook to clear dependencies.  */
183
+  virtual void ClearDependencies(cmMakefile* /* mf */,
184
+                                 bool /* verbose */) {}
185
+
186
+  /** Called from command-line hook to update dependencies.  */
187
+  virtual bool UpdateDependencies(const char* /* tgtInfo */,
188
+                                  bool /*verbose*/,
189
+                                  bool /*color*/)
190
+    { return true; }
191
+
192
+  /** Get the include flags for the current makefile and language.  */
193
+  void GetIncludeDirectories(std::vector<std::string>& dirs,
194
+                             cmGeneratorTarget const* target,
195
+                             const std::string& lang = "C",
196
+                             const std::string& config = "",
197
+                             bool stripImplicitInclDirs = true) const;
198
+  void AddCompileOptions(std::string& flags, cmGeneratorTarget* target,
199
+                         const std::string& lang, const std::string& config);
200
+  void AddCompileDefinitions(std::set<std::string>& defines,
201
+                             cmGeneratorTarget const* target,
202
+                             const std::string& config,
203
+                             const std::string& lang);
204
+
205
+  std::string GetProjectName() const;
206
+
207
+  /** Compute the language used to compile the given source file.  */
208
+  std::string GetSourceFileLanguage(const cmSourceFile& source);
209
+
210
+  // Fill the vector with the target names for the object files,
211
+  // preprocessed files and assembly files.
212
+  void GetIndividualFileTargets(std::vector<std::string>&) {}
213
+
214
+  // Create a struct to hold the varibles passed into
215
+  // ExpandRuleVariables
216
+  struct RuleVariables
217
+  {
218
+    RuleVariables()
219
+      {
220
+        memset(this, 0,  sizeof(*this));
221
+      }
222
+    cmGeneratorTarget* CMTarget;
223
+    const char* TargetPDB;
224
+    const char* TargetCompilePDB;
225
+    const char* TargetVersionMajor;
226
+    const char* TargetVersionMinor;
227
+    const char* Language;
228
+    const char* Objects;
229
+    const char* Target;
230
+    const char* LinkLibraries;
231
+    const char* Source;
232
+    const char* AssemblySource;
233
+    const char* PreprocessedSource;
234
+    const char* Output;
235
+    const char* Object;
236
+    const char* ObjectDir;
237
+    const char* ObjectFileDir;
238
+    const char* Flags;
239
+    const char* ObjectsQuoted;
240
+    const char* SONameFlag;
241
+    const char* TargetSOName;
242
+    const char* TargetInstallNameDir;
243
+    const char* LinkFlags;
244
+    const char* Manifests;
245
+    const char* LanguageCompileFlags;
246
+    const char* Defines;
247
+    const char* Includes;
248
+    const char* RuleLauncher;
249
+    const char* DependencyFile;
250
+    const char* FilterPrefix;
251
+  };
252
+
253
+  /**
254
+   * Get the relative path from the generator output directory to a
255
+   * per-target support directory.
256
+   */
257
+  virtual std::string
258
+  GetTargetDirectory(cmGeneratorTarget const* target) const;
259
+
260
+  /**
261
+   * Get the level of backwards compatibility requested by the project
262
+   * in this directory.  This is the value of the CMake variable
263
+   * CMAKE_BACKWARDS_COMPATIBILITY whose format is
264
+   * "major.minor[.patch]".  The returned integer is encoded as
265
+   *
266
+   *   CMake_VERSION_ENCODE(major, minor, patch)
267
+   *
268
+   * and is monotonically increasing with the CMake version.
269
+   */
270
+  KWIML_INT_uint64_t GetBackwardsCompatibility();
271
+
272
+  /**
273
+   * Test whether compatibility is set to a given version or lower.
274
+   */
275
+  bool NeedBackwardsCompatibility_2_4();
276
+
277
+  cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
278
+
279
+  cmake* GetCMakeInstance() const;
280
+
281
+  const char* GetSourceDirectory() const;
282
+  const char* GetBinaryDirectory() const;
283
+
284
+  const char* GetCurrentBinaryDirectory() const;
285
+  const char* GetCurrentSourceDirectory() const;
286
+
287
+  /**
288
+   * Generate a Mac OS X application bundle Info.plist file.
289
+   */
290
+  void GenerateAppleInfoPList(cmGeneratorTarget* target,
291
+                              const std::string& targetName,
292
+                              const char* fname);
293
+
294
+  /**
295
+   * Generate a Mac OS X framework Info.plist file.
296
+   */
297
+  void GenerateFrameworkInfoPList(cmGeneratorTarget* target,
298
+                                  const std::string& targetName,
299
+                                  const char* fname);
300
+  /** Construct a comment for a custom command.  */
301
+  std::string ConstructComment(cmCustomCommandGenerator const& ccg,
302
+                               const char* default_comment = "");
303
+  // Compute object file names.
304
+  std::string GetObjectFileNameWithoutTarget(const cmSourceFile& source,
305
+                                             std::string const& dir_max,
306
+                                             bool* hasSourceExtension = 0);
307
+
308
+  /** Fill out the static linker flags for the given target.  */
309
+  void GetStaticLibraryFlags(std::string& flags,
310
+                             std::string const& config,
311
+                             cmGeneratorTarget* target);
312
+
313
+  /** Fill out these strings for the given target.  Libraries to link,
314
+   *  flags, and linkflags. */
315
+  void GetTargetFlags(std::string& linkLibs,
316
+                      std::string& flags,
317
+                      std::string& linkFlags,
318
+                      std::string& frameworkPath,
319
+                      std::string& linkPath,
320
+                      cmGeneratorTarget* target,
321
+                      bool useWatcomQuote);
322
+
323
+  virtual void ComputeObjectFilenames(
324
+                        std::map<cmSourceFile const*, std::string>& mapping,
325
+                        cmGeneratorTarget const* gt = 0);
326
+
327
+  bool IsWindowsShell() const;
328
+  bool IsWatcomWMake() const;
329
+  bool IsMinGWMake() const;
330
+  bool IsNMake() const;
331
+
332
+  void IssueMessage(cmake::MessageType t, std::string const& text) const;
333
+
334
+  void CreateEvaluationFileOutputs(const std::string& config);
335
+  void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
336
+
337
+protected:
338
+  ///! put all the libraries for a target on into the given stream
339
+  void OutputLinkLibraries(std::string& linkLibraries,
340
+                                   std::string& frameworkPath,
341
+                                   std::string& linkPath,
342
+                                   cmGeneratorTarget &,
343
+                                   bool relink,
344
+                                   bool forResponseFile,
345
+                                   bool useWatcomQuote);
346
+
347
+  // Expand rule variables in CMake of the type found in language rules
348
+  void ExpandRuleVariables(std::string& string,
349
+                           const RuleVariables& replaceValues);
350
+  // Expand rule variables in a single string
351
+  std::string ExpandRuleVariable(std::string const& variable,
352
+                                 const RuleVariables& replaceValues);
353
+
354
+  const char* GetRuleLauncher(cmGeneratorTarget* target,
355
+                              const std::string& prop);
356
+  void InsertRuleLauncher(std::string& s, cmGeneratorTarget* target,
357
+                          const std::string& prop);
358
+
359
+  // Handle old-style install rules stored in the targets.
360
+  void GenerateTargetInstallRules(
361
+    std::ostream& os, const std::string& config,
362
+    std::vector<std::string> const& configurationTypes);
363
+
364
+  std::string& CreateSafeUniqueObjectFileName(const std::string& sin,
365
+                                              std::string const& dir_max);
366
+
367
+  virtual std::string ConvertToLinkReference(std::string const& lib,
368
+                                             OutputFormat format = SHELL);
369
+
370
+  /** Check whether the native build system supports the given
371
+      definition.  Issues a warning.  */
372
+  virtual bool CheckDefinition(std::string const& define) const;
373
+
374
+  cmMakefile *Makefile;
375
+  cmState::Snapshot StateSnapshot;
376
+  cmGlobalGenerator *GlobalGenerator;
377
+  std::map<std::string, std::string> UniqueObjectNamesMap;
378
+  std::string::size_type ObjectPathMax;
379
+  std::set<std::string> ObjectMaxPathViolations;
380
+
381
+  std::set<cmGeneratorTarget const*> WarnCMP0063;
382
+  std::vector<cmGeneratorTarget*> GeneratorTargets;
383
+  std::vector<cmGeneratorTarget*> ImportedGeneratorTargets;
384
+  std::vector<cmGeneratorTarget*> OwnedImportedGeneratorTargets;
385
+  std::map<std::string, std::string> AliasTargets;
386
+
387
+  bool EmitUniversalBinaryFlags;
388
+
389
+  // Hack for ExpandRuleVariable until object-oriented version is
390
+  // committed.
391
+  std::string TargetImplib;
392
+
393
+  KWIML_INT_uint64_t BackwardsCompatibility;
394
+  bool BackwardsCompatibilityFinal;
395
+private:
396
+  void AddSharedFlags(std::string& flags, const std::string& lang,
397
+                      bool shared);
398
+  bool GetShouldUseOldFlags(bool shared, const std::string &lang) const;
399
+  void AddPositionIndependentFlags(std::string& flags, std::string const& l,
400
+                                   int targetType);
401
+
402
+  void ComputeObjectMaxPath();
403
+};
404
+
405
+#endif

+ 5195
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmMakefile.cxx
File diff suppressed because it is too large
View File


+ 975
- 0
c/cmake-3.5.1/.pc/0e44f4894f23d5eccd8d360f3420c832f9433a20.patch/Source/cmMakefile.h View File

@@ -0,0 +1,975 @@
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
+============================================================================*/
12
+#ifndef cmMakefile_h
13
+#define cmMakefile_h
14
+
15
+#include "cmExecutionStatus.h"
16
+#include "cmListFileCache.h"
17
+#include "cmSystemTools.h"
18
+#include "cmTarget.h"
19
+#include "cmNewLineStyle.h"
20
+#include "cmExpandedCommandArgument.h"
21
+#include "cmake.h"
22
+#include "cmState.h"
23
+#include "cmAlgorithms.h"
24
+
25
+#if defined(CMAKE_BUILD_WITH_CMAKE)
26
+#include "cmSourceGroup.h"
27
+#endif
28
+
29
+#include <cmsys/auto_ptr.hxx>
30
+#include <cmsys/RegularExpression.hxx>
31
+#if defined(CMAKE_BUILD_WITH_CMAKE)
32
+# ifdef CMake_HAVE_CXX11_UNORDERED_MAP
33
+#  include <unordered_map>
34
+# else
35
+#  include <cmsys/hash_map.hxx>
36
+# endif
37
+#endif
38
+
39
+#include <stack>
40
+
41
+class cmFunctionBlocker;
42
+class cmCommand;
43
+class cmInstallGenerator;
44
+class cmSourceFile;
45
+class cmTest;
46
+class cmTestGenerator;
47
+class cmVariableWatch;
48
+class cmake;
49
+class cmMakefileCall;
50
+class cmCMakePolicyCommand;
51
+class cmGeneratorExpressionEvaluationFile;
52
+class cmExportBuildFileGenerator;
53
+
54
+/** \class cmMakefile
55
+ * \brief Process the input CMakeLists.txt file.
56
+ *
57
+ * Process and store into memory the input CMakeLists.txt file.
58
+ * Each CMakeLists.txt file is parsed and the commands found there
59
+ * are added into the build process.
60
+ */
61
+class cmMakefile
62
+{
63
+public:
64
+  /* Mark a variable as used */
65
+  void MarkVariableAsUsed(const std::string& var);
66
+  /* return true if a variable has been initialized */
67
+  bool VariableInitialized(const std::string& ) const;
68
+
69
+  /**
70
+   * Construct an empty makefile.
71
+   */
72
+  cmMakefile(cmGlobalGenerator* globalGenerator,
73
+             const cmState::Snapshot& snapshot);
74
+
75
+  /**
76
+   * Destructor.
77
+   */
78
+  ~cmMakefile();
79
+
80
+  bool ReadListFile(const char* filename);
81
+
82
+  bool ReadDependentFile(const char* filename, bool noPolicyScope = true);
83
+
84
+  bool ProcessBuildsystemFile(const char* filename);
85
+
86
+  /**
87
+   * Add a function blocker to this makefile
88
+   */
89
+  void AddFunctionBlocker(cmFunctionBlocker* fb);
90
+
91
+  /// @return whether we are processing the top CMakeLists.txt file.
92
+  bool IsRootMakefile() const;
93
+
94
+  /**
95
+   * Remove the function blocker whose scope ends with the given command.
96
+   * This returns ownership of the function blocker object.
97
+   */
98
+  cmsys::auto_ptr<cmFunctionBlocker>
99
+  RemoveFunctionBlocker(cmFunctionBlocker* fb, const cmListFileFunction& lff);
100
+
101
+  /**
102
+   * Try running cmake and building a file. This is used for dynalically
103
+   * loaded commands, not as part of the usual build process.
104
+   */
105
+  int TryCompile(const std::string& srcdir, const std::string& bindir,
106
+                 const std::string& projectName, const std::string& targetName,
107
+                 bool fast,
108
+                 const std::vector<std::string> *cmakeArgs,
109
+                 std::string& output);
110
+
111
+  bool GetIsSourceFileTryCompile() const;
112
+
113
+  /**
114
+   * Help enforce global target name uniqueness.
115
+   */
116
+  bool EnforceUniqueName(std::string const& name, std::string& msg,
117
+                         bool isCustom = false) const;
118
+
119
+  /**
120
+   * Perform FinalPass, Library dependency analysis etc before output of the
121
+   * makefile.
122
+   */
123
+  void ConfigureFinalPass();
124
+
125
+  /**
126
+   * run the final pass on all commands.
127
+   */
128
+  void FinalPass();
129
+
130
+  /** Add a custom command to the build.  */
131
+  void AddCustomCommandToTarget(const std::string& target,
132
+                                const std::vector<std::string>& byproducts,
133
+                                const std::vector<std::string>& depends,
134
+                                const cmCustomCommandLines& commandLines,
135
+                                cmTarget::CustomCommandType type,
136
+                                const char* comment, const char* workingDir,
137
+                                bool escapeOldStyle = true,
138
+                                bool uses_terminal = false);
139
+  cmSourceFile* AddCustomCommandToOutput(
140
+    const std::vector<std::string>& outputs,
141
+    const std::vector<std::string>& byproducts,
142
+    const std::vector<std::string>& depends,
143
+    const std::string& main_dependency,
144
+    const cmCustomCommandLines& commandLines,
145
+    const char* comment, const char* workingDir,
146
+    bool replace = false,
147
+    bool escapeOldStyle = true,
148
+    bool uses_terminal = false);
149
+  cmSourceFile* AddCustomCommandToOutput(
150
+    const std::string& output,
151
+    const std::vector<std::string>& depends,
152
+    const std::string& main_dependency,
153
+    const cmCustomCommandLines& commandLines,
154
+    const char* comment, const char* workingDir,
155
+    bool replace = false,
156
+    bool escapeOldStyle = true,
157
+    bool uses_terminal = false);
158
+  void AddCustomCommandOldStyle(const std::string& target,
159
+                                const std::vector<std::string>& outputs,
160
+                                const std::vector<std::string>& depends,
161
+                                const std::string& source,
162
+                                const cmCustomCommandLines& commandLines,
163
+                                const char* comment);
164
+
165
+  /**
166
+   * Add a define flag to the build.
167
+   */
168
+  void AddDefineFlag(const char* definition);
169
+  void RemoveDefineFlag(const char* definition);
170
+  void AddCompileOption(const char* option);
171
+
172
+  /** Create a new imported target with the name and type given.  */
173
+  cmTarget* AddImportedTarget(const std::string& name,
174
+                              cmState::TargetType type,
175
+                              bool global);
176
+
177
+  cmTarget* AddNewTarget(cmState::TargetType type, const std::string& name);
178
+
179
+  /**
180
+   * Add an executable to the build.
181
+   */
182
+  cmTarget* AddExecutable(const char *exename,
183
+                          const std::vector<std::string> &srcs,
184
+                          bool excludeFromAll = false);
185
+
186
+  /**
187
+   * Add a utility to the build.  A utiltity target is a command that
188
+   * is run every time the target is built.
189
+   */
190
+  cmTarget* AddUtilityCommand(const std::string& utilityName,
191
+                              bool excludeFromAll,
192
+                              const std::vector<std::string>& depends,
193
+                              const char* workingDirectory,
194
+                              const char* command,
195
+                              const char* arg1=0,
196
+                              const char* arg2=0,
197
+                              const char* arg3=0,
198
+                              const char* arg4=0);
199
+  cmTarget* AddUtilityCommand(const std::string& utilityName,
200
+                              bool excludeFromAll,
201
+                              const char* workingDirectory,
202
+                              const std::vector<std::string>& depends,
203
+                              const cmCustomCommandLines& commandLines,
204
+                              bool escapeOldStyle = true,
205
+                              const char* comment = 0,
206
+                              bool uses_terminal = false);
207
+  cmTarget* AddUtilityCommand(const std::string& utilityName,
208
+                              bool excludeFromAll,
209
+                              const char* workingDirectory,
210
+                              const std::vector<std::string>& byproducts,
211
+                              const std::vector<std::string>& depends,
212
+                              const cmCustomCommandLines& commandLines,
213
+                              bool escapeOldStyle = true,
214
+                              const char* comment = 0,
215
+                              bool uses_terminal = false);
216
+
217
+  /**
218
+   * Add a link library to the build.
219
+   */
220
+  void AddLinkLibrary(const std::string&);
221
+  void AddLinkLibrary(const std::string&, cmTargetLinkLibraryType type);
222
+  void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
223
+                               cmTargetLinkLibraryType type);
224
+  void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
225
+
226
+  /**
227
+   * Add a subdirectory to the build.
228
+   */
229
+  void AddSubDirectory(const std::string& fullSrcDir,
230
+                       const std::string& fullBinDir,
231
+                       bool excludeFromAll,
232
+                       bool immediate);
233
+
234
+  void Configure();
235
+
236
+  /**
237
+   * Configure a subdirectory
238
+   */
239
+  void ConfigureSubDirectory(cmMakefile* mf);
240
+
241
+  /**
242
+   * Add an include directory to the build.
243
+   */
244
+  void AddIncludeDirectories(const std::vector<std::string> &incs,
245
+                             bool before = false);
246
+
247
+  /**
248
+   * Add a variable definition to the build. This variable
249
+   * can be used in CMake to refer to lists, directories, etc.
250
+   */
251
+  void AddDefinition(const std::string& name, const char* value);
252
+  ///! Add a definition to this makefile and the global cmake cache.
253
+  void AddCacheDefinition(const std::string& name, const char* value,
254
+                          const char* doc,
255
+                          cmState::CacheEntryType type,
256
+                          bool force = false);
257
+
258
+  /**
259
+   * Add bool variable definition to the build.
260
+   */
261
+  void AddDefinition(const std::string& name, bool);
262
+
263
+  /**
264
+   * Remove a variable definition from the build.  This is not valid
265
+   * for cache entries, and will only affect the current makefile.
266
+   */
267
+  void RemoveDefinition(const std::string& name);
268
+  ///! Remove a definition from the cache.
269
+  void RemoveCacheDefinition(const std::string& name);
270
+
271
+  /**
272
+   * Specify the name of the project for this build.
273
+   */
274
+  void SetProjectName(std::string const& name);
275
+
276
+  /** Get the configurations to be generated.  */
277
+  std::string GetConfigurations(std::vector<std::string>& configs,
278
+                                bool single = true) const;
279
+
280
+  /**
281
+   * Set the name of the library.
282
+   */
283
+  cmTarget* AddLibrary(const std::string& libname, cmState::TargetType type,
284
+                  const std::vector<std::string> &srcs,
285
+                  bool excludeFromAll = false);
286
+  void AddAlias(const std::string& libname, const std::string& tgt);
287
+
288
+#if defined(CMAKE_BUILD_WITH_CMAKE)
289
+  /**
290
+   * Add a root source group for consideration when adding a new source.
291
+   */
292
+  void AddSourceGroup(const std::string& name, const char* regex=0);
293
+
294
+  /**
295
+   * Add a source group for consideration when adding a new source.
296
+   * name is tokenized.
297
+   */
298
+  void AddSourceGroup(const std::vector<std::string>& name,
299
+                      const char* regex=0);
300
+
301
+#endif
302
+
303
+  //@{
304
+  /**
305
+     * Set, Push, Pop policy values for CMake.
306
+     */
307
+  bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
308
+  bool SetPolicy(const char *id, cmPolicies::PolicyStatus status);
309
+  cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
310
+  bool SetPolicyVersion(const char *version);
311
+  void RecordPolicies(cmPolicies::PolicyMap& pm);
312
+  //@}
313
+
314
+  /** Helper class to push and pop policies automatically.  */
315
+  class PolicyPushPop
316
+  {
317
+  public:
318
+    PolicyPushPop(cmMakefile* m);
319
+    ~PolicyPushPop();
320
+  private:
321
+    cmMakefile* Makefile;
322
+  };
323
+  friend class PolicyPushPop;
324
+
325
+  /**
326
+   * Determine if the given context, name pair has already been reported
327
+   * in context of CMP0054.
328
+   */
329
+  bool HasCMP0054AlreadyBeenReported(const cmListFileContext &context) const;
330
+
331
+  bool IgnoreErrorsCMP0061() const;
332
+
333
+  const char* GetHomeDirectory() const;
334
+  const char* GetHomeOutputDirectory() const;
335
+
336
+  /**
337
+   * Set CMAKE_SCRIPT_MODE_FILE variable when running a -P script.
338
+   */
339
+  void SetScriptModeFile(const char* scriptfile);
340
+
341
+  /**
342
+   * Set CMAKE_ARGC, CMAKE_ARGV0 ... variables.
343
+   */
344
+  void SetArgcArgv(const std::vector<std::string>& args);
345
+
346
+  const char* GetCurrentSourceDirectory() const;
347
+  const char* GetCurrentBinaryDirectory() const;
348
+
349
+  //@}
350
+
351
+  /**
352
+   * Set a regular expression that include files must match
353
+   * in order to be considered as part of the depend information.
354
+   */
355
+  void SetIncludeRegularExpression(const char* regex)
356
+    {
357
+      this->SetProperty("INCLUDE_REGULAR_EXPRESSION", regex);
358
+    }
359
+  const char* GetIncludeRegularExpression() const
360
+    {
361
+      return this->GetProperty("INCLUDE_REGULAR_EXPRESSION");
362
+    }
363
+
364
+  /**
365
+   * Set a regular expression that include files that are not found
366
+   * must match in order to be considered a problem.
367
+   */
368
+  void SetComplainRegularExpression(const std::string& regex)
369
+    {
370
+      this->ComplainFileRegularExpression = regex;
371
+    }
372
+  const char* GetComplainRegularExpression() const
373
+    {
374
+      return this->ComplainFileRegularExpression.c_str();
375
+    }
376
+
377
+  /**
378
+   * Get the list of targets
379
+   */
380
+  cmTargets &GetTargets() { return this->Targets; }
381
+  /**
382
+   * Get the list of targets, const version
383
+   */
384
+  const cmTargets &GetTargets() const { return this->Targets; }
385
+  const std::vector<cmTarget*> &GetOwnedImportedTargets() const
386
+    {
387
+      return this->ImportedTargetsOwned;
388
+    }
389
+  std::vector<cmTarget*> GetImportedTargets() const;
390
+
391
+  cmTarget* FindTarget(const std::string& name) const;
392
+
393
+  /** Find a target to use in place of the given name.  The target
394
+      returned may be imported or built within the project.  */
395
+  cmTarget* FindTargetToUse(const std::string& name,
396
+                            bool excludeAliases = false) const;
397
+  bool IsAlias(const std::string& name) const;
398
+
399
+  std::map<std::string, std::string> GetAliasTargets() const
400
+  {
401
+    return this->AliasTargets;
402
+  }
403
+
404
+  /**
405
+   * Mark include directories as system directories.
406
+   */
407
+  void AddSystemIncludeDirectories(const std::set<std::string> &incs);
408
+
409
+  /** Get a cmSourceFile pointer for a given source name, if the name is
410
+   *  not found, then a null pointer is returned.
411
+   */
412
+  cmSourceFile* GetSource(const std::string& sourceName) const;
413
+
414
+  /** Create the source file and return it. generated
415
+   * indicates if it is a generated file, this is used in determining
416
+   * how to create the source file instance e.g. name
417
+   */
418
+  cmSourceFile* CreateSource(const std::string& sourceName,
419
+                             bool generated = false);
420
+
421
+  /** Get a cmSourceFile pointer for a given source name, if the name is
422
+   *  not found, then create the source file and return it. generated
423
+   * indicates if it is a generated file, this is used in determining
424
+   * how to create the source file instance e.g. name
425
+   */
426
+  cmSourceFile* GetOrCreateSource(const std::string& sourceName,
427
+                                  bool generated = false);
428
+
429
+  /**
430
+   * Given a variable name, return its value (as a string).
431
+   * If the variable is not found in this makefile instance, the
432
+   * cache is then queried.
433
+   */
434
+  const char* GetDefinition(const std::string&) const;
435
+  const char* GetSafeDefinition(const std::string&) const;
436
+  const char* GetRequiredDefinition(const std::string& name) const;
437
+  bool IsDefinitionSet(const std::string&) const;
438
+  /**
439
+   * Get the list of all variables in the current space. If argument
440
+   * cacheonly is specified and is greater than 0, then only cache
441
+   * variables will be listed.
442
+   */
443
+  std::vector<std::string> GetDefinitions() const;
444
+
445
+  /**
446
+   * Test a boolean variable to see if it is true or false.
447
+   * If the variable is not found in this makefile instance, the
448
+   * cache is then queried.
449
+   * Returns false if no entry defined.
450
+   */
451
+  bool IsOn(const std::string& name) const;
452
+  bool IsSet(const std::string& name) const;
453
+
454
+  /** Return whether the target platform is 64-bit.  */
455
+  bool PlatformIs64Bit() const;
456
+
457
+  /** Return whether the target platform is Apple iOS.  */
458
+  bool PlatformIsAppleIos() const;
459
+
460
+  /** Retrieve soname flag for the specified language if supported */
461
+  const char* GetSONameFlag(const std::string& language) const;
462
+
463
+  /**
464
+   * Get a list of preprocessor define flags.
465
+   */
466
+  const char* GetDefineFlags() const
467
+    {return this->DefineFlags.c_str();}
468
+
469
+  /**
470
+   * Make sure CMake can write this file
471
+   */
472
+  bool CanIWriteThisFile(const char* fileName) const;
473
+
474
+#if defined(CMAKE_BUILD_WITH_CMAKE)
475
+  /**
476
+   * Get the vector source groups.
477
+   */
478
+  const std::vector<cmSourceGroup>& GetSourceGroups() const
479
+    { return this->SourceGroups; }
480
+
481
+  /**
482
+   * Get the source group
483
+   */
484
+  cmSourceGroup* GetSourceGroup(const std::vector<std::string>&name) const;
485
+#endif
486
+
487
+  /**
488
+   * Get the vector of list files on which this makefile depends
489
+   */
490
+  const std::vector<std::string>& GetListFiles() const
491
+    { return this->ListFiles; }
492
+  ///! When the file changes cmake will be re-run from the build system.
493
+  void AddCMakeDependFile(const std::string& file)
494
+    { this->ListFiles.push_back(file);}
495
+  void AddCMakeDependFilesFromUser();
496
+
497
+  std::string FormatListFileStack() const;
498
+
499
+  /**
500
+   * Get the current context backtrace.
501
+   */
502
+  cmListFileBacktrace GetBacktrace() const;
503
+  cmListFileBacktrace GetBacktrace(cmCommandContext const& lfc) const;
504
+  cmListFileContext GetExecutionContext() const;
505
+
506
+  /**
507
+   * Get the vector of  files created by this makefile
508
+   */
509
+  const std::vector<std::string>& GetOutputFiles() const
510
+    { return this->OutputFiles; }
511
+  void AddCMakeOutputFile(const std::string& file)
512
+    { this->OutputFiles.push_back(file);}
513
+
514
+  /**
515
+   * Expand all defined variables in the string.
516
+   * Defined variables come from the this->Definitions map.
517
+   * They are expanded with ${var} where var is the
518
+   * entry in the this->Definitions map.  Also \@var\@ is
519
+   * expanded to match autoconf style expansions.
520
+   */
521
+  const char *ExpandVariablesInString(std::string& source) const;
522
+  const char *ExpandVariablesInString(std::string& source, bool escapeQuotes,
523
+                                      bool noEscapes,
524
+                                      bool atOnly = false,
525
+                                      const char* filename = 0,
526
+                                      long line = -1,
527
+                                      bool removeEmpty = false,
528
+                                      bool replaceAt = false) const;
529
+
530
+  /**
531
+   * Remove any remaining variables in the string. Anything with ${var} or
532
+   * \@var\@ will be removed.
533
+   */
534
+  void RemoveVariablesInString(std::string& source,
535
+                               bool atOnly = false) const;
536
+
537
+  /**
538
+   * Expand variables in the makefiles ivars such as link directories etc
539
+   */
540
+  void ExpandVariablesCMP0019();
541
+
542
+  /**
543
+   * Replace variables and #cmakedefine lines in the given string.
544
+   * See cmConfigureFileCommand for details.
545
+   */
546
+  void ConfigureString(const std::string& input, std::string& output,
547
+                       bool atOnly, bool escapeQuotes) const;
548
+
549
+  /**
550
+   * Copy file but change lines acording to ConfigureString
551
+   */
552
+  int ConfigureFile(const char* infile, const char* outfile,
553
+                    bool copyonly, bool atOnly, bool escapeQuotes,
554
+                    const cmNewLineStyle& = cmNewLineStyle());
555
+
556
+
557
+#if defined(CMAKE_BUILD_WITH_CMAKE)
558
+  /**
559
+   * find what source group this source is in
560
+   */
561
+  cmSourceGroup* FindSourceGroup(const char* source,
562
+                                 std::vector<cmSourceGroup> &groups) const;
563
+#endif
564
+
565
+  /**
566
+   * Print a command's invocation
567
+   */
568
+  void PrintCommandTrace(const cmListFileFunction& lff) const;
569
+
570
+  /**
571
+   * Execute a single CMake command.  Returns true if the command
572
+   * succeeded or false if it failed.
573
+   */
574
+  bool ExecuteCommand(const cmListFileFunction& lff,
575
+                      cmExecutionStatus &status);
576
+
577
+  ///! Enable support for named language, if nil then all languages are
578
+  ///enabled.
579
+  void EnableLanguage(std::vector<std::string>const& languages, bool optional);
580
+
581
+  cmState *GetState() const;
582
+
583
+  /**
584
+   * Get the variable watch. This is used to determine when certain variables
585
+   * are accessed.
586
+   */
587
+#ifdef CMAKE_BUILD_WITH_CMAKE
588
+  cmVariableWatch* GetVariableWatch() const;
589
+#endif
590
+
591
+  ///! Display progress or status message.
592
+  void DisplayStatus(const char*, float) const;
593
+
594
+  /**
595
+   * Expand the given list file arguments into the full set after
596
+   * variable replacement and list expansion.
597
+   */
598
+  bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
599
+                       std::vector<std::string>& outArgs,
600
+                       const char* filename = 0) const;
601
+
602
+  bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
603
+                       std::vector<cmExpandedCommandArgument>& outArgs,
604
+                       const char* filename = 0) const;
605
+
606
+  /**
607
+   * Get the instance
608
+   */
609
+  cmake *GetCMakeInstance() const;
610
+  cmGlobalGenerator* GetGlobalGenerator() const;
611
+
612
+  /**
613
+   * Get all the source files this makefile knows about
614
+   */
615
+  const std::vector<cmSourceFile*> &GetSourceFiles() const
616
+    {return this->SourceFiles;}
617
+  std::vector<cmSourceFile*> &GetSourceFiles() {return this->SourceFiles;}
618
+
619
+  /**
620
+   * Is there a source file that has the provided source file as an output?
621
+   * if so then return it
622
+   */
623
+  cmSourceFile *GetSourceFileWithOutput(const std::string& outName) const;
624
+
625
+  ///! Add a new cmTest to the list of tests for this makefile.
626
+  cmTest* CreateTest(const std::string& testName);
627
+
628
+  /** Get a cmTest pointer for a given test name, if the name is
629
+   *  not found, then a null pointer is returned.
630
+   */
631
+  cmTest* GetTest(const std::string& testName) const;
632
+
633
+  /**
634
+   * Return a location of a file in cmake or custom modules directory
635
+   */
636
+  std::string GetModulesFile(const char* name) const;
637
+
638
+  ///! Set/Get a property of this directory
639
+  void SetProperty(const std::string& prop, const char *value);
640
+  void AppendProperty(const std::string& prop, const char *value,
641
+                      bool asString=false);
642
+  const char *GetProperty(const std::string& prop) const;
643
+  const char *GetProperty(const std::string& prop, bool chain) const;
644
+  bool GetPropertyAsBool(const std::string& prop) const;
645
+  std::vector<std::string> GetPropertyKeys() const;
646
+
647
+  ///! Initialize a makefile from its parent
648
+  void InitializeFromParent(cmMakefile* parent);
649
+
650
+  void AddInstallGenerator(cmInstallGenerator* g)
651
+    { if(g) this->InstallGenerators.push_back(g); }
652
+  std::vector<cmInstallGenerator*>& GetInstallGenerators()
653
+    { return this->InstallGenerators; }
654
+
655
+  void AddTestGenerator(cmTestGenerator* g)
656
+    { if(g) this->TestGenerators.push_back(g); }
657
+  const std::vector<cmTestGenerator*>& GetTestGenerators() const
658
+    { return this->TestGenerators; }
659
+
660
+  class FunctionPushPop
661
+  {
662
+  public:
663
+    FunctionPushPop(cmMakefile* mf, std::string const& fileName,
664
+                    cmPolicies::PolicyMap const& pm);
665
+    ~FunctionPushPop();
666
+
667
+    void Quiet() { this->ReportError = false; }
668
+  private:
669
+    cmMakefile* Makefile;
670
+    bool ReportError;
671
+  };
672
+
673
+  class MacroPushPop
674
+  {
675
+  public:
676
+    MacroPushPop(cmMakefile* mf, std::string const& fileName,
677
+                 cmPolicies::PolicyMap const& pm);
678
+    ~MacroPushPop();
679
+
680
+    void Quiet() { this->ReportError = false; }
681
+  private:
682
+    cmMakefile* Makefile;
683
+    bool ReportError;
684
+  };
685
+
686
+  void PushFunctionScope(std::string const& fileName,
687
+                         cmPolicies::PolicyMap const& pm);
688
+  void PopFunctionScope(bool reportError);
689
+  void PushMacroScope(std::string const& fileName,
690
+                      cmPolicies::PolicyMap const& pm);
691
+  void PopMacroScope(bool reportError);
692
+  void PushScope();
693
+  void PopScope();
694
+  void RaiseScope(const std::string& var, const char *value);
695
+
696
+  // push and pop loop scopes
697
+  void PushLoopBlockBarrier();
698
+  void PopLoopBlockBarrier();
699
+
700
+  /** Helper class to push and pop scopes automatically.  */
701
+  class ScopePushPop
702
+  {
703
+  public:
704
+    ScopePushPop(cmMakefile* m): Makefile(m) { this->Makefile->PushScope(); }
705
+    ~ScopePushPop() { this->Makefile->PopScope(); }
706
+  private:
707
+    cmMakefile* Makefile;
708
+  };
709
+
710
+  void IssueMessage(cmake::MessageType t,
711
+                    std::string const& text,
712
+                    bool force = false) const;
713
+
714
+  /** Set whether or not to report a CMP0000 violation.  */
715
+  void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
716
+
717
+  cmStringRange GetIncludeDirectoriesEntries() const;
718
+  cmBacktraceRange GetIncludeDirectoriesBacktraces() const;
719
+  cmStringRange GetCompileOptionsEntries() const;
720
+  cmBacktraceRange GetCompileOptionsBacktraces() const;
721
+  cmStringRange GetCompileDefinitionsEntries() const;
722
+  cmBacktraceRange GetCompileDefinitionsBacktraces() const;
723
+
724
+  void AddQtUiFileWithOptions(cmSourceFile *sf);
725
+  std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const;
726
+
727
+  std::set<std::string> const & GetSystemIncludeDirectories() const
728
+    { return this->SystemIncludeDirectories; }
729
+
730
+  bool PolicyOptionalWarningEnabled(std::string const& var);
731
+
732
+  bool AddRequiredTargetFeature(cmTarget *target,
733
+                                const std::string& feature,
734
+                                std::string *error = 0) const;
735
+
736
+  bool CompileFeatureKnown(cmTarget const* target, const std::string& feature,
737
+                           std::string& lang, std::string *error) const;
738
+
739
+  const char* CompileFeaturesAvailable(const std::string& lang,
740
+                                       std::string *error) const;
741
+
742
+  bool HaveStandardAvailable(cmTarget const* target, std::string const& lang,
743
+                            const std::string& feature) const;
744
+
745
+  bool IsLaterStandard(std::string const& lang,
746
+                       std::string const& lhs,
747
+                       std::string const& rhs);
748
+
749
+  void PushLoopBlock();
750
+  void PopLoopBlock();
751
+  bool IsLoopBlock() const;
752
+
753
+  void ClearMatches();
754
+  void StoreMatches(cmsys::RegularExpression& re);
755
+
756
+  cmState::Snapshot GetStateSnapshot() const;
757
+
758
+  const char* GetDefineFlagsCMP0059() const;
759
+
760
+  std::string GetExecutionFilePath() const;
761
+
762
+  void EnforceDirectoryLevelRules() const;
763
+
764
+  void AddEvaluationFile(const std::string &inputFile,
765
+                  cmsys::auto_ptr<cmCompiledGeneratorExpression> outputName,
766
+                  cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
767
+                  bool inputIsContent);
768
+  std::vector<cmGeneratorExpressionEvaluationFile*> GetEvaluationFiles() const;
769
+
770
+  std::vector<cmExportBuildFileGenerator*>
771
+  GetExportBuildFileGenerators() const;
772
+  void RemoveExportBuildFileGeneratorCMP0024(cmExportBuildFileGenerator* gen);
773
+  void AddExportBuildFileGenerator(cmExportBuildFileGenerator* gen);
774
+
775
+protected:
776
+  // add link libraries and directories to the target
777
+  void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
778
+
779
+  // Check for a an unused variable
780
+  void LogUnused(const char* reason, const std::string& name) const;
781
+
782
+  mutable std::set<cmListFileContext> CMP0054ReportedIds;
783
+
784
+  // libraries, classes, and executables
785
+  mutable cmTargets Targets;
786
+#if defined(CMAKE_BUILD_WITH_CMAKE)
787
+#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
788
+  typedef std::unordered_map<std::string, cmTarget*> TargetMap;
789
+#else
790
+  typedef cmsys::hash_map<std::string, cmTarget*> TargetMap;
791
+#endif
792
+#else
793
+  typedef std::map<std::string, cmTarget*> TargetMap;
794
+#endif
795
+  std::map<std::string, std::string> AliasTargets;
796
+  std::vector<cmSourceFile*> SourceFiles;
797
+
798
+  // Tests
799
+  std::map<std::string, cmTest*> Tests;
800
+
801
+  // The link-library paths.  Order matters, use std::vector (not std::set).
802
+  std::vector<std::string> LinkDirectories;
803
+
804
+  // The set of include directories that are marked as system include
805
+  // directories.
806
+  std::set<std::string> SystemIncludeDirectories;
807
+
808
+  std::vector<std::string> ListFiles;
809
+  std::vector<std::string> OutputFiles;
810
+
811
+  cmTarget::LinkLibraryVectorType LinkLibraries;
812
+
813
+  std::vector<cmInstallGenerator*> InstallGenerators;
814
+  std::vector<cmTestGenerator*> TestGenerators;
815
+
816
+  std::string ComplainFileRegularExpression;
817
+  std::string DefineFlags;
818
+
819
+  // Track the value of the computed DEFINITIONS property.
820
+  void AddDefineFlag(const char*, std::string&);
821
+  void RemoveDefineFlag(const char*, std::string::size_type, std::string&);
822
+  std::string DefineFlagsOrig;
823
+
824
+#if defined(CMAKE_BUILD_WITH_CMAKE)
825
+  std::vector<cmSourceGroup> SourceGroups;
826
+#endif
827
+
828
+  std::vector<cmCommand*> FinalPassCommands;
829
+  cmGlobalGenerator* GlobalGenerator;
830
+  bool IsFunctionBlocked(const cmListFileFunction& lff,
831
+                         cmExecutionStatus &status);
832
+
833
+private:
834
+  cmMakefile(const cmMakefile& mf);
835
+  cmMakefile& operator=(const cmMakefile& mf);
836
+
837
+  cmState::Snapshot StateSnapshot;
838
+
839
+  void ReadListFile(cmListFile const& listFile,
840
+                    const std::string& filenametoread);
841
+
842
+  bool ParseDefineFlag(std::string const& definition, bool remove);
843
+
844
+  bool EnforceUniqueDir(const std::string& srcPath,
845
+                        const std::string& binPath) const;
846
+
847
+  typedef std::vector<cmFunctionBlocker*> FunctionBlockersType;
848
+  FunctionBlockersType FunctionBlockers;
849
+  std::vector<FunctionBlockersType::size_type> FunctionBlockerBarriers;
850
+  void PushFunctionBlockerBarrier();
851
+  void PopFunctionBlockerBarrier(bool reportError = true);
852
+
853
+  std::stack<int> LoopBlockCounter;
854
+
855
+  mutable cmsys::RegularExpression cmDefineRegex;
856
+  mutable cmsys::RegularExpression cmDefine01Regex;
857
+  mutable cmsys::RegularExpression cmAtVarRegex;
858
+  mutable cmsys::RegularExpression cmNamedCurly;
859
+
860
+  std::vector<cmMakefile*> UnConfiguredDirectories;
861
+  std::vector<cmExportBuildFileGenerator*> ExportBuildFileGenerators;
862
+
863
+  std::vector<cmGeneratorExpressionEvaluationFile*> EvaluationFiles;
864
+
865
+  std::vector<cmCommandContext const*> ContextStack;
866
+  std::vector<cmExecutionStatus*> ExecutionStatusStack;
867
+  friend class cmMakefileCall;
868
+  friend class cmParseFileScope;
869
+
870
+  std::vector<cmTarget*> ImportedTargetsOwned;
871
+  TargetMap ImportedTargets;
872
+
873
+  // Internal policy stack management.
874
+  void PushPolicy(bool weak = false,
875
+                  cmPolicies::PolicyMap const& pm = cmPolicies::PolicyMap());
876
+  void PopPolicy();
877
+  void PopSnapshot(bool reportError = true);
878
+  friend class cmCMakePolicyCommand;
879
+  class IncludeScope;
880
+  friend class IncludeScope;
881
+  class ListFileScope;
882
+  friend class ListFileScope;
883
+  class BuildsystemFileScope;
884
+  friend class BuildsystemFileScope;
885
+
886
+
887
+  // CMP0053 == old
888
+  cmake::MessageType ExpandVariablesInStringOld(
889
+                                  std::string& errorstr,
890
+                                  std::string& source,
891
+                                  bool escapeQuotes,
892
+                                  bool noEscapes,
893
+                                  bool atOnly,
894
+                                  const char* filename,
895
+                                  long line,
896
+                                  bool removeEmpty,
897
+                                  bool replaceAt) const;
898
+  // CMP0053 == new
899
+  cmake::MessageType ExpandVariablesInStringNew(
900
+                                  std::string& errorstr,
901
+                                  std::string& source,
902
+                                  bool escapeQuotes,
903
+                                  bool noEscapes,
904
+                                  bool atOnly,
905
+                                  const char* filename,
906
+                                  long line,
907
+                                  bool removeEmpty,
908
+                                  bool replaceAt) const;
909
+  /**
910
+   * Old version of GetSourceFileWithOutput(const std::string&) kept for
911
+   * backward-compatibility. It implements a linear search and support
912
+   * relative file paths. It is used as a fall back by
913
+   * GetSourceFileWithOutput(const std::string&).
914
+   */
915
+  cmSourceFile *LinearGetSourceFileWithOutput(const std::string& cname) const;
916
+
917
+  // A map for fast output to input look up.
918
+#if defined(CMAKE_BUILD_WITH_CMAKE)
919
+#ifdef CMake_HAVE_CXX11_UNORDERED_MAP
920
+  typedef std::unordered_map<std::string, cmSourceFile*> OutputToSourceMap;
921
+#else
922
+  typedef cmsys::hash_map<std::string, cmSourceFile*> OutputToSourceMap;
923
+#endif
924
+#else
925
+  typedef std::map<std::string, cmSourceFile*> OutputToSourceMap;
926
+#endif
927
+  OutputToSourceMap OutputToSource;
928
+
929
+  void UpdateOutputToSourceMap(std::vector<std::string> const& outputs,
930
+                               cmSourceFile* source);
931
+  void UpdateOutputToSourceMap(std::string const& output,
932
+                               cmSourceFile* source);
933
+
934
+  std::vector<cmSourceFile*> QtUiFilesWithOptions;
935
+
936
+  bool AddRequiredTargetCFeature(cmTarget *target,
937
+                                 const std::string& feature) const;
938
+
939
+  bool AddRequiredTargetCxxFeature(cmTarget *target,
940
+                                   const std::string& feature) const;
941
+
942
+  void CheckNeededCLanguage(const std::string& feature, bool& needC90,
943
+                            bool& needC99, bool& needC11) const;
944
+  void CheckNeededCxxLanguage(const std::string& feature, bool& needCxx98,
945
+                              bool& needCxx11, bool& needCxx14) const;
946
+
947
+  bool HaveCStandardAvailable(cmTarget const* target,
948
+                             const std::string& feature) const;
949
+  bool HaveCxxStandardAvailable(cmTarget const* target,
950
+                               const std::string& feature) const;
951
+
952
+  void CheckForUnusedVariables() const;
953
+
954
+  // Unused variable flags
955
+  bool WarnUnused;
956
+  bool CheckSystemVars;
957
+  bool CheckCMP0000;
958
+  bool IsSourceFileTryCompile;
959
+  mutable bool SuppressWatches;
960
+};
961
+
962
+//----------------------------------------------------------------------------
963
+// Helper class to make sure the call stack is valid.
964
+class cmMakefileCall
965
+{
966
+public:
967
+  cmMakefileCall(cmMakefile* mf,
968
+                 cmCommandContext const& lfc,
969
+                 cmExecutionStatus& status);
970
+  ~cmMakefileCall();
971
+private:
972
+  cmMakefile* Makefile;
973
+};
974
+
975
+#endif

+ 1708
- 0
c/cmake-3.5.1/.pc/FindBoost_add_-lpthread_#563479.diff/Modules/FindBoost.cmake
File diff suppressed because it is too large
View File


+ 7
- 0
c/cmake-3.5.1/.pc/applied-patches View File

@@ -0,0 +1,7 @@
1
+FindBoost_add_-lpthread_#563479.diff
2
+qt_import_dir_variable.diff
3
+fix-ftbfs-on-kfreebsd.patch
4
+ubuntu_boost-multiarch.patch
5
+ubuntu_cmake-crosscompile.patch
6
+bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch
7
+0e44f4894f23d5eccd8d360f3420c832f9433a20.patch

+ 3176
- 0
c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Source/cmLocalGenerator.cxx
File diff suppressed because it is too large
View File


+ 5207
- 0
c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Source/cmMakefile.cxx
File diff suppressed because it is too large
View File


+ 976
- 0
c/cmake-3.5.1/.pc/bc30f8b5e66cb9c15fd224f5e51454c0bc66c67e.patch/Source/cmMakefile.h