diff --git a/init.py b/init.py index 09ba8e9..de40cf8 100755 --- a/init.py +++ b/init.py @@ -50,6 +50,13 @@ def split_all_path(path): if __name__ == '__main__': + self_path = os.path.realpath(__file__) + self_dir = os.path.dirname(self_path) + + build_dir = os.path.realpath(os.getcwd()) + + source_dir = os.path.dirname(self_dir) + accumulated = [] components = [''] @@ -65,4 +72,4 @@ if __name__ == '__main__': accumulated += [f'"-D{key}={val}"' for key, val in vars.items()] accumulated += args - print("cmake ../../../ " + " ".join(accumulated)) + print(f"cmake {source_dir} {' '.join(accumulated)}")