-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (27 loc) · 1004 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
SET(CMAKE_C_STANDARD 11)
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
SET(CMAKE_INSTALL_MESSAGE NEVER)
PROJECT(pious CXX C ASM)
SET(PIOUS_VERSION_MAJOR 0)
SET(PIOUS_VERSION_MINOR 0)
SET(PIOUS_VERSION_PATCH 1)
CONFIGURE_FILE(
"${CMAKE_SOURCE_DIR}/kern.h.in"
"${CMAKE_BINARY_DIR}/kern.h"
@ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
INCLUDE_DIRECTORIES(inc)
INCLUDE_DIRECTORIES(contrib/printf)
ADD_SUBDIRECTORY(contrib/printf)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
ADD_SUBDIRECTORY(kernel)
ADD_EXECUTABLE(pious kern_main.cpp cpprt.cpp)
TARGET_LINK_LIBRARIES(pious Kernel)
TARGET_LINK_LIBRARIES(pious Printf)
SET_TARGET_PROPERTIES(pious PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})
ADD_CUSTOM_COMMAND(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O binary ${CMAKE_PROJECT_NAME} kernel8.img)