cereal
cereal copied to clipboard
[very noob question] how can get cmake cereal "INCLUDE_DIR" definition with find_package(cereal)?
Hi, i want to get the definition "cereal_INCLUDE_DIR" from cmake with find_package(Cereal)
but only got
cereal_DIR:PATH=/usr/share/cmake/cereal
how to get the "INCLUDE_DIR" definition?
sorry for this stupid question, but this drive me crazy
greetings
This is probably better suited for stack overflow or potentially the mailing list. I'm not very well versed in cmake.
I also stumbled upon this question; It seems you are simply supposed to use add_dependencies. Say:
find_package(cereal REQUIRED)
add_dependencies(yourtarget cereal)
Also, since cereal is a header only library and typically installs itself in a sensible directory, you can probably often get away with simply including <cereal/cereal.hpp>. The find_package then only functions to communicate you need to install cereal.
Is this still the recommended way to include cereal? I'm wondering, what folder is one supposed to give to cereal_DIR? It searches for the config.cmake files which don't exist in the source directory.