Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 1 | #---------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2022 Arm Limited. All rights reserved. |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | #---------------------------------------------------------------------------- |
| 17 | |
| 18 | ######################################################### |
| 19 | # LCD library # |
| 20 | ######################################################### |
| 21 | |
Kshitij Sisodia | 9c6f9f8 | 2022-05-20 14:30:02 +0100 | [diff] [blame] | 22 | cmake_minimum_required(VERSION 3.21.0) |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 23 | |
| 24 | project(lcd_component |
| 25 | DESCRIPTION "LCD support library" |
| 26 | LANGUAGES C CXX ASM) |
| 27 | |
| 28 | # Add top level interface library |
| 29 | set(LCD_IFACE_TARGET lcd_iface) |
| 30 | add_library(${LCD_IFACE_TARGET} INTERFACE) |
| 31 | target_include_directories(${LCD_IFACE_TARGET} INTERFACE include) |
| 32 | |
| 33 | # Create static library for MPS3 LCD |
| 34 | set(LCD_MPS3_COMPONENT_TARGET lcd_mps3) |
| 35 | add_library(${LCD_MPS3_COMPONENT_TARGET} STATIC) |
| 36 | |
| 37 | set(CLCD_CONFIG_BASE "0x4930A000" CACHE STRING "LCD configuration base address") |
| 38 | |
| 39 | ## Include directories - private |
| 40 | target_include_directories(${LCD_MPS3_COMPONENT_TARGET} |
| 41 | PRIVATE |
| 42 | source) |
| 43 | |
| 44 | ## Component sources |
| 45 | target_sources(${LCD_MPS3_COMPONENT_TARGET} |
| 46 | PRIVATE |
| 47 | source/glcd_mps3/glcd_mps3.c |
| 48 | source/lcd_img.c) |
| 49 | |
| 50 | # Compile definitions |
| 51 | target_compile_definitions(${LCD_MPS3_COMPONENT_TARGET} |
| 52 | PRIVATE |
| 53 | CLCD_CONFIG_BASE=${CLCD_CONFIG_BASE}) |
| 54 | |
Kshitij Sisodia | ea8ce56 | 2022-04-12 11:10:11 +0100 | [diff] [blame] | 55 | ## Logging utilities: |
| 56 | if (NOT TARGET log) |
| 57 | if (NOT DEFINED LOG_PROJECT_DIR) |
| 58 | message(FATAL_ERROR "LOG_PROJECT_DIR needs to be defined.") |
| 59 | endif() |
| 60 | add_subdirectory(${LOG_PROJECT_DIR} ${CMAKE_BINARY_DIR}/log) |
| 61 | endif() |
| 62 | |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 63 | ## Add dependencies |
| 64 | target_link_libraries(${LCD_MPS3_COMPONENT_TARGET} PUBLIC |
| 65 | ${LCD_IFACE_TARGET} |
| 66 | log) |
| 67 | |
| 68 | # Display status |
| 69 | message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR}) |
| 70 | message(STATUS "*******************************************************") |
| 71 | message(STATUS "Library : " ${LCD_MPS3_COMPONENT_TARGET}) |
| 72 | message(STATUS "*******************************************************") |
| 73 | |
| 74 | # Create static library for LCD Stubs |
| 75 | set(LCD_STUBS_COMPONENT_TARGET lcd_stubs) |
| 76 | add_library(${LCD_STUBS_COMPONENT_TARGET} STATIC) |
| 77 | |
| 78 | ## Include directories - private |
| 79 | target_include_directories(${LCD_STUBS_COMPONENT_TARGET} |
| 80 | PRIVATE |
| 81 | source) |
| 82 | |
| 83 | ## Component sources |
| 84 | target_sources(${LCD_STUBS_COMPONENT_TARGET} |
| 85 | PRIVATE |
| 86 | source/glcd_stubs/glcd_stubs.c |
| 87 | source/lcd_img.c) |
| 88 | |
| 89 | ## Add dependencies |
| 90 | target_link_libraries(${LCD_STUBS_COMPONENT_TARGET} PUBLIC |
| 91 | ${LCD_IFACE_TARGET} |
| 92 | log) |
| 93 | |
| 94 | # Display status |
| 95 | message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR}) |
| 96 | message(STATUS "*******************************************************") |
| 97 | message(STATUS "Library : " ${LCD_STUBS_COMPONENT_TARGET}) |
Kshitij Sisodia | 9c6f9f8 | 2022-05-20 14:30:02 +0100 | [diff] [blame] | 98 | message(STATUS "*******************************************************") |