1)includeOS 的安装位置
2)工具链
3)给工程命名
4)服务命名
5)服务的二进制命名
6)最大内存可以硬编码到二进制文件中
7)源文件要与OS库部件链接以形成可启动映像
8)服务CMake选项
#MISC:
9)添加自己的 include 路径
10)添加磁盘
11)设备和插件
12)第三方库
13)包括服务构建脚本
cmake_minimum_required(VERSION 2.8.9)
# IncludeOS install location
if (NOT DEFINED ENV{INCLUDEOS_PREFIX})
set(ENV{INCLUDEOS_PREFIX} /usr/local)
endif()
# Use toolchain (if needed)
set(CMAKE_TOOLCHAIN_FILE $ENV{INCLUDEOS_PREFIX}/includeos/i686-elf-toolchain.cmake)
# Name of your project
project (my_service)
# Human-readable name of your service
set(SERVICE_NAME "IncludeOS my_service")
# Name of your service binary
set(BINARY "my_service")
# Maximum memory can be hard-coded into the binary
set(MAX_MEM 128)
# Source files to be linked with OS library parts to form bootable image
set(SOURCES
service.cpp # ...add more here
)
#
# Service CMake options
# (uncomment to enable)
#
# MISC:
# To add your own include paths:
# set(LOCAL_INCLUDES ".")
# Adding memdisk (expects my.disk to exist in current dir):
# set(MEMDISK ${CMAKE_SOURCE_DIR}/my.disk)
# DRIVERS / PLUGINS:
set(DRIVERS
# virtionet # Virtio networking
# virtioblock # Virtio block device
# ... Others from IncludeOS/src/drivers
)
set(PLUGINS
# syslogd # Syslog over UDP
# ...others
)
# THIRD PARTY LIBRARIES:
set(LIBRARIES
# path to full library
)
# include service build script
include($ENV{INCLUDEOS_PREFIX}/includeos/service.cmake)