summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallGenerator.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-05-25 20:18:49 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-05-31 12:41:44 (GMT)
commit60e752ced8e9b604591082ee3b21d545fafa8ad8 (patch)
tree86495c940f685d6c777488ffc97aa9c2d93b83ee /Source/cmInstallGenerator.h
parentdd6fd62615ef816f5cbdbd8cd5f827a5cc360464 (diff)
downloadCMake-60e752ced8e9b604591082ee3b21d545fafa8ad8.zip
CMake-60e752ced8e9b604591082ee3b21d545fafa8ad8.tar.gz
CMake-60e752ced8e9b604591082ee3b21d545fafa8ad8.tar.bz2
Refactor: Move common methods into cmInstallGenerator
Diffstat (limited to 'Source/cmInstallGenerator.h')
-rw-r--r--Source/cmInstallGenerator.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index 0117617..97acb88 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -4,6 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <functional>
#include <iosfwd>
#include <string>
#include <vector>
@@ -53,7 +54,7 @@ public:
/** Get the install destination as it should appear in the
installation script. */
- std::string ConvertToAbsoluteDestination(std::string const& dest) const;
+ static std::string ConvertToAbsoluteDestination(std::string const& dest);
/** Test if this generator installs something for a given configuration. */
bool InstallsForConfig(const std::string& config);
@@ -70,12 +71,25 @@ public:
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
+ static std::string GetDestDirPath(std::string const& file);
+
protected:
void GenerateScript(std::ostream& os) override;
std::string CreateComponentTest(const std::string& component,
bool exclude_from_all);
+ using TweakMethod =
+ std::function<void(std::ostream& os, Indent indent,
+ const std::string& config, const std::string& file)>;
+ static void AddTweak(std::ostream& os, Indent indent,
+ const std::string& config, std::string const& file,
+ const TweakMethod& tweak);
+ static void AddTweak(std::ostream& os, Indent indent,
+ const std::string& config, std::string const& dir,
+ std::vector<std::string> const& files,
+ const TweakMethod& tweak);
+
// Information shared by most generator types.
std::string const Destination;
std::string const Component;