-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (27 loc) · 1.13 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
# Set minimum CMake version
cmake_minimum_required(VERSION 3.16.3)
if (ESP_PLATFORM)
idf_component_register(INCLUDE_DIRS src
REQUIRES arduino librnp) #requires arduino....
#we need some wizardry so we keep the nice original cmake structure
#we add the src subdirectory where the static library is defined
add_subdirectory(src)
#we need to explictly link t
target_link_libraries(librrc PRIVATE idf::arduino)
target_link_libraries(librrc PRIVATE idf::librnp)
target_link_libraries(librrc PRIVATE idf::libriccore)
# target_link_libraries(librrc PRIVATE idf::esp_task)
#link the orignal cmake librnp library to the component library
target_link_libraries(${COMPONENT_LIB} INTERFACE librrc)
return()
endif()
# Declare project
project(librrc LANGUAGES CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
# Set output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
# Add source directory
add_subdirectory(src)