cmInstallCommandArguments.h 2.78 KB
Newer Older
1 2 3
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4

5 6
  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.
7

8 9 10 11
  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
12 13 14 15 16 17 18

#ifndef cmInstallCommandArguments_h
#define cmInstallCommandArguments_h

#include "cmStandardIncludes.h"
#include "cmCommandArgumentsHelper.h"

19
class cmInstallCommandArguments
20 21
{
  public:
22
    cmInstallCommandArguments(const std::string& defaultComponent);
23
    void SetGenericArguments(cmInstallCommandArguments* args)
24
                                               {this->GenericArguments = args;}
25
    void Parse(const std::vector<std::string>* args,
26 27 28
               std::vector<std::string>* unconsumedArgs);

    // Compute destination path.and check permissions
29 30 31 32
    bool Finalize();

    const std::string& GetDestination() const;
    const std::string& GetComponent() const;
33
    bool GetExcludeFromAll() const;
34 35 36 37
    const std::string& GetRename() const;
    const std::string& GetPermissions() const;
    const std::vector<std::string>& GetConfigurations() const;
    bool GetOptional() const;
38 39
    bool GetNamelinkOnly() const;
    bool GetNamelinkSkip() const;
40

41
    // once HandleDirectoryMode() is also switched to using
Alexander Neundorf's avatar
Alexander Neundorf committed
42 43
    // cmInstallCommandArguments then these two functions can become non-static
    // private member functions without arguments
44
    static bool CheckPermissions(const std::string& onePerm,
45
                                 std::string& perm);
46 47
    cmCommandArgumentsHelper Parser;
    cmCommandArgumentGroup ArgumentGroup;
48
  private:
49
    cmInstallCommandArguments(); // disabled
50 51
    cmCAString Destination;
    cmCAString Component;
52
    cmCAEnabler ExcludeFromAll;
53 54 55 56
    cmCAString Rename;
    cmCAStringVector Permissions;
    cmCAStringVector Configurations;
    cmCAEnabler Optional;
57 58
    cmCAEnabler NamelinkOnly;
    cmCAEnabler NamelinkSkip;
59

60
    std::string DestinationString;
61 62 63 64 65
    std::string PermissionsString;

    cmInstallCommandArguments* GenericArguments;
    static const char* PermissionsTable[];
    static const std::string EmptyString;
Brad King's avatar
Brad King committed
66
    std::string DefaultComponentName;
67 68 69
    bool CheckPermissions();
};

70 71 72 73 74 75 76 77 78 79 80 81 82
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;
};

83
#endif