From 00d21c8d6d202375761f332084e01661241376a9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 18 Jan 2021 14:39:19 +0300 Subject: project.ci: --install picks the directory automatically --- project/ci/cmake.py | 7 ++++--- project/ci/dirs.py | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'project') diff --git a/project/ci/cmake.py b/project/ci/cmake.py index 2f801de..67ad13a 100644 --- a/project/ci/cmake.py +++ b/project/ci/cmake.py @@ -20,8 +20,8 @@ def _parse_args(dirs, argv=None): description=dirs.get_cmake_help(), formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('--install', metavar='DIR', dest='install_dir', - help='install directory') + parser.add_argument('--install', action='store_true', + help='install the project') parser.add_argument('--boost', metavar='DIR', dest='boost_dir', help='set Boost directory path') parser.add_argument('--toolset', metavar='TOOLSET', @@ -35,9 +35,10 @@ def _parse_args(dirs, argv=None): def build_ci(dirs, argv=None): args = _parse_args(dirs, argv) + install_dir = dirs.get_install_dir() if args.install else None params = BuildParameters(dirs.get_src_dir(), build_dir=dirs.get_cmake_dir(), - install_dir=args.install_dir, + install_dir=install_dir, platform=dirs.get_platform(), configuration=dirs.get_configuration(), boost_dir=args.boost_dir or dirs.get_boost_dir(), diff --git a/project/ci/dirs.py b/project/ci/dirs.py index 5bfedda..4e61015 100644 --- a/project/ci/dirs.py +++ b/project/ci/dirs.py @@ -42,6 +42,9 @@ class Dirs(abc.ABC): def get_cmake_dir(self): return os.path.join(self.get_build_dir(), 'build') + def get_install_dir(self): + return os.path.join(self.get_build_dir(), 'install') + @abc.abstractmethod def get_cmake_args(self): pass @@ -61,7 +64,7 @@ Boost is built in {self.get_boost_dir()}. This is similar to running project.cmake.build, but auto-fills some parameters from environment variables. -The project is built in {self.get_cmake_dir()}. +The project is built in {self.get_cmake_dir()} and installed to {self.get_install_dir()}. ''' -- cgit v1.2.3