-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
32 lines (25 loc) · 959 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
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
set(CMAKE_TOOLCHAIN_FILE "config/msp430-toolchain.cmake")
project(botoks LANGUAGES C ASM)
# Check that toolchain environment variable exists
if(NOT DEFINED ENV{MSP430_TOOLCHAIN_PATH})
message(FATAL_ERROR
"Environment variable MSP430_TOOLCHAIN_PATH must be defined"
)
endif()
# Check that toolchain path is correct
if(NOT EXISTS "$ENV{MSP430_TOOLCHAIN_PATH}/bin/msp430-elf-gcc")
message(FATAL_ERROR
"Environment variable MSP430_TOOLCHAIN_PATH must point to the root of "
"the MSP430 toolchain"
)
endif()
# Prefix path to install executables
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR})
add_subdirectory(apps)
# Only generate build files for docs if explicitely set BUILD_DOCS as a
# command-line argument, as building docs requires Doxygen, Sphinx and other
# Sphinx-related dependencies
if(BUILD_DOCS)
add_subdirectory(docs EXCLUDE_FROM_ALL)
endif()