From 9fbb0b8d298fc503280599f6332b80ec10c2ab0c Mon Sep 17 00:00:00 2001 From: ZtRXR Date: Fri, 12 Apr 2024 23:59:18 +0800 Subject: [PATCH] update --- .gitignore | 8 +++++++- pymake/__main__.py | 9 +++++++++ pymake/lib/tools.py | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 pymake/__main__.py diff --git a/.gitignore b/.gitignore index fee0fbb..2eb1730 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,10 @@ # Ignore all __pycache__ directories in the project __pycache__/ -/.vscode \ No newline at end of file +/.vscode + +/CMakeLists.txt + +/main.cxx + +/build \ No newline at end of file diff --git a/pymake/__main__.py b/pymake/__main__.py new file mode 100644 index 0000000..09708a4 --- /dev/null +++ b/pymake/__main__.py @@ -0,0 +1,9 @@ +from . import * + +( + cmake("3.5") + .project("test") + .file("SRC",glob_recurse,"*.cxx") + .add_executable(var(project_name),var("SRC")) + .write() +) \ No newline at end of file diff --git a/pymake/lib/tools.py b/pymake/lib/tools.py index 5704240..eb957da 100644 --- a/pymake/lib/tools.py +++ b/pymake/lib/tools.py @@ -1,7 +1,8 @@ -def var(name:"str")->"str": +from typing import * +def var(name:str)->str: return f"${{{name}}}" -def args_to_str(args:"list[str]")->str: +def args_to_str(args:list[str])->str: vars_str = "" for i in args: vars_str=f"{vars_str} {i}"