-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (46 loc) · 1.34 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.13)
project(DuckOS
LANGUAGES CXX ASM
VERSION 0.1.0
DESCRIPTION "DuckOS is custom OS written in C++ for fun"
)
# https://stackoverflow.com/a/9328525/13212650
# get_cmake_property(_variableNames VARIABLES)
# list (SORT _variableNames)
# foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
# endforeach()
option(BUILD_KERNEL "Builds kernel" ON)
option(BUILD_TESTS "Builds unit tests" OFF)
add_subdirectory(dstd)
if(${BUILD_KERNEL})
add_subdirectory(kernel)
endif()
if(${BUILD_TESTS})
add_subdirectory(tests)
ADD_CUSTOM_TARGET(test
COMMAND ${CMAKE_SOURCE_DIR}/build/tests/tests
USES_TERMINAL
)
endif()
ADD_CUSTOM_TARGET(image
COMMAND sudo ${CMAKE_SOURCE_DIR}/scripts/build-image.sh
DEPENDS ${CMAKE_BINARY_DIR}/kernel/DuckOS
BYPRODUCTS ${CMAKE_BINARY_DIR}/duckOS.img
USES_TERMINAL
)
ADD_CUSTOM_TARGET(run
COMMAND ${CMAKE_SOURCE_DIR}/scripts/run-qemu-image.sh
DEPENDS ${CMAKE_BINARY_DIR}/duckOS.img
USES_TERMINAL
)
ADD_CUSTOM_TARGET(debug
COMMAND ${CMAKE_SOURCE_DIR}/scripts/debug-qemu-image.sh
DEPENDS ${CMAKE_BINARY_DIR}/duckOS.img
USES_TERMINAL
)
ADD_CUSTOM_TARGET(bochs
COMMAND ${CMAKE_SOURCE_DIR}/scripts/run-bochs-image.sh
DEPENDS ${CMAKE_BINARY_DIR}/duckOS.img
USES_TERMINAL
)