diff options
Diffstat (limited to 'build/install/utility')
-rw-r--r-- | build/install/utility | 36 |
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 |