File 0006-use-system-libcjson.patch of Package CodeLite

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d99327f5c..84c698d0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,6 +146,9 @@ if(NOT FLEX_FOUND)
   endif()
 endif()
 
+find_package(cJSON REQUIRED)
+include_directories(${CJSON_INCLUDE_DIRS}/cjson)
+
 set(IS_FREEBSD 0)
 if(CMAKE_SYSTEM_NAME MATCHES "^.*BSD$|DragonFly")
   set(IS_FREEBSD 1)
@@ -880,7 +883,7 @@ add_compile_options(-Wno-overloaded-virtual)
 add_subdirectory(submodules/lexilla)
 
 add_subdirectory(submodules)
-include_directories(submodules/cJSON)
+#include_directories(submodules/cJSON)
 
 add_subdirectory(sdk/wxsqlite3)
 add_subdirectory(sdk/databaselayer)
diff --git a/CodeLite/CMakeLists.txt b/CodeLite/CMakeLists.txt
index 9a93764db..78c640013 100644
--- a/CodeLite/CMakeLists.txt
+++ b/CodeLite/CMakeLists.txt
@@ -98,7 +98,7 @@ target_link_libraries(
   ${GTK_LIBS}
   ${ADDITIONAL_LIBRARIES}
   ${LIBUCHARDET_LIB}
-  cJSON)
+  ${CJSON_LIBRARIES})
 
 if(MINGW)
   set_target_properties(
diff --git a/submodules/CMakeLists.txt b/submodules/CMakeLists.txt
index d96595431..58f14b2f3 100644
--- a/submodules/CMakeLists.txt
+++ b/submodules/CMakeLists.txt
@@ -12,8 +12,8 @@ endif()
 # ######################################################################################################################
 # cJSON
 # ######################################################################################################################
-add_library(cJSON STATIC ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.c ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.h)
-target_include_directories(cJSON PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/cJSON)
+#add_library(cJSON STATIC ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.c ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.h)
+#target_include_directories(cJSON PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/cJSON)
 
 # ######################################################################################################################
 # For wxWidgets dependencies
Submodule submodules/wxdap contains modified content
diff --git a/submodules/wxdap/dap/cJSON.hpp b/submodules/wxdap/dap/cJSON.hpp
index e130918..610c690 100644
--- a/submodules/wxdap/dap/cJSON.hpp
+++ b/submodules/wxdap/dap/cJSON.hpp
@@ -118,10 +118,10 @@ WXDLLIMPEXP_DAP void cJSON_DeleteItemFromObject(cJsonDap* object, const char* st
 WXDLLIMPEXP_DAP void cJSON_ReplaceItemInArray(cJsonDap* array, int which, cJsonDap* newitem);
 WXDLLIMPEXP_DAP void cJSON_ReplaceItemInObject(cJsonDap* object, const char* string, cJsonDap* newitem);
 
-#define cJSON_AddNullToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
-#define cJSON_AddTrueToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
-#define cJSON_AddFalseToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
-#define cJSON_AddNumberToObject(object, name, n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
-#define cJSON_AddStringToObject(object, name, s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
+//#define cJSON_AddNullToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
+//#define cJSON_AddTrueToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
+//#define cJSON_AddFalseToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
+//#define cJSON_AddNumberToObject(object, name, n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
+//#define cJSON_AddStringToObject(object, name, s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
 }; // namespace dap
 #endif
diff --git a/wxcrafter/CMakeLists.txt b/wxcrafter/CMakeLists.txt
index 2fcef4c6b..8ee2886c6 100644
--- a/wxcrafter/CMakeLists.txt
+++ b/wxcrafter/CMakeLists.txt
@@ -97,7 +97,7 @@ if(UNIX OR APPLE)
     set_target_properties(wxcLib PROPERTIES POSITION_INDEPENDENT_CODE ON)
 endif()
 
-target_link_libraries(wxcLib PUBLIC cJSON)
+target_link_libraries(wxcLib PUBLIC ${CJSON_LIBRARIES})
 
 set(RES_FILE "")
 # Define the output
openSUSE Build Service is sponsored by