Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | cmake_minimum_required(VERSION 3.15) |
| 9 | |
| 10 | if (NOT DEFINED TFM_INSTALL_PATH) |
| 11 | if (DEFINED ENV{TFM_INSTALL_PATH}) |
| 12 | set(TFM_INSTALL_PATH $ENV{TFM_INSTALL_PATH}) |
| 13 | else() |
| 14 | message(FATAL_ERROR "TFM_INSTALL_PATH not found. Please set TFM_INSTALL_PATH environment variable or pass -DTFM_INSTALL_PATH flag.") |
| 15 | endif() |
| 16 | endif() |
| 17 | |
| 18 | if (NOT DEFINED ERPC_REPO_PATH) |
| 19 | if (DEFINED ENV{ERPC_REPO_PATH}) |
| 20 | set(ERPC_REPO_PATH $ENV{ERPC_REPO_PATH}) |
| 21 | else() |
| 22 | message(FATAL_ERROR "ERPC_REPO_PATH not found. Please set ERPC_REPO_PATH environment variable or pass -DERPC_REPO_PATH flag.") |
| 23 | endif() |
| 24 | endif() |
| 25 | |
| 26 | # Set eRPC config file. Need to provide config file with an absolute path. |
| 27 | if (ERPC_CONFIG_FILE) |
| 28 | if (NOT EXISTS ${ERPC_CONFIG_FILE}) |
| 29 | message(FATAL_ERROR "ERPC_CONFIG_FILE does not exist. Please provide it with an absolute path.") |
| 30 | endif() |
| 31 | # Get the path of the customized eRPC config file |
| 32 | get_filename_component(ERPC_CONFIG_FILE_PATH ${ERPC_CONFIG_FILE} DIRECTORY) |
| 33 | else() |
| 34 | # Use default one |
| 35 | set(ERPC_CONFIG_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config") |
| 36 | endif() |
| 37 | |
| 38 | add_library(erpc_client STATIC) |
| 39 | |
| 40 | target_sources(erpc_client |
| 41 | PRIVATE |
| 42 | erpc_client_wrapper.c |
| 43 | erpc_client_start.c |
| 44 | # eRPC files |
| 45 | ${ERPC_REPO_PATH}/erpc_c/infra/erpc_basic_codec.cpp |
| 46 | ${ERPC_REPO_PATH}/erpc_c/infra/erpc_client_manager.cpp |
| 47 | ${ERPC_REPO_PATH}/erpc_c/infra/erpc_crc16.cpp |
| 48 | ${ERPC_REPO_PATH}/erpc_c/infra/erpc_framed_transport.cpp |
| 49 | ${ERPC_REPO_PATH}/erpc_c/infra/erpc_message_buffer.cpp |
| 50 | ${ERPC_REPO_PATH}/erpc_c/port/erpc_serial.cpp |
| 51 | ${ERPC_REPO_PATH}/erpc_c/setup/erpc_client_setup.cpp |
| 52 | ${ERPC_REPO_PATH}/erpc_c/setup/erpc_setup_mbf_dynamic.cpp |
| 53 | # Generated files |
Kevin Peng | 0eca5ea | 2023-07-21 17:32:31 +0800 | [diff] [blame] | 54 | ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files/tfm_erpc_client.cpp |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 55 | ) |
| 56 | |
| 57 | target_include_directories(erpc_client |
| 58 | PUBLIC |
| 59 | ${ERPC_REPO_PATH}/erpc_c/port |
| 60 | ${ERPC_REPO_PATH}/erpc_c/infra |
| 61 | ${ERPC_REPO_PATH}/erpc_c/transports |
| 62 | ${ERPC_REPO_PATH}/erpc_c/setup |
| 63 | ${CMAKE_CURRENT_SOURCE_DIR}/ |
| 64 | ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files |
| 65 | ${TFM_INSTALL_PATH}/interface/include |
| 66 | ${ERPC_CONFIG_FILE_PATH}/ |
| 67 | ) |