[cmake] fallback cJSON detection

This commit is contained in:
akallabeth 2024-01-29 09:12:08 +01:00 committed by akallabeth
parent 4f2d9ac313
commit 2cd64ba424

View File

@ -259,9 +259,18 @@ endif()
if (WITH_AAD)
if (NOT cJSON_FOUND)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CJSON REQUIRED libcjson)
pkg_check_modules(CJSON libcjson)
endif()
if (NOT CJSON_LIBRARIES OR NOT CJSON_INCLUDE_DIRS)
find_path(CJSON_INCLUDE_DIRS
NAMES cjson/cJSON.h
REQUIRED
)
find_library(CJSON_LIBRARIES
NAMES cjson
REQUIRED
)
endif()
include_directories(${CJSON_INCLUDE_DIRS})
freerdp_library_add(${CJSON_LIBRARIES})
include_directories(${CJSON_INCLUDE_DIRS})