|
| 1 | +# If not stated otherwise in this file or this component's LICENSE file the |
| 2 | +# following copyright and licenses apply: |
| 3 | +# |
| 4 | +# Copyright 2020 Metrological |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | + |
| 18 | +project(JsonRpcMuxer) |
| 19 | + |
| 20 | +cmake_minimum_required(VERSION 3.15) |
| 21 | + |
| 22 | +find_package(Thunder) |
| 23 | + |
| 24 | +project_version(1.0.0) |
| 25 | + |
| 26 | +set(MODULE_NAME ${NAMESPACE}${PROJECT_NAME}) |
| 27 | + |
| 28 | +message("Setup ${MODULE_NAME} v${PROJECT_VERSION}") |
| 29 | + |
| 30 | +set(PLUGIN_JSONRPCMUXER_STARTMODE "Activated" CACHE STRING "Automatically start JsonRpcMuxer plugin") |
| 31 | +set(PLUGIN_JSONRPCMUXER_MAX_CONCURRENT_JOBS 0 CACHE STRING "Maximum number of concurrent WorkerPool jobs") |
| 32 | +set(PLUGIN_JSONRPCMUXER_MAX_BATCH_SIZE 0 CACHE STRING "Maximum requests per batch") |
| 33 | + |
| 34 | +if(BUILD_REFERENCE) |
| 35 | + add_definitions(-DBUILD_REFERENCE=${BUILD_REFERENCE}) |
| 36 | +endif() |
| 37 | + |
| 38 | +find_package(${NAMESPACE}Plugins REQUIRED) |
| 39 | +find_package(CompileSettingsDebug CONFIG REQUIRED) |
| 40 | + |
| 41 | +add_library(${MODULE_NAME} SHARED |
| 42 | + JsonRpcMuxer.cpp |
| 43 | + Module.cpp) |
| 44 | + |
| 45 | +target_compile_definitions(${MODULE_NAME} PRIVATE |
| 46 | + PLUGIN_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} |
| 47 | + PLUGIN_VERSION_MINOR=${PROJECT_VERSION_MINOR} |
| 48 | + PLUGIN_VERSION_PATCH=${PROJECT_VERSION_PATCH} |
| 49 | +) |
| 50 | + |
| 51 | +set_target_properties(${MODULE_NAME} PROPERTIES |
| 52 | + CXX_STANDARD 11 |
| 53 | + CXX_STANDARD_REQUIRED YES) |
| 54 | + |
| 55 | +target_link_libraries(${MODULE_NAME} |
| 56 | + PRIVATE |
| 57 | + CompileSettingsDebug::CompileSettingsDebug |
| 58 | + ${NAMESPACE}Plugins::${NAMESPACE}Plugins) |
| 59 | + |
| 60 | +install(TARGETS ${MODULE_NAME} |
| 61 | + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${STORAGE_DIRECTORY}/plugins COMPONENT ${NAMESPACE}_Runtime) |
| 62 | + |
| 63 | +write_config() |
0 commit comments