Update README with CMake instructions

This commit is contained in:
Haowen Liu 2025-05-04 10:24:45 -04:00
parent 7b63681cc2
commit 0003cac2f1
No known key found for this signature in database
GPG Key ID: F65B4067F3357C78

View File

@ -22,7 +22,7 @@ and they will be fixed as they are reported.
Subprocess library has just a single source `subprocess.hpp` present at the top directory of this repository. All you need to do is add Subprocess library has just a single source `subprocess.hpp` present at the top directory of this repository. All you need to do is add
```cpp ```cpp
#inlcude "cpp-subprocess/subprocess.hpp" #include "cpp-subprocess/subprocess.hpp"
using namespace subprocess; using namespace subprocess;
// OR // OR
@ -33,6 +33,20 @@ to the files where you want to make use of subprocessing. Make sure to add neces
Checkout http://templated-thoughts.blogspot.in/2016/03/sub-processing-with-modern-c.html as well. Checkout http://templated-thoughts.blogspot.in/2016/03/sub-processing-with-modern-c.html as well.
## CMake Projects
```cmake
include(FetchContent)
FetchContent_Declare(
cpp-subprocess
GIT_REPOSITORY https://github.com/arun11299/cpp-subprocess.git
GIT_TAG v2.2
)
FetchContent_MakeAvailable(cpp-subprocess)
target_link_libraries(<your_target> PRIVATE cpp-subprocess::subprocess)
```
## Compiler Support ## Compiler Support
Linux - g++ 4.8 and above Linux - g++ 4.8 and above
Mac OS - Clang 3.4 and later Mac OS - Clang 3.4 and later