CMake: Add Findsel4runtime.cmake module This adds support for importing this project via `find_package(sel4runtime)` if the project exists in the CMAKE_MODULE_PATH.
diff --git a/Findsel4runtime.cmake b/Findsel4runtime.cmake new file mode 100644 index 0000000..dcfe305 --- /dev/null +++ b/Findsel4runtime.cmake
@@ -0,0 +1,21 @@ +# +# 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 BSD 2-Clause license. Note that NO WARRANTY is provided. +# See "LICENSE_BSD2.txt" for details. +# +# @TAG(DATA61_BSD) +# + +set(SEL4_RUNTIME_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE STRING "") +mark_as_advanced(SEL4_RUNTIME_DIR) + +function(sel4runtime_import_project) + add_subdirectory(${SEL4_RUNTIME_DIR} sel4runtime) +endfunction() + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(sel4runtime DEFAULT_MSG SEL4_RUNTIME_DIR)