diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5b43891..247e4ea 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -52,10 +52,7 @@ jobs: cppwg src/ \ --wrapper_root wrapper/ \ --package_info wrapper/package_info.yaml \ - --include src/geometry/ \ - --include src/math_funcs/ \ - --include src/primitives/ \ - --include src/python/ + --includes src/*/ - name: Build Python module run: | diff --git a/README.md b/README.md index 980e258..8245f62 100644 --- a/README.md +++ b/README.md @@ -100,10 +100,7 @@ cd examples/shapes cppwg src/ \ --wrapper_root wrapper/ \ --package_info wrapper/package_info.yaml \ - --include src/geometry/ \ - --include src/math_funcs/ \ - --include src/primitives/ \ - --include src/python/ + --includes src/geometry/ src/math_funcs/ src/primitives/ ``` To build the example package do: diff --git a/cppwg/__main__.py b/cppwg/__main__.py index 2c849fb..d9374b9 100644 --- a/cppwg/__main__.py +++ b/cppwg/__main__.py @@ -53,10 +53,10 @@ def parse_args() -> argparse.Namespace: parser.add_argument( "-i", - "--include", + "--includes", type=str, - action="append", - help="Path to an include directory. Specify multiple times for multiple directories.", + nargs="*", + help="List of paths to include directories.", ) parser.add_argument( @@ -82,7 +82,7 @@ def generate(args: argparse.Namespace) -> None: """ generator = CppWrapperGenerator( source_root=args.source_root, - source_includes=args.include, + source_includes=args.includes, wrapper_root=args.wrapper_root, package_info_path=args.package_info, castxml_binary=args.castxml_binary, diff --git a/tests/test_shapes.py b/tests/test_shapes.py index 3e89056..45ff30b 100644 --- a/tests/test_shapes.py +++ b/tests/test_shapes.py @@ -74,22 +74,22 @@ def test_wrapper_generation(self) -> None: package_info_path = os.path.join(wrapper_root_ref, "package_info.yaml") self.assertTrue(os.path.isfile(package_info_path)) - includes = [] - for dirname in glob(shapes_src + "/*/"): - includes.extend(["--include", dirname]) + includes = glob(shapes_src + "/*/") # Generate the wrappers - call_args = [ - "python", - generate_script, - shapes_src, - "--wrapper_root", - wrapper_root_gen, - "--package_info", - package_info_path, - ] + includes - - subprocess.call(call_args) + subprocess.call( + [ + "python", + generate_script, + shapes_src, + "--wrapper_root", + wrapper_root_gen, + "--package_info", + package_info_path, + "--includes", + ] + + includes + ) self.assertTrue(os.path.isdir(wrapper_root_gen))