cmake_minimum_required(VERSION "3.27") project("kernel" DESCRIPTION "An educational OS kernel" HOMEPAGE_URL "https://gitlab.ost.ch/teachos/kernel" VERSION "0.0.1" LANGUAGES ASM C CXX ) set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules") include("ElfTransformations") include("GenerateBootableIso") #[============================================================================[ # Global Build System Options #]============================================================================] option(TEACHOS_ENABLE_LINTING "Enable linting during build" ON) option(TEACHOS_GENERATE_DOCS "Generate documentation during build" ON) #[============================================================================[ # Global Build System Configuration #]============================================================================] set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES) set(CMAKE_CXX_STANDARD "23") set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_CXX_EXTENSIONS NO) add_compile_options( "$<$:-Wall>" "$<$:-Wextra>" "$<$:-Werror>" "$<$:-pedantic-errors>" ) #[============================================================================[ # Global Linting Configuration #]============================================================================] find_program(CLANG_TIDY_EXE "clang-tidy") if(CLANG_TIDY_EXE AND TEACHOS_ENABLE_LINTING) set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}") set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}") endif() #[============================================================================[ # Global Documentation Configuration #]============================================================================] find_package(Doxygen "1.10") if(Doxygen_FOUND AND TEACHOS_GENERATE_DOCS) doxygen_add_docs("docs" ALL COMMENT "Generating documentation" CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile" ) endif() #[============================================================================[ # Global Targets #]============================================================================] add_subdirectory("arch/${CMAKE_SYSTEM_PROCESSOR}") add_subdirectory("kapi") add_subdirectory("libs") add_subdirectory("kernel")