-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
executable file
·53 lines (41 loc) · 2 KB
/
CMakeLists.txt
File metadata and controls
executable file
·53 lines (41 loc) · 2 KB
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
cmake_minimum_required(VERSION 3.22)
if(NOT DEFINED TOP_LVL_PROJECT_NAME)
set(TOP_LVL_PROJECT_NAME "sparkfun_promicro")
endif(NOT DEFINED TOP_LVL_PROJECT_NAME)
# We grab our boilerplate stuff up here since we might need it multiple times in the repo
set(CMAKE_BOILERPLATE_PATH ${CMAKE_SOURCE_DIR}/.CMake-Boilerplate)
include(${CMAKE_BOILERPLATE_PATH}/INSTALLER.cmake)
include(${CMAKE_BOILERPLATE_PATH}/VARIABLES.cmake)
include(${CMAKE_BOILERPLATE_PATH}/TESTING.cmake)
include(${CMAKE_BOILERPLATE_PATH}/pico_sdk_import.cmake)
# Project version number. Good metadata to have, but ONLY INCREMENT WHEN THERE IS SOMETHING BEING RELEASED!
set(PROJECT_VERSION 1.0.0)
# Initialize our project regarding the whole repo, and give it its version.
project("${TOP_LVL_PROJECT_NAME}"
VERSION ${PROJECT_VERSION}
DESCRIPTION "EXECUTABLE Repository"
LANGUAGES C CXX ASM
)
message(STATUS "Repository name: " ${PROJECT_NAME})
pico_sdk_init()
# This runtime directory will be used for stuff that has a runtime execution part
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/runtime")
# We declare where wwe wwant our cmake module stuff to live at build-time
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/")
# We add some compile options to make us honest and our code at least a little clean
add_compile_options(-Wall -Wextra -Wformat-overflow=0)
# In case we want to do some code coverage calculation later, lets put a coverage flag when we compile for debug
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(CMAKE_CXX_FLAGS "--coverage")
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE ON)
add_definitions(-DDEBUG)
endif()
# If testing is enabled at the command line lets do the CMake part of that
if(${ENABLE_TESTING})
enable_testing()
endif()
# There might be packages in our install path that we should use as hints later
set(PACKAGE_HINTS ${CMAKE_INSTALL_PREFIX})
# Add our subdirectories we want to build and install
add_subdirectory(firmware)
add_subdirectory(${DEPENDENCY_PATH}/pico_neopixels)