From bbd0f3bb21442a2833916110cbe8e9a07e9f4c1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Jul 2015 12:52:20 +0200 Subject: Essential install module functionality --- build/install/utility | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 build/install/utility (limited to 'build/install/utility') 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 + +namespace build +{ + namespace install + { + // Set install path, mode for a target type. + // + template + 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 + 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 -- cgit v1.1