jansson
jansson copied to clipboard
"jansson_config.h" missing and cannot include the library in cmakelist
In jansson.h:
fatal error: jansson_config.h: No such file or directory
15 | #include "jansson_config.h"
| ^~~~~~~~~~~~~~~~~~
Issue whit cmake (I cannot include it) :
add_subdirectory(library/jansson)
target_link_libraries(PORJECT PRIVATE jansson)
#include <jansson.h> -> 'jansson.h' file not found
#include ../library/jansson/src/jansson.h -> working
#include ../cmake-build-debug/library/jansson/include/jansson.h -> working
I'm not an expert in CMake, but would #664 fix this issue, too?
Yes, it would, because it will associate the headers with the target. When you write target_link_libraries(PROJECT PRIVATE jansson) the PUBLIC and INTERFACE dependencies of the jansson target will also become dependencies of the PROJECT target.
https://cmake.org/cmake/help/v3.1/command/target_link_libraries.html