mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
fix cmake code smell issues
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
parent
c57794fe1f
commit
2432a62ab6
11 changed files with 49 additions and 72 deletions
|
|
@ -26,7 +26,7 @@ if(CONFIG_CANUTILS_LELYCANOPEN)
|
|||
|
||||
set(LELYCANOPEN_DIR ${CMAKE_CURRENT_LIST_DIR}/lely-canopen)
|
||||
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/lely-canopen)
|
||||
if(NOT EXISTS ${LELYCANOPEN_DIR})
|
||||
FetchContent_Declare(
|
||||
lelycanopen_fetch
|
||||
URL ${CONFIG_CANUTILS_LELYCANOPEN_URL}/lely-core-${CONFIG_CANUTILS_LELYCANOPEN_VERSION}.tar.gz
|
||||
|
|
@ -44,9 +44,6 @@ if(CONFIG_CANUTILS_LELYCANOPEN)
|
|||
if(NOT lelycanopen_fetch_POPULATED)
|
||||
FetchContent_Populate(lelycanopen_fetch)
|
||||
endif()
|
||||
|
||||
set(LELYCANOPEN_DIR ${lelycanopen_fetch_SOURCE_DIR})
|
||||
|
||||
endif()
|
||||
|
||||
nuttx_add_library(lelycanopen STATIC)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ if(CONFIG_CANUTILS_LIBDRONECAN)
|
|||
|
||||
set(LIBDRONECAN_DIR ${CMAKE_CURRENT_LIST_DIR}/libcanard)
|
||||
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcanard)
|
||||
if(NOT EXISTS ${LIBDRONECAN_DIR})
|
||||
FetchContent_Declare(
|
||||
libdronecan_fetch
|
||||
URL ${CONFIG_LIBDRONECAN_URL}/${CONFIG_LIBDRONECAN_VERSION}.zip SOURCE_DIR
|
||||
|
|
@ -40,8 +40,6 @@ if(CONFIG_CANUTILS_LIBDRONECAN)
|
|||
if(NOT libdronecan_fetch_POPULATED)
|
||||
FetchContent_Populate(libdronecan_fetch)
|
||||
endif()
|
||||
|
||||
set(LIBDRONECAN_DIR ${libdronecan_fetch_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# ############################################################################
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ if(CONFIG_CANUTILS_LIBOPENCYPHAL)
|
|||
# ############################################################################
|
||||
|
||||
set(LIBOPENCYPHAL_DIR ${CMAKE_CURRENT_LIST_DIR}/libcanard)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcanard)
|
||||
if(NOT EXISTS ${LIBOPENCYPHAL_DIR})
|
||||
FetchContent_Declare(
|
||||
libcanard_fetch
|
||||
URL ${CONFIG_LIBOPENCYPHAL_URL}/${CONFIG_LIBOPENCYPHAL_VERSION}.zip
|
||||
|
|
@ -37,11 +37,10 @@ if(CONFIG_CANUTILS_LIBOPENCYPHAL)
|
|||
if(NOT libcanard_fetch_POPULATED)
|
||||
FetchContent_Populate(libcanard_fetch)
|
||||
endif()
|
||||
set(LIBOPENCYPHAL_DIR ${libcanard_fetch_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
set(O1HEAP_DIR ${CMAKE_CURRENT_LIST_DIR}/o1heap)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/o1heap)
|
||||
if(NOT EXISTS ${O1HEAP_DIR})
|
||||
FetchContent_Declare(
|
||||
o1heap_fetch
|
||||
URL ${CONFIG_O1HEAP_URL}/${CONFIG_O1HEAP_VERSION}.zip SOURCE_DIR
|
||||
|
|
@ -53,7 +52,6 @@ if(CONFIG_CANUTILS_LIBOPENCYPHAL)
|
|||
if(NOT o1heap_fetch_POPULATED)
|
||||
FetchContent_Populate(o1heap_fetch)
|
||||
endif()
|
||||
set(O1HEAP_DIR ${o1heap_fetch_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# ############################################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue