This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8c9c21
commit 2e826e2
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# FindJsonC.cmake | ||
# Defines: | ||
# JSONC_FOUND - System has json-c | ||
# JSONC_INCLUDE_DIRS - json-c include directories | ||
# JSONC_LIBRARY - json-c library | ||
# JsonC::JsonC - Imported target | ||
|
||
find_path(JSONC_INCLUDE_DIRS | ||
NAMES json-c/json.h | ||
PATHS ${JSONC_ROOT_DIR} | ||
PATH_SUFFIXES include | ||
) | ||
|
||
find_library(JSONC_LIBRARY | ||
NAMES json-c | ||
PATHS ${JSONC_ROOT_DIR} | ||
PATH_SUFFIXES lib lib64 | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(JsonC | ||
REQUIRED_VARS JSONC_LIBRARY JSONC_INCLUDE_DIRS | ||
) | ||
|
||
if(JsonC_FOUND AND NOT TARGET JsonC::JsonC) | ||
add_library(JsonC::JsonC UNKNOWN IMPORTED) | ||
set_target_properties(JsonC::JsonC PROPERTIES | ||
IMPORTED_LOCATION "${JSONC_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${JSONC_INCLUDE_DIRS}" | ||
) | ||
endif() | ||
|
||
mark_as_advanced(JSONC_INCLUDE_DIRS JSONC_LIBRARY) |