cmInstallCommand.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmInstallCommand_h
  4. #define cmInstallCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include <cm/memory>
  9. #include "cmCommand.h"
  10. class cmExecutionStatus;
  11. class cmInstallCommandArguments;
  12. /** \class cmInstallCommand
  13. * \brief Specifies where to install some files
  14. *
  15. * cmInstallCommand is a general-purpose interface command for
  16. * specifying install rules.
  17. */
  18. class cmInstallCommand : public cmCommand
  19. {
  20. public:
  21. /**
  22. * This is a virtual constructor for the command.
  23. */
  24. std::unique_ptr<cmCommand> Clone() override
  25. {
  26. return cm::make_unique<cmInstallCommand>();
  27. }
  28. /**
  29. * This is called when the command is first encountered in
  30. * the CMakeLists.txt file.
  31. */
  32. bool InitialPass(std::vector<std::string> const& args,
  33. cmExecutionStatus& status) override;
  34. private:
  35. bool HandleScriptMode(std::vector<std::string> const& args);
  36. bool HandleTargetsMode(std::vector<std::string> const& args);
  37. bool HandleFilesMode(std::vector<std::string> const& args);
  38. bool HandleDirectoryMode(std::vector<std::string> const& args);
  39. bool HandleExportMode(std::vector<std::string> const& args);
  40. bool HandleExportAndroidMKMode(std::vector<std::string> const& args);
  41. bool MakeFilesFullPath(const char* modeName,
  42. const std::vector<std::string>& relFiles,
  43. std::vector<std::string>& absFiles);
  44. bool CheckCMP0006(bool& failure);
  45. std::string GetDestination(const cmInstallCommandArguments* args,
  46. const std::string& varName,
  47. const std::string& guess);
  48. std::string GetRuntimeDestination(const cmInstallCommandArguments* args);
  49. std::string GetSbinDestination(const cmInstallCommandArguments* args);
  50. std::string GetArchiveDestination(const cmInstallCommandArguments* args);
  51. std::string GetLibraryDestination(const cmInstallCommandArguments* args);
  52. std::string GetIncludeDestination(const cmInstallCommandArguments* args);
  53. std::string GetSysconfDestination(const cmInstallCommandArguments* args);
  54. std::string GetSharedStateDestination(const cmInstallCommandArguments* args);
  55. std::string GetLocalStateDestination(const cmInstallCommandArguments* args);
  56. std::string GetRunStateDestination(const cmInstallCommandArguments* args);
  57. std::string GetDataRootDestination(const cmInstallCommandArguments* args);
  58. std::string GetDataDestination(const cmInstallCommandArguments* args);
  59. std::string GetInfoDestination(const cmInstallCommandArguments* args);
  60. std::string GetLocaleDestination(const cmInstallCommandArguments* args);
  61. std::string GetManDestination(const cmInstallCommandArguments* args);
  62. std::string GetDocDestination(const cmInstallCommandArguments* args);
  63. std::string GetDestinationForType(const cmInstallCommandArguments* args,
  64. const std::string& type);
  65. std::string DefaultComponentName;
  66. };
  67. #endif