diff --git a/man/man1/fccanalysis-build.1 b/man/man1/fccanalysis-build.1 index a4eea54a8a..31ff552b43 100644 --- a/man/man1/fccanalysis-build.1 +++ b/man/man1/fccanalysis-build.1 @@ -8,6 +8,7 @@ [\fB\-h\fR | \fB\-\-help\fR] [\fB\-c\fR] [\fB\-j\fR \fIBUILD_THREADS\fR] +[\fB\-\-acts\-on\fR] .SH DESCRIPTION .B fccanalysis\-build will build the whole FCCAnalyses framework\&. @@ -25,6 +26,9 @@ Completely clean build directory before compilation\&. .TP \fB\-j\fR \fIBUILD_THREADS\fR, \fB\-\-build\-threads\fR \fIBUILD_THREADS\fR Specify number of threads used when compiling (equivalent to `make -j`) +.TP +\fB\-\-acts\-on\fR +Enable also ACTS based analyzers to be build\&. .SH SEE ALSO fccanalysis(1), fccanalysis\-test(1), cmake(1) .SH BUGS diff --git a/python/build_analysis.py b/python/build_analysis.py index 9eefaf0bce..ef2e4cbb3d 100644 --- a/python/build_analysis.py +++ b/python/build_analysis.py @@ -13,7 +13,7 @@ LOGGER = logging.getLogger('FCCAnalyses.build') -def run_subprocess(command: str, run_dir: str): +def run_subprocess(command: str, run_dir: str) -> None: ''' Run subprocess in specified directory. Check only the return value, otherwise keep the subprocess connected to @@ -32,11 +32,11 @@ def run_subprocess(command: str, run_dir: str): sys.exit(0) -def build_analysis(mainparser): +def build_analysis(mainparser) -> None: ''' Main build steering function ''' - args, _ = mainparser.parse_known_args() + args = mainparser.parse_args() if 'LOCAL_DIR' not in os.environ: LOGGER.error('FCCAnalyses environment not set up correctly!\n' @@ -46,9 +46,14 @@ def build_analysis(mainparser): local_dir = os.environ.get('LOCAL_DIR') build_path = pathlib.Path(local_dir + '/build') install_path = pathlib.Path(local_dir + '/install') + cmake_args = ['-DCMAKE_INSTALL_PREFIX=../install'] LOGGER.info('Building analysis located in:\n%s', local_dir) + if args.acts_on: + LOGGER.info('Building also ACTS based analyzers...') + cmake_args += ['-DWITH_ACTS=ON'] + if args.clean_build: LOGGER.info('Clearing build and install directories...') if build_path.is_dir(): @@ -60,7 +65,7 @@ def build_analysis(mainparser): LOGGER.info('Creating build directory...') os.makedirs(build_path) - run_subprocess(['cmake', '-DCMAKE_INSTALL_PREFIX=../install', '..'], + run_subprocess(['cmake'] + cmake_args + ['..'], local_dir + '/build') if not install_path.is_dir(): diff --git a/python/parsers.py b/python/parsers.py index 5815c79306..c0915ef777 100644 --- a/python/parsers.py +++ b/python/parsers.py @@ -47,6 +47,10 @@ def setup_build_parser(parser): default=1, help='number of threads when building (equivalent to `make -j`)' ) + build_args.add_argument('--acts-on', + action='store_true', + default=False, + help='enable ACTS based analyzers') def setup_test_parser(parser):