forked from micro-ROS/micro_ros_espidf_component
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
52 lines (43 loc) · 1.84 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
idf_component_register(SRCS "network_interfaces/uros_ethernet_netif.c" "network_interfaces/uros_wlan_netif.c"
INCLUDE_DIRS "network_interfaces"
REQUIRES nvs_flash)
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(submake "$(MAKE)")
else()
set(submake "make")
endif()
set(APP_COLCON_META "${PROJECT_DIR}/app-colcon.meta")
if(NOT EXISTS "${APP_COLCON_META}")
set(APP_COLCON_META "")
endif()
externalproject_add(libmicroros_project
PREFIX ${CMAKE_BINARY_DIR}/libmicroros-prefix
SOURCE_DIR ${COMPONENT_DIR}
BINARY_DIR ${COMPONENT_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND
${submake} -j -f libmicroros.mk
CC=${CMAKE_C_COMPILER}
AR=${CMAKE_AR}
STRIP=${CMAKE_STRIP}
CFLAGS=${CMAKE_C_FLAGS}
CXX=${CMAKE_CXX_COMPILER}
CXXFLAGS=${CMAKE_CXX_FLAGS}
BUILD_DIR=${CMAKE_BINARY_DIR}
IDF_PATH=${IDF_PATH}
IDF_TARGET=${IDF_TARGET}
APP_COLCON_META=${APP_COLCON_META}
IDF_VERSION_MAJOR=${IDF_VERSION_MAJOR}
IDF_VERSION_MINOR=${IDF_VERSION_MINOR}
INSTALL_COMMAND ""
BUILD_BYPRODUCTS ${COMPONENT_DIR}/libmicroros.a
)
add_prebuilt_library(libmicroros-prebuilt ""
REQUIRES lwip)
add_dependencies(libmicroros-prebuilt libmicroros_project)
set_target_properties(libmicroros-prebuilt PROPERTIES IMPORTED_LOCATION ${COMPONENT_DIR}/libmicroros.a)
target_include_directories(libmicroros-prebuilt INTERFACE ${COMPONENT_DIR}/include)
add_dependencies(${COMPONENT_LIB} libmicroros-prebuilt)
target_link_libraries(${COMPONENT_LIB} INTERFACE libmicroros-prebuilt)
set_directory_properties( PROPERTIES ADDITIONAL_CLEAN_FILES
"${COMPONENT_DIR}/include;${COMPONENT_DIR}/micro_ros_dev;${COMPONENT_DIR}/micro_ros_src;${COMPONENT_DIR}/esp32_toolchain.cmake" )