blob: fc2b91f5835750108ad2852ff84188fd824dbff5 [file] [log] [blame]
Kristofer Jonsson116a6352020-08-20 17:25:23 +02001#
2# Copyright (c) 2020 Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6# Licensed under the Apache License, Version 2.0 (the License); you may
7# not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an AS IS BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19cmake_minimum_required(VERSION 3.0.2)
20
21# Set the project name and version
22project("linux_driver_stack" VERSION 1.0)
23
24# Default options
25option(BUILD_KERNEL "Build the kernel driver" ON)
26option(BUILD_MAILBOX "Build the MHU mailbox kernel module" ON)
27
28# Add rpath to library directory
29set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
30
31# Add include directory
32include_directories("kernel")
33
34# Add sub directories
35if(BUILD_KERNEL)
36 add_subdirectory(kernel)
37endif()
38
39if (BUILD_MAILBOX)
40 add_subdirectory(mailbox)
41endif()
42
Kristofer Jonssonb74492c2020-09-10 13:26:01 +020043# Build flatbuffers
44unset(PROJECT_VERSION)
45unset(PROJECT_VERSION_MAJOR)
46unset(PROJECT_VERSION_MINOR)
47option(FLATBUFFERS_BUILD_TESTS OFF)
48option(FLATBUFFERS_INSTALL OFF)
49option(FLATBUFFERS_BUILD_FLATC OFF)
50option(FLATBUFFERS_BUILD_FLATHASH OFF)
51add_subdirectory(flatbuffers)
52
53# Build driver library
Kristofer Jonsson116a6352020-08-20 17:25:23 +020054add_subdirectory(driver_library)
Kristofer Jonssonb74492c2020-09-10 13:26:01 +020055
56# Build utils
Kristofer Jonsson116a6352020-08-20 17:25:23 +020057add_subdirectory(utils)