The cmake logic is wrong (E.G. PKG_CHECK_FOR_MODULES fails unless all
modules are found), and the legacy libjson.so name is also used by the
other libjson (for example [1]) which provides an incompatible API,
so just drop it.
Backported from libubox
cbf80de7f4df61960f386cb01a899cf4228d38f3
[1] http://sourceforge.net/projects/libjson/
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
[ wrapped commit description to 75 char limit ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,--gc-sections")
ENDIF()
-find_library(json NAMES json-c json)
-
IF(DEBUG)
ADD_DEFINITIONS(-DDEBUG -g3)
ENDIF()
INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(JSONC json-c json)
+PKG_CHECK_MODULES(JSONC json-c)
IF(JSONC_FOUND)
ADD_DEFINITIONS(-DJSONC)
INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
SET_PROPERTY(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "lemon;parser.h;parser.out")
SET_SOURCE_FILES_PROPERTIES("parser.c" PROPERTIES GENERATED TRUE)
ADD_EXECUTABLE(jsonpath main.c ast.c lexer.c parser.c matcher.c)
+find_library(json NAMES json-c)
TARGET_LINK_LIBRARIES(jsonpath ubox ${json})
INSTALL(TARGETS jsonpath RUNTIME DESTINATION bin)