From 45d5d6da1bc126a6fb5995545a4ae78d018bf753 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 29 Mar 2020 13:11:56 +0000 Subject: fix READMEs, code style, etc. --- project/cmake/README.md | 5 ++--- project/cmake/build.py | 15 ++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'project/cmake') diff --git a/project/cmake/README.md b/project/cmake/README.md index b63564d..7a488d9 100644 --- a/project/cmake/README.md +++ b/project/cmake/README.md @@ -2,12 +2,11 @@ CMake ===== Build a CMake project. -Consult the output of `build.py --help` for details. A simple usage example: - > python3 build.py --configuration Release --install path/to/somewhere -- ../examples/simple + $ python3 -m project.cmake.build --configuration Release --install path/to/somewhere -- examples/simple ... - > ./path/to/somewhere/bin/foo + $ ./path/to/somewhere/bin/foo foo diff --git a/project/cmake/build.py b/project/cmake/build.py index 77242ec..b15badd 100644 --- a/project/cmake/build.py +++ b/project/cmake/build.py @@ -14,7 +14,7 @@ but written in bash and PowerShell, respectively). A simple usage example: - $ %(prog)s --configuration Release --install path/to/somewhere -- ../examples/simple + $ python -m project.cmake.build --configuration Release --install path/to/somewhere -- examples/simple ... $ ./path/to/somewhere/bin/foo @@ -23,13 +23,13 @@ A simple usage example: Picking the target platform is build system-specific. On Visual Studio, pass the target platform using the `-A` flag like this: - > %(prog)s --install path\to\somewhere -- ..\examples\simple -A Win32 + > python -m project.cmake.build --install path\to\somewhere -- examples\simple -A Win32 ... Using GCC-like compilers, the best way is to use CMake toolchain files (see -cmake/toolchains in this repository for examples). +toolchains/cmake in this repository for examples). - $ %(prog)s --install path/to/somewhere -- ../examples/simple -D CMAKE_TOOLCHAIN_FILE="$( pwd )/../toolchains/mingw-x86.cmake" + $ python -m project.cmake.build --install path/to/somewhere -- examples/simple -D CMAKE_TOOLCHAIN_FILE="$( pwd )/toolchains/mingw-x86.cmake" ... ''' @@ -157,10 +157,11 @@ def _parse_args(argv=None): parser.add_argument('src_dir', metavar='DIR', type=project.utils.normalize_path, help='source directory') - parser.add_argument('cmake_args', nargs='*', metavar='CMAKE_ARG', + parser.add_argument('cmake_args', metavar='CMAKE_ARG', + nargs='*', default=[], help='additional CMake arguments, to be passed verbatim') - args = parser.parse_args(argv) - return args + + return parser.parse_args(argv) def main(argv=None): -- cgit v1.2.3