https://github.com/Kitware/CMake
Revision 2a8d9bf4cc97edbf57142d96ace5c74473f76809 authored by Brad King on 14 September 2021, 13:34:22 UTC, committed by Kitware Robot on 14 September 2021, 13:35:07 UTC
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6493
2 parent s 036f41e + 059b90a
Raw File
Tip revision: 2a8d9bf4cc97edbf57142d96ace5c74473f76809 authored by Brad King on 14 September 2021, 13:34:22 UTC
Merge topic 'CMakeDependentOption-condition-syntax'
Tip revision: 2a8d9bf
cmCPackPropertiesGenerator.cxx
#include "cmCPackPropertiesGenerator.h"

#include <map>
#include <ostream>

#include "cmGeneratorExpression.h"
#include "cmInstalledFile.h"
#include "cmOutputConverter.h"

cmCPackPropertiesGenerator::cmCPackPropertiesGenerator(
  cmLocalGenerator* lg, cmInstalledFile const& installedFile,
  std::vector<std::string> const& configurations)
  : cmScriptGenerator("CPACK_BUILD_CONFIG", configurations)
  , LG(lg)
  , InstalledFile(installedFile)
{
  this->ActionsPerConfig = true;
}

void cmCPackPropertiesGenerator::GenerateScriptForConfig(
  std::ostream& os, const std::string& config, Indent indent)
{
  std::string const& expandedFileName =
    this->InstalledFile.GetNameExpression().Evaluate(this->LG, config);

  cmInstalledFile::PropertyMapType const& properties =
    this->InstalledFile.GetProperties();

  for (cmInstalledFile::PropertyMapType::value_type const& i : properties) {
    std::string const& name = i.first;
    cmInstalledFile::Property const& property = i.second;

    os << indent << "set_property(INSTALL "
       << cmOutputConverter::EscapeForCMake(expandedFileName) << " PROPERTY "
       << cmOutputConverter::EscapeForCMake(name);

    for (cmInstalledFile::ExpressionVectorType::value_type const& j :
         property.ValueExpressions) {
      std::string value = j->Evaluate(this->LG, config);
      os << " " << cmOutputConverter::EscapeForCMake(value);
    }

    os << ")\n";
  }
}
back to top