aboutsummaryrefslogtreecommitdiff
path: root/build/install/utility
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-31 12:52:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-31 12:52:20 +0200
commitbbd0f3bb21442a2833916110cbe8e9a07e9f4c1f (patch)
treed25de6f2bcfa4b6cabe1fd55a1b8f508005de4c1 /build/install/utility
parent729b56300c441a0d63c7d2013eb5a881211d352b (diff)
Essential install module functionality
Diffstat (limited to 'build/install/utility')
-rw-r--r--build/install/utility36
1 files changed, 36 insertions, 0 deletions
diff --git a/build/install/utility b/build/install/utility
new file mode 100644
index 0000000..5c703fc
--- /dev/null
+++ b/build/install/utility
@@ -0,0 +1,36 @@
+// file : build/install/utility -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD_INSTALL_UTILITY
+#define BUILD_INSTALL_UTILITY
+
+#include <build/scope>
+
+namespace build
+{
+ namespace install
+ {
+ // Set install path, mode for a target type.
+ //
+ template <typename T>
+ inline void
+ path (scope& s, const char* v)
+ {
+ auto p (s.target_vars[T::static_type]["*"].assign ("install"));
+ if (p.second) // Already set by the user?
+ p.first = v;
+ }
+
+ template <typename T>
+ inline void
+ mode (scope& s, const char* v)
+ {
+ auto m (s.target_vars[T::static_type]["*"].assign ("install.mode"));
+ if (m.second) // Already set by the user?
+ m.first = v;
+ }
+ }
+}
+
+#endif // BUILD_INSTALL_UTILITY