* Find a file in the build or source tree for installation given a * relative path from the CMakeLists.txt file. This will favor files * present in the build tree. If a full path is given, it is just * returned. */
| 109 | * returned. |
| 110 | */ |
| 111 | static std::string FindInstallSource(cmMakefile& makefile, char const* name) |
| 112 | { |
| 113 | if (cmSystemTools::FileIsFullPath(name) || |
| 114 | cmGeneratorExpression::Find(name) == 0) { |
| 115 | // This is a full path. |
| 116 | return name; |
| 117 | } |
| 118 | |
| 119 | // This is a relative path. |
| 120 | std::string tb = cmStrCat(makefile.GetCurrentBinaryDirectory(), '/', name); |
| 121 | std::string ts = cmStrCat(makefile.GetCurrentSourceDirectory(), '/', name); |
| 122 | |
| 123 | if (cmSystemTools::FileExists(tb)) { |
| 124 | // The file exists in the binary tree. Use it. |
| 125 | return tb; |
| 126 | } |
| 127 | if (cmSystemTools::FileExists(ts)) { |
| 128 | // The file exists in the source tree. Use it. |
| 129 | return ts; |
| 130 | } |
| 131 | // The file doesn't exist. Assume it will be present in the |
| 132 | // binary tree when the install occurs. |
| 133 | return tb; |
| 134 | } |
no test coverage detected
searching dependent graphs…