blob: 73787137bdde0e4e9370fb2a83c46fed3928cc93 [file] [log] [blame]
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +00001#----------------------------------------------------------------------------
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
22cmake_minimum_required(VERSION 3.15.6)
23
24project(lcd_component
25 DESCRIPTION "LCD support library"
26 LANGUAGES C CXX ASM)
27
28# Add top level interface library
29set(LCD_IFACE_TARGET lcd_iface)
30add_library(${LCD_IFACE_TARGET} INTERFACE)
31target_include_directories(${LCD_IFACE_TARGET} INTERFACE include)
32
33# Create static library for MPS3 LCD
34set(LCD_MPS3_COMPONENT_TARGET lcd_mps3)
35add_library(${LCD_MPS3_COMPONENT_TARGET} STATIC)
36
37set(CLCD_CONFIG_BASE "0x4930A000" CACHE STRING "LCD configuration base address")
38
39## Include directories - private
40target_include_directories(${LCD_MPS3_COMPONENT_TARGET}
41 PRIVATE
42 source)
43
44## Component sources
45target_sources(${LCD_MPS3_COMPONENT_TARGET}
46 PRIVATE
47 source/glcd_mps3/glcd_mps3.c
48 source/lcd_img.c)
49
50# Compile definitions
51target_compile_definitions(${LCD_MPS3_COMPONENT_TARGET}
52 PRIVATE
53 CLCD_CONFIG_BASE=${CLCD_CONFIG_BASE})
54
55## Add dependencies
56target_link_libraries(${LCD_MPS3_COMPONENT_TARGET} PUBLIC
57 ${LCD_IFACE_TARGET}
58 log)
59
60# Display status
61message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
62message(STATUS "*******************************************************")
63message(STATUS "Library : " ${LCD_MPS3_COMPONENT_TARGET})
64message(STATUS "*******************************************************")
65
66# Create static library for LCD Stubs
67set(LCD_STUBS_COMPONENT_TARGET lcd_stubs)
68add_library(${LCD_STUBS_COMPONENT_TARGET} STATIC)
69
70## Include directories - private
71target_include_directories(${LCD_STUBS_COMPONENT_TARGET}
72 PRIVATE
73 source)
74
75## Component sources
76target_sources(${LCD_STUBS_COMPONENT_TARGET}
77 PRIVATE
78 source/glcd_stubs/glcd_stubs.c
79 source/lcd_img.c)
80
81## Add dependencies
82target_link_libraries(${LCD_STUBS_COMPONENT_TARGET} PUBLIC
83 ${LCD_IFACE_TARGET}
84 log)
85
86# Display status
87message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
88message(STATUS "*******************************************************")
89message(STATUS "Library : " ${LCD_STUBS_COMPONENT_TARGET})
90message(STATUS "*******************************************************")