akheron / jansson

C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
Other
3.02k stars 807 forks source link

"jansson_config.h" missing and cannot include the library in cmakelist #652

Open Nonesence999 opened 1 year ago

Nonesence999 commented 1 year ago

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
akheron commented 6 days ago

I'm not an expert in CMake, but would #664 fix this issue, too?

JosiahWI commented 6 days ago

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