|
1 | 1 | # External library definitions to support remote delegates. Update the options |
2 | 2 | # below based on the target build platform. |
3 | 3 |
|
4 | | -# Modify the options below for your target platform external libraries. |
5 | | - |
6 | | -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") |
7 | | - message(STATUS "Building on Windows") |
8 | | - |
9 | | - # TODO: Update to installed library version |
10 | | - set(ZMQ_LIB_NAME "libzmq-mt-4_3_5.lib") |
11 | | - |
12 | | - # Set path to the vcpkg directory for support libraries (zmq.h) |
13 | | - set(VCPKG_ROOT_DIR "${DMQ_ROOT_DIR}/../../../vcpkg/installed/x64-windows") |
14 | | -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
15 | | - message(STATUS "Building on Linux") |
16 | | - set(ZMQ_LIB_NAME "libzmq.a") |
17 | | - set(VCPKG_ROOT_DIR "${DMQ_ROOT_DIR}/../../../vcpkg/installed/x64-linux") |
18 | | - |
19 | | -else() |
20 | | - message(FATAL_ERROR "Select directories based on build platform.") |
21 | | -endif() |
22 | | - |
23 | | -if(NOT EXISTS "${VCPKG_ROOT_DIR}") |
24 | | - message(FATAL_ERROR "${VCPKG_ROOT_DIR} Directory does not exist. Update VCPKG_ROOT_DIR to the correct directory.") |
25 | | -endif() |
26 | | - |
27 | | -# Set ZeroMQ library file name and directory |
| 4 | +# ZeroMQ library package |
28 | 5 | # https://github.com/zeromq |
29 | | -set(ZMQ_LIB_DIR "${VCPKG_ROOT_DIR}/lib") |
30 | | -if (NOT EXISTS "${ZMQ_LIB_DIR}/${ZMQ_LIB_NAME}") |
31 | | - message(FATAL_ERROR "Error: ${ZMQ_LIB_NAME} not found in ${ZMQ_LIB_DIR}. Please ensure the library is available.") |
32 | | -else() |
33 | | - message(STATUS "Found ${ZMQ_LIB_NAME} in ${ZMQ_LIB_DIR}") |
| 6 | +if(DMQ_TRANSPORT STREQUAL "DMQ_TRANSPORT_ZEROMQ") |
| 7 | + # vcpkg package manager |
| 8 | + # https://github.com/microsoft/vcpkg |
| 9 | + set_and_check(VCPKG_ROOT_DIR "${DMQ_ROOT_DIR}/../../../vcpkg") |
| 10 | + |
| 11 | + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") |
| 12 | + set_and_check(ZeroMQ_DIR "${VCPKG_ROOT_DIR}/installed/x64-windows/share/zeromq") |
| 13 | + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 14 | + set_and_check(ZeroMQ_DIR "${VCPKG_ROOT_DIR}/installed/x64-linux-dynamic/share/zeromq") |
| 15 | + endif() |
| 16 | + find_package(ZeroMQ CONFIG REQUIRED) |
| 17 | + if (ZeroMQ_FOUND) |
| 18 | + message(STATUS "ZeroMQ found: ${ZeroMQ_VERSION}") |
| 19 | + else() |
| 20 | + message(FATAL_ERROR "ZeroMQ not found!") |
| 21 | + endif() |
34 | 22 | endif() |
35 | | - |
36 | | -# Set path to the MessagePack C++ library (msgpack.hpp) |
| 23 | + |
| 24 | +# MessagePack C++ library (msgpack.hpp) |
37 | 25 | # https://github.com/msgpack/msgpack-c/tree/cpp_master |
38 | | -set(MSGPACK_INCLUDE_DIR "${DMQ_ROOT_DIR}/../../../msgpack-c/include") |
39 | | -if(NOT EXISTS "${MSGPACK_INCLUDE_DIR}") |
40 | | - message(FATAL_ERROR "${MSGPACK_INCLUDE_DIR} Directory does not exist. Update MSGPACK_INCLUDE_DIR to the correct directory.") |
| 26 | +if(DMQ_SERIALIZE STREQUAL "DMQ_SERIALIZE_MSGPACK") |
| 27 | + set_and_check(MSGPACK_INCLUDE_DIR "${DMQ_ROOT_DIR}/../../../msgpack-c/include") |
41 | 28 | endif() |
42 | 29 |
|
43 | | -# Set path to the RapidJSON C++ library |
| 30 | +# RapidJSON C++ library |
44 | 31 | # https://github.com/Tencent/rapidjson |
45 | | -set(RAPIDJSON_INCLUDE_DIR "${DMQ_ROOT_DIR}/../../../rapidjson/include") |
46 | | -if(NOT EXISTS "${RAPIDJSON_INCLUDE_DIR}") |
47 | | - message(FATAL_ERROR "${RAPIDJSON_INCLUDE_DIR} Directory does not exist. Update RAPIDJSON_INCLUDE_DIR to the correct directory.") |
| 32 | +if(DMQ_SERIALIZE STREQUAL "DMQ_SERIALIZE_RAPIDJSON") |
| 33 | + set_and_check(RAPIDJSON_INCLUDE_DIR "${DMQ_ROOT_DIR}/../../../rapidjson/include") |
48 | 34 | endif() |
49 | 35 |
|
50 | | -# Set path to the FreeRTOS library |
| 36 | +# FreeRTOS library |
51 | 37 | # https://github.com/FreeRTOS/FreeRTOS |
52 | | -set(FREERTOS_ROOT_DIR "${DMQ_ROOT_DIR}/../../../FreeRTOSv202212.00") |
53 | | -if(NOT EXISTS "${FREERTOS_ROOT_DIR}") |
54 | | - message(FATAL_ERROR "${FREERTOS_ROOT_DIR} Directory does not exist. Update FREERTOS_ROOT_DIR to the correct directory.") |
55 | | -else() |
| 38 | +if(DMQ_THREAD STREQUAL "DMQ_THREAD_FREERTOS") |
| 39 | + set_and_check(FREERTOS_ROOT_DIR "${DMQ_ROOT_DIR}/../../../FreeRTOSv202212.00") |
56 | 40 | # Collect FreeRTOS source files |
57 | 41 | file(GLOB FREERTOS_SOURCES |
58 | 42 | "${FREERTOS_ROOT_DIR}/FreeRTOS/Source/*.c" |
|
0 commit comments