https://github.com/Kitware/CMake
Revision a7e4d595f9cd4d6c6da66f06e8ba11075ec579f3 authored by Brad King on 02 August 2017, 20:15:28 UTC, committed by Brad King on 02 August 2017, 20:27:06 UTC
2 parent s 1181ad6 + 70272f3
Raw File
Tip revision: a7e4d595f9cd4d6c6da66f06e8ba11075ec579f3 authored by Brad King on 02 August 2017, 20:15:28 UTC
Merge branch 'server-fix-crash' into release-3.9
Tip revision: a7e4d59
cmInstallCommandArguments.h
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#ifndef cmInstallCommandArguments_h
#define cmInstallCommandArguments_h

#include "cmConfigure.h" // IWYU pragma: keep

#include <string>
#include <vector>

#include "cmCommandArgumentsHelper.h"

class cmInstallCommandArguments
{
public:
  cmInstallCommandArguments(const std::string& defaultComponent);
  void SetGenericArguments(cmInstallCommandArguments* args)
  {
    this->GenericArguments = args;
  }
  void Parse(const std::vector<std::string>* args,
             std::vector<std::string>* unconsumedArgs);

  // Compute destination path.and check permissions
  bool Finalize();

  const std::string& GetDestination() const;
  const std::string& GetComponent() const;
  bool GetExcludeFromAll() const;
  const std::string& GetRename() const;
  const std::string& GetPermissions() const;
  const std::vector<std::string>& GetConfigurations() const;
  bool GetOptional() const;
  bool GetNamelinkOnly() const;
  bool GetNamelinkSkip() const;

  // once HandleDirectoryMode() is also switched to using
  // cmInstallCommandArguments then these two functions can become non-static
  // private member functions without arguments
  static bool CheckPermissions(const std::string& onePerm, std::string& perm);
  cmCommandArgumentsHelper Parser;
  cmCommandArgumentGroup ArgumentGroup;

private:
  cmInstallCommandArguments(); // disabled
  cmCAString Destination;
  cmCAString Component;
  cmCAEnabler ExcludeFromAll;
  cmCAString Rename;
  cmCAStringVector Permissions;
  cmCAStringVector Configurations;
  cmCAEnabler Optional;
  cmCAEnabler NamelinkOnly;
  cmCAEnabler NamelinkSkip;

  std::string DestinationString;
  std::string PermissionsString;

  cmInstallCommandArguments* GenericArguments;
  static const char* PermissionsTable[];
  static const std::string EmptyString;
  std::string DefaultComponentName;
  bool CheckPermissions();
};

class cmInstallCommandIncludesArgument
{
public:
  cmInstallCommandIncludesArgument();
  void Parse(const std::vector<std::string>* args,
             std::vector<std::string>* unconsumedArgs);

  const std::vector<std::string>& GetIncludeDirs() const;

private:
  std::vector<std::string> IncludeDirs;
};

#endif
back to top