-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
47 lines (35 loc) · 1.48 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
PROJECT(KARMA)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
ENABLE_LANGUAGE(ASM)
ENABLE_LANGUAGE(C)
ENABLE_LANGUAGE(CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF (NOT ARCH)
MESSAGE(SEND_ERROR "No arch given")
RETURN()
ENDIF()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KARMA_SOURCE_DIR}/CMakeScripts)
SET(BUILD_SHARED_LIBS OFF)
SET (CURRENT_ARCH_PATH "${KARMA_SOURCE_DIR}/arch/${ARCH}" CACHE STRINGS "Targeted arch")
SET (CURRENT_PROC_PATH "${CURRENT_ARCH_PATH}/${PROCESSOR}" CACHE STRINGS "Targeted processor")
SET (CURRENT_ARCH_CONFIG_PATH "${CURRENT_PROC_PATH}/config" CACHE STRINGS "Targeted processor configuration dir")
SET (KERNEL_LIBRARY_DIR "${KARMA_SOURCE_DIR}/lib" CACHE STRINGS "Kernel Library dir")
MARK_AS_ADVANCED(CURRENT_ARCH_PATH CURRENT_ARCH_CONFIG_PATH)
IF (NOT (EXISTS "${CURRENT_PROC_PATH}" AND IS_DIRECTORY "${CURRENT_PROC_PATH}"))
MESSAGE(SEND_ERROR "Cannot find targeted processor at ${CURRENT_PROC_PATH}")
RETURN()
ENDIF()
IF (NOT BOARD)
MESSAGE(SEND_ERROR "No board given")
RETURN()
ENDIF()
SET (BOARD_PATH "${KARMA_SOURCE_DIR}/board/${BOARD}" CACHE STRINGS "Targeted board")
IF(NOT (EXISTS "${BOARD_PATH}" AND IS_DIRECTORY "${BOARD_PATH}"))
MESSAGE(SEND_ERROR "Cannot find ${CURRENT_ARCH_PATH}")
RETURN()
ENDIF()
ADD_SUBDIRECTORY(${CURRENT_ARCH_PATH})
ADD_SUBDIRECTORY(${BOARD_PATH})
ADD_SUBDIRECTORY(${KERNEL_LIBRARY_DIR})
ADD_SUBDIRECTORY(kernel)