|
@@ -1,14 +1,29 @@
|
|
|
|
|
|
if(NOT JSON_FOUND)
|
|
|
+find_path(JSON_INCLUDE_DIR NAMES json_c_version.h json.h PATHS /usr/include/json-c /usr/include/json)
|
|
|
+find_library(JSON_LIBRARY NAMES json-c json)
|
|
|
|
|
|
+include(FindPackageHandleStandardArgs)
|
|
|
+find_package_handle_standard_args(JSON DEFAULT_MSG
|
|
|
+ JSON_LIBRARY JSON_INCLUDE_DIR
|
|
|
+ )
|
|
|
+
|
|
|
+if(JSON_FOUND)
|
|
|
+ set(JSON_LIBRARIES ${JSON_LIBRARY})
|
|
|
+ set(JSON_INCLUDE_DIRS ${JSON_INCLUDE_DIR})
|
|
|
+endif()
|
|
|
find_package(jsoncpp REQUIRED)
|
|
|
link_libraries(${JSONCPP_LIBRARIES})
|
|
|
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp/lib)
|
|
|
-# target_link_libraries(data_publish paho-mqtt3a paho-mqttpp3)
|
|
|
-#target_link_libraries(data_publish PahoMqttCpp::paho-mqttpp3)
|
|
|
+
|
|
|
find_path(Jsoncpp_INCLUDE_DIR
|
|
|
NAMES json/features.h
|
|
|
PATH_SUFFIXES jsoncpp
|
|
|
PATHS ${Jsoncpp_PKGCONF_INCLUDE_DIRS} # /usr/include/jsoncpp/json
|
|
|
)
|
|
|
+mark_as_advanced(
|
|
|
+ JSON_LIBRARY
|
|
|
+ JSON_INCLUDE_DIRS
|
|
|
+)
|
|
|
+
|
|
|
endif(NOT JSON_FOUND)
|