1#
2# Copyright 2018, Data61, CSIRO (ABN 41 687 119 230)
3#
4# SPDX-License-Identifier: BSD-2-Clause
5#
6
7cmake_minimum_required(VERSION 3.8.2)
8include(settings.cmake)
9project(camkes C CXX ASM)
10
11find_package(camkes-tool REQUIRED)
12find_package(global-components REQUIRED)
13find_package(sel4_projects_libs REQUIRED)
14
15# Set some options we know we need here. Applications can override them
16set(CapDLLoaderMaxObjects 20000 CACHE STRING "")
17set(KernelRootCNodeSizeBits 17 CACHE STRING "")
18if(KernelArchARM)
19    ApplyData61ElfLoaderSettings(${KernelPlatform} ${KernelSel4Arch})
20endif()
21camkes_tool_setup_camkes_build_environment()
22
23sel4_projects_libs_import_libraries()
24
25function(includeGlobalComponents)
26    global_components_import_project()
27endfunction()
28
29enable_testing()
30macro(add_simulate_test test_script)
31	set(TEST_SCRIPT ${test_script})
32	configure_file(${CMAKE_SOURCE_DIR}/tests/test_script.tcl.in ${CMAKE_BINARY_DIR}/test.tcl @ONLY)
33	add_test(${CMAKE_PROJECT_NAME} expect -f ${CMAKE_BINARY_DIR}/test.tcl)
34endmacro()
35
36# We only support one application being built at a time
37include(apps/${CAMKES_APP}/CMakeLists.txt)
38
39# Should be done adding targets, can now generate the root server and the global configuration
40GenerateCAmkESRootserver()
41include(simulation)
42if(SIMULATION)
43    GenerateSimulateScript()
44endif()
45