blob: d2600915dc617d1339a613ff192715d7835390c6 [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
Kshitij Sisodiaea8ce562022-04-12 11:10:11 +010055## Logging utilities:
56if (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)
61endif()
62
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000063## Add dependencies
64target_link_libraries(${LCD_MPS3_COMPONENT_TARGET} PUBLIC
65 ${LCD_IFACE_TARGET}
66 log)
67
68# Display status
69message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
70message(STATUS "*******************************************************")
71message(STATUS "Library : " ${LCD_MPS3_COMPONENT_TARGET})
72message(STATUS "*******************************************************")
73
74# Create static library for LCD Stubs
75set(LCD_STUBS_COMPONENT_TARGET lcd_stubs)
76add_library(${LCD_STUBS_COMPONENT_TARGET} STATIC)
77
78## Include directories - private
79target_include_directories(${LCD_STUBS_COMPONENT_TARGET}
80 PRIVATE
81 source)
82
83## Component sources
84target_sources(${LCD_STUBS_COMPONENT_TARGET}
85 PRIVATE
86 source/glcd_stubs/glcd_stubs.c
87 source/lcd_img.c)
88
89## Add dependencies
90target_link_libraries(${LCD_STUBS_COMPONENT_TARGET} PUBLIC
91 ${LCD_IFACE_TARGET}
92 log)
93
94# Display status
95message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
96message(STATUS "*******************************************************")
97message(STATUS "Library : " ${LCD_STUBS_COMPONENT_TARGET})
98message(STATUS "*******************************************************")