-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
128 lines (106 loc) · 3.88 KB
/
CMakeLists.txt
File metadata and controls
128 lines (106 loc) · 3.88 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
cmake_minimum_required(VERSION 3.5.0)
project(qore-json-module)
set (VERSION_MAJOR 1)
set (VERSION_MINOR 11)
set (VERSION_PATCH 0)
find_package(Qore 2.0 REQUIRED)
find_package(OpenSSL REQUIRED)
include_directories( ${CMAKE_SOURCE_DIR}/src )
include_directories( ${OPENSSL_INCLUDE_DIR} )
# Find jsoncons (required for JSON Schema support)
find_path(JSONCONS_INCLUDE_DIR jsoncons/json.hpp
PATHS
/usr/include
/usr/local/include
${CMAKE_SOURCE_DIR}/third-party/jsoncons/include
)
if(NOT JSONCONS_INCLUDE_DIR)
if(EXISTS "${CMAKE_SOURCE_DIR}/third-party/jsoncons/include")
set(JSONCONS_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/third-party/jsoncons/include")
message(STATUS "Using bundled jsoncons")
else()
message(FATAL_ERROR "jsoncons not found. Please install jsoncons or initialize the submodule: git submodule update --init")
endif()
else()
message(STATUS "Found jsoncons: ${JSONCONS_INCLUDE_DIR}")
endif()
include_directories(${JSONCONS_INCLUDE_DIR})
set(QPP_SRC
src/QC_JsonRpcClient.qpp
src/QC_JsonSaxParser.qpp
src/QC_JsonSchema.qpp
src/QC_JsonStreamWriter.qpp
src/ql_json.qpp
src/ql_cbor.qpp
)
set(CPP_SRC
src/json-module.cpp
src/JsonSchemaImpl.cpp
src/JsonStreamReadHandler.cpp
)
set(QMOD
qlib/JsonRpcHandler.qm
qlib/JsonRpcConnection.qm
qlib/JsonRpcClientIo
qlib/McpServerHandler
qlib/McpClient
qlib/McpClientDataProvider
qlib/A2aClient
qlib/A2aServerHandler
qlib/A2aClientDataProvider
qlib/NdjsonDataProvider
qlib/JsonFileDataProvider
qlib/JsonLd
qlib/OneRecordClient
qlib/OneRecordServerHandler
)
# Check for C++11.
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
qore_wrap_qpp_value(QPP_SOURCES METALIST QPP_META_SOURCES ${QPP_SRC})
SET (module_name "json")
set(QORE_DOX_TMPL_SRC
docs/mainpage.doxygen.tmpl
)
add_library(${module_name} MODULE ${CPP_SRC} ${QPP_SOURCES} ${CPP_SRC})
if (WIN32 AND MINGW AND MSYS)
target_compile_definitions(${module_name} PUBLIC BUILDING_DLL)
endif (WIN32 AND MINGW AND MSYS)
if (DEFINED ENV{DOXYGEN_EXECUTABLE})
set(DOXYGEN_EXECUTABLE $ENV{DOXYGEN_EXECUTABLE})
endif()
qore_external_binary_module(${module_name} "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
qore_dist("${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
qore_user_modules("${QMOD}")
qore_external_user_module("qlib/JsonRpcConnection.qm" "JsonRpcClientIo")
qore_external_user_module("qlib/JsonRpcHandler.qm" "")
qore_external_user_module("qlib/JsonRpcClientIo" "")
qore_external_user_module("qlib/McpServerHandler" "JsonRpcHandler")
qore_external_user_module("qlib/McpClient" "")
qore_external_user_module("qlib/McpClientDataProvider" "McpClient")
qore_external_user_module("qlib/A2aClient" "")
qore_external_user_module("qlib/A2aServerHandler" "JsonRpcHandler;A2aClient")
qore_external_user_module("qlib/A2aClientDataProvider" "A2aClient")
qore_external_user_module("qlib/NdjsonDataProvider" "")
qore_external_user_module("qlib/JsonFileDataProvider" "")
qore_external_user_module("qlib/JsonLd" "")
qore_external_user_module("qlib/OneRecordClient" "JsonLd")
qore_external_user_module("qlib/OneRecordServerHandler" "OneRecordClient;JsonLd")
# install qpp metadata files
if (COMMAND qore_install_qpp_metadata)
qore_install_qpp_metadata(${module_name} ${QPP_META_SOURCES})
else()
install(FILES ${QPP_META_SOURCES}
DESTINATION ${CMAKE_INSTALL_DATADIR}/qore/metadata)
endif()
qore_config_info()
if (DOXYGEN_FOUND)
qore_wrap_dox(QORE_DOX_SRC ${QORE_DOX_TMPL_SRC})
add_custom_target(QORE_MOD_DOX_FILES DEPENDS ${QORE_DOX_SRC})
add_dependencies(docs-module QORE_MOD_DOX_FILES)
endif()