I want to use the following library https://github.com/gmeuli/caterpillar
It's documentation says that it's a header-only library, and that I should "directly integrate it into my source files with #include <caterpillar/caterpillar.h>
." It also depends on a few other libraries, one of which I need to use directly as well.
So far I have done the following:
- create cmake project to make an 'executable' (with the vscode extension)
- created a 'lib' folder, inside which I did
git clone https://github.com/gmeuli/caterpillar
- Then, I did
include_directories(lib)
in my cmake file. - But
#include <caterpillar/caterpillar.h>
doesn't quite work in my singularmain.cpp
file.
I played around with various CMake functions, and it either gave the error "No such file or directory" regarding caterpillar/caterpillar.h
itself, or it gave "cannot open source file... dependent of caterpillar/caterpillar.h" depending on how I messed with the cmake file.
For reference:
cat ~/project/main.cpp
#include <caterpillar/caterpillar.hpp>
#include <lorina/lorina.hpp> //how do I include this ? it's in the lib folder of caterpillar itself, or do I need to have a copy of it in my lib folder too
int main()
{
// stuff in lorina:: namespace
// stuff in caterpillar:: namespace
return 0;
}
cat ~/project/CMakeLists.txt
include_directories(lib)
//... rest is stuff like CXX standard, etc etc
tree ~/project
main.cpp
lib/
caterpillar/
build/
cmake generated stuff
CMakeLists.txt