diff options
author | sanine <sanine.not@pm.me> | 2022-08-24 00:02:17 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-08-24 00:02:17 -0500 |
commit | 2cb3c3df4099297b0a0554bb482e2de04fe86b5c (patch) | |
tree | 7796b4064c16460d9d603707b5256027649aa8b6 /libs/cargs/docs/build.md | |
parent | 709e1b6e1ce86f8da4fc136747fcefbc6c6057bd (diff) |
add command-line arguments
Diffstat (limited to 'libs/cargs/docs/build.md')
-rw-r--r-- | libs/cargs/docs/build.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libs/cargs/docs/build.md b/libs/cargs/docs/build.md new file mode 100644 index 0000000..599c114 --- /dev/null +++ b/libs/cargs/docs/build.md @@ -0,0 +1,49 @@ +--- +title: Building +description: A guide on how to build the cargs command line arguments parser library for C/C++. +--- + +In order to build the source, you will have to download it. You can do so using git (or download it from [here](https://github.com/likle/cargs/archive/stable.zip)). +```bash +git clone -b stable git@github.com:likle/cargs.git +``` + +**Note**: The *stable* branch points to the latest stable version. You should +always use a stable version in production code. + +## Using Windows +Visual Studio 2017 is recommended, then you can just open the source using ``File -> Open -> CMake...``. You can use Visual Studio to compile the source and debug the code. Make sure you have the CMake and C/C++ features enabled. + +## Using Ubuntu +You will need [CMake](https://cmake.org/download/) and either gcc or clang installed. On Ubuntu you can use the following to compile **cargs**: +```bash +sudo apt-get install build-essential cmake +mkdir cargs/build +cd cargs/build +cmake .. +make +``` + +## Using MacOS +You will need [CMake](https://cmake.org/download/) and either gcc or clang installed. On MacOS you can use the following to compile **cargs**: +``` +brew install cmake gcc +mkdir cargs/build +cd cargs/build +cmake .. +make +``` +# Running Tests +After building **cargs** you can run tests to ensure everything is fine. In order to do that, make sure that you are in the build folder and then execute the test program: + +```bash +./cargstest +``` + +That's it! + +You can even specify which tests to execute by optionally specifying the category and test name: +```bash +# ./cargstest [category] [test] +./cargstest option complex +``` |