From https://github.com/winterheart/aseprite/tree/v1.3.16.1-unbundle
From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
Date: Sun, 10 Jul 2022 19:53:06 +0300
Subject: [PATCH 2/7] Use shared json11 library

Added option -DUSE_SHARED_JSON11
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,6 +67,7 @@ enable_testing()
 option(USE_SHARED_CMARK   "Use your installed copy of cmark" off)
 option(USE_SHARED_CURL    "Use your installed copy of curl" off)
 option(USE_SHARED_GIFLIB  "Use your installed copy of giflib" off)
+option(USE_SHARED_JSON11  "Use your installed copy of json11" off)
 option(USE_SHARED_ZLIB    "Use your installed copy of zlib" off)
 option(USE_SHARED_LIBARCHIVE "Use your installed copy of libarchive" off)
 option(USE_SHARED_LIBPNG  "Use your installed copy of libpng" off)
@@ -335,6 +336,12 @@ include_directories(${GIF_INCLUDE_DIRS})
 # libjpeg-turbo
 find_package(JpegTurbo)
 
+if(USE_SHARED_JSON11)
+  find_package(PkgConfig QUIET)
+  pkg_check_modules(JSON11 json11)
+  include_directories(${JSON11_INCLUDE_DIRS})
+endif()
+
 # cmark
 if(USE_SHARED_CMARK)
   find_library(CMARK_LIBRARIES NAMES cmark)
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -125,7 +125,9 @@ if(NOT USE_SHARED_CMARK)
 endif()
 
 # JSON
-add_subdirectory(json11)
+if(NOT USE_SHARED_JSON11)
+  add_subdirectory(json11)
+endif()
 
 # libarchive
 if(NOT USE_SHARED_LIBARCHIVE)
-- 
2.51.2

