-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.cmake.in
44 lines (40 loc) · 1.99 KB
/
config.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@PACKAGE_INIT@
# Support both casing styles
list(APPEND JSONTOOLKIT_COMPONENTS ${JSONToolkit_FIND_COMPONENTS})
list(APPEND JSONTOOLKIT_COMPONENTS ${jsontoolkit_FIND_COMPONENTS})
if(NOT JSONTOOLKIT_COMPONENTS)
list(APPEND JSONTOOLKIT_COMPONENTS uri)
list(APPEND JSONTOOLKIT_COMPONENTS json)
list(APPEND JSONTOOLKIT_COMPONENTS jsonl)
list(APPEND JSONTOOLKIT_COMPONENTS jsonpointer)
list(APPEND JSONTOOLKIT_COMPONENTS jsonschema)
endif()
foreach(component ${JSONTOOLKIT_COMPONENTS})
# TODO: Get rid of this branch once we get rid of uriparser
if(component STREQUAL "uri" OR component STREQUAL "jsonpointer" OR component STREQUAL "jsonschema")
# Locate a vendored uriparser
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../uriparser/uriparser.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/../uriparser/uriparser.cmake")
endif()
endif()
if(component STREQUAL "uri")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_uri.cmake")
elseif(component STREQUAL "json")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake")
elseif(component STREQUAL "jsonl")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_jsonl.cmake")
elseif(component STREQUAL "jsonpointer")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_uri.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_jsonpointer.cmake")
elseif(component STREQUAL "jsonschema")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_uri.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_json.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_jsonpointer.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsontoolkit_jsonschema.cmake")
else()
message(FATAL_ERROR "Unknown JSON Toolkit component: ${component}")
endif()
endforeach()
check_required_components("@PROJECT_NAME@")