[winpr,utils] fix cJSON fallback detection

This commit is contained in:
Armin Novak 2024-05-15 11:37:38 +02:00
parent de49d32004
commit 4bdc9ad950
No known key found for this signature in database
GPG Key ID: 2CF4A2D2D3D72105
1 changed files with 5 additions and 3 deletions

View File

@ -196,7 +196,7 @@ if (NOT WITH_JSON_DISABLED)
# older ubuntu releases did not ship CMake or pkg-config files
# for cJSON. Be optimistic and try pkg-config and as last resort
# try manual detection
if (NOT cJSON_FOUND)
if (NOT CJSON_FOUND)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(CJSON libcjson)
@ -209,6 +209,9 @@ if (NOT WITH_JSON_DISABLED)
find_library(CJSON_LIBRARIES
NAMES cjson
)
if (NOT "${CJSON_LIBRARIES}" EQUAL "CJSON_LIBRARIES-NOTFOUND" AND NOT "${CJSON_INCLUDE_DIRS}" EQUAL "CJSON_INCLUDE_DIRS-NOTFOUND")
set(CJSON_FOUND ON)
endif()
endif()
endif()
@ -216,9 +219,8 @@ if (NOT WITH_JSON_DISABLED)
if (NOT CJSON_FOUND)
message(FATAL_ERROR "cJSON was requested but not found")
endif()
else()
endif()
if (WITH_JSONC_REQUIRED)
find_package(JSONC REQUIRED)
else()