Files
seL4/FindseL4.cmake
Kent McLeod 58b6f3503e CMake: Add FindseL4.cmake module
This adds support for importing this project via `find_package(seL4)` if
the project exists in the CMAKE_MODULE_PATH.

sel4_import_kernel adds the kernel project to the current build
directory.

sel4_import_libsel4 adds libsel4 to the current build directory

sel4_configure_platform_settings imports seL4Config.cmake which
configures kernel configuration and toolchain settings for the target
platform.
2019-09-13 18:42:42 +10:00

38 lines
1.1 KiB
CMake

#
# Copyright 2019, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the GNU General Public License version 2. Note that NO WARRANTY is provided.
# See "LICENSE_GPLv2.txt" for details.
#
# @TAG(DATA61_GPL)
#
set(KERNEL_PATH "${CMAKE_CURRENT_LIST_DIR}" CACHE STRING "")
set(KERNEL_HELPERS_PATH "${CMAKE_CURRENT_LIST_DIR}/tools/helpers.cmake" CACHE STRING "")
set(KERNEL_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}/configs/seL4Config.cmake" CACHE STRING "")
mark_as_advanced(KERNEL_PATH KERNEL_HELPERS_PATH KERNEL_CONFIG_PATH)
macro(sel4_import_kernel)
add_subdirectory(${KERNEL_PATH} ${CMAKE_BINARY_DIR}/kernel)
endmacro()
macro(sel4_import_libsel4)
add_subdirectory("${KERNEL_PATH}/libsel4" ${CMAKE_BINARY_DIR}/libsel4)
endmacro()
macro(sel4_configure_platform_settings)
include(${KERNEL_CONFIG_PATH})
endmacro()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
seL4
DEFAULT_MSG
KERNEL_PATH
KERNEL_HELPERS_PATH
KERNEL_CONFIG_PATH
)