So finally I got it.
for linux users - use cmake. for windows users - you can but I really don't recommend it unless you need cross compiling. Use visual studio: (explained for VS 2017)
First create new project with existing code.
The folder you pick should be "src" (in case of cpp-yaml).
When creating the project you need to choose type of project (exe, dynamic or static library), so choose dynamic library to create .dll or static to create .lib.
After creating your project go to your project properties, go to c/c++ tab --> General --> "additional include directories", and add your path to the headers folder ("include"). Do not add "cpp-yaml" inside the include folder, only "include".
Now build. In the console you can see where the library was created.
To use it, in case you made static library 4 things need to be done:
- add to your project "#include cpp-yaml/yaml.h"
in properties:
- in tab "c/c++" --> General --> "additional include directories", add the include folder path. (as before)
- in tab "Linker" -->Input, add to the "Additional dependencies" your lib name (followed by semi-colon)
- in tab "Linker" --> General, add to "additional library directories" the path to your lib.