aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project/ci/cmake.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-01-18 15:32:28 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-01-18 20:51:19 +0300
commitca3ac59b71a1d613f7d978f12d9593f68b7ee907 (patch)
tree79a02e4d3c3e657040b39b0df1eab796a86fbff4 /project/ci/cmake.py
parentproject.ci: --install picks the directory automatically (diff)
downloadcmake-common-ca3ac59b71a1d613f7d978f12d9593f68b7ee907.tar.gz
cmake-common-ca3ac59b71a1d613f7d978f12d9593f68b7ee907.zip
project.ci: add GitHub Actions
Diffstat (limited to 'project/ci/cmake.py')
-rw-r--r--project/ci/cmake.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/project/ci/cmake.py b/project/ci/cmake.py
index 67ad13a..262aafa 100644
--- a/project/ci/cmake.py
+++ b/project/ci/cmake.py
@@ -5,6 +5,7 @@
import argparse
import logging
+import os.path
import sys
from project.cmake.build import BuildParameters, build
@@ -27,6 +28,8 @@ def _parse_args(dirs, argv=None):
parser.add_argument('--toolset', metavar='TOOLSET',
type=ToolchainType.parse,
help='toolset to use')
+ parser.add_argument('--subdir', metavar='DIR',
+ help='relative project directory path')
parser.add_argument('cmake_args', nargs='*', metavar='CMAKE_ARG', default=[],
help='additional CMake arguments, to be passed verbatim')
return parser.parse_args(argv)
@@ -35,8 +38,11 @@ def _parse_args(dirs, argv=None):
def build_ci(dirs, argv=None):
args = _parse_args(dirs, argv)
+ src_dir = dirs.get_src_dir()
+ if args.subdir:
+ src_dir = os.path.join(src_dir, args.subdir)
install_dir = dirs.get_install_dir() if args.install else None
- params = BuildParameters(dirs.get_src_dir(),
+ params = BuildParameters(src_dir,
build_dir=dirs.get_cmake_dir(),
install_dir=install_dir,
platform=dirs.get_platform(),