| 178 | } |
| 179 | |
| 180 | int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON( |
| 181 | Json::Value& root) |
| 182 | { |
| 183 | if (!this->WriteVersion(root)) { |
| 184 | return 0; |
| 185 | } |
| 186 | |
| 187 | cmValue packageName = this->Parent->GetOption("CPACK_PACKAGE_NAME"); |
| 188 | if (packageName) { |
| 189 | root["packageName"] = *packageName; |
| 190 | } |
| 191 | |
| 192 | cmValue packageVersion = this->Parent->GetOption("CPACK_PACKAGE_VERSION"); |
| 193 | if (packageVersion) { |
| 194 | root["packageVersion"] = *packageVersion; |
| 195 | } |
| 196 | |
| 197 | cmValue packageDescriptionFile = |
| 198 | this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE"); |
| 199 | if (packageDescriptionFile) { |
| 200 | root["packageDescriptionFile"] = *packageDescriptionFile; |
| 201 | } |
| 202 | |
| 203 | cmValue packageDescriptionSummary = |
| 204 | this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY"); |
| 205 | if (packageDescriptionSummary) { |
| 206 | root["packageDescriptionSummary"] = *packageDescriptionSummary; |
| 207 | } |
| 208 | |
| 209 | cmValue buildConfigCstr = this->Parent->GetOption("CPACK_BUILD_CONFIG"); |
| 210 | if (buildConfigCstr) { |
| 211 | root["buildConfig"] = *buildConfigCstr; |
| 212 | } |
| 213 | |
| 214 | cmValue defaultDirectoryPermissions = |
| 215 | this->Parent->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); |
| 216 | if (cmNonempty(defaultDirectoryPermissions)) { |
| 217 | root["defaultDirectoryPermissions"] = *defaultDirectoryPermissions; |
| 218 | } |
| 219 | if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) { |
| 220 | root["setDestdir"] = true; |
| 221 | root["packagingInstallPrefix"] = |
| 222 | *this->Parent->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); |
| 223 | } else { |
| 224 | root["setDestdir"] = false; |
| 225 | } |
| 226 | |
| 227 | root["stripFiles"] = !this->Parent->GetOption("CPACK_STRIP_FILES").IsOff(); |
| 228 | root["warnOnAbsoluteInstallDestination"] = |
| 229 | this->Parent->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"); |
| 230 | root["errorOnAbsoluteInstallDestination"] = |
| 231 | this->Parent->IsOn("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"); |
| 232 | |
| 233 | Json::Value& projects = root["projects"] = Json::Value(Json::arrayValue); |
| 234 | for (auto& project : this->Parent->CMakeProjects) { |
| 235 | Json::Value jsonProject(Json::objectValue); |
| 236 | |
| 237 | jsonProject["projectName"] = project.ProjectName; |
no test coverage detected