Skip to content

Commit 71cc491

Browse files
author
Fytch
committed
README: expound integration with git and CMake
1 parent 13f95d0 commit 71cc491

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,27 @@ Using this sample is only recommended if you are already somewhat familiar with
6464
<sup>1</sup> Note that `-version` (with only a single hyphen) would be interpreted as the option `-v` with the argument `ersion`.
6565

6666
## Integration
67-
*ProgramOptions.hxx* is very easy to integrate. After downloading the header file, all that it takes is a simple:
67+
*ProgramOptions.hxx* is very easy to integrate. After downloading the header file from the ```include``` folder and putting it into your project folder, all it takes is a simple:
6868
```cpp
6969
#include "ProgramOptions.hxx"
7070
```
7171
Don't forget to compile with C++11 enabled, i.e. with `-std=c++11`.
7272

73+
### git
74+
If you want to integrate *ProgramOptions.hxx* into your project that uses [git](https://git-scm.com/), you can write:
75+
```
76+
git submodule add https://github.com/Fytch/ProgramOptions.hxx third_party/ProgramOptions.hxx
77+
```
78+
You may replace ```third_party/ProgramOptions.hxx``` by any path.
79+
80+
### CMake
81+
If you want to integrate *ProgramOptions.hxx* into your project that uses [CMake](https://cmake.org/), add the following to your ```CMakeLists.txt```:
82+
```cmake
83+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/third_party/ProgramOptions.hxx")
84+
target_link_libraries(YourExecutable ProgramOptionsHxx)
85+
```
86+
You must replace ```/third_party/ProgramOptions.hxx``` by the correct path and ```YourExecutable``` by the targets that use *ProgramOptions.hxx*.
87+
7388
## Usage
7489
Using *ProgramOptions.hxx* is straightforward; we'll explain it by means of practical examples. All examples shown here and more can be found in the [/examples](examples) directory, all of which are well-documented.
7590

0 commit comments

Comments
 (0)