cmake:fix 7300 cmake build fail,init gpsutils cmake build

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19 2024-03-21 10:05:33 +08:00 committed by Xiang Xiao
parent b17c074a18
commit e03fba1ad4

View file

@ -17,32 +17,45 @@
# the License. # the License.
# #
# ############################################################################## # ##############################################################################
nuttx_generate_kconfig(MENUDESC "GPS Utilities")
if(CONFIG_GPSUTILS_MINMEA_LIB) if(CONFIG_GPSUTILS_MINMEA_LIB)
set(MINMEA_DIR ${CMAKE_CURRENT_LIST_DIR}/minmea) if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/minmea)
if(NOT EXISTS ${MINMEA_DIR})
set(MINMEA_URL https://github.com/kosma/minmea/archive)
set(MINMEA_VERSION db46128e73cee26d6a6eb0482dcba544ee1ea9f5) set(MINMEA_VERSION db46128e73cee26d6a6eb0482dcba544ee1ea9f5)
FetchContent_Declare( FetchContent_Declare(
minmea_fetch minmea
URL ${MINMEA_URL}/${MINMEA_VERSION}.zip SOURCE_DIR DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/minmea BINARY_DIR URL "https://github.com/kosma/minmea/archive/${MINMEA_VERSION}.zip"
SOURCE_DIR
${CMAKE_CURRENT_LIST_DIR}/minmea
BINARY_DIR
${CMAKE_BINARY_DIR}/libs/libc/gpsutils/minmea ${CMAKE_BINARY_DIR}/libs/libc/gpsutils/minmea
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
TEST_COMMAND
""
DOWNLOAD_NO_PROGRESS true DOWNLOAD_NO_PROGRESS true
TIMEOUT 30) TIMEOUT 30)
FetchContent_GetProperties(minmea_fetch) FetchContent_GetProperties(minmea)
if(NOT minmea_fetch_POPULATED) if(NOT minmea_POPULATED)
FetchContent_Populate(minmea_fetch) FetchContent_Populate(minmea)
endif() endif()
endif() endif()
if(NOT EXISTS ${CMAKE_BINARY_DIR}/include/minmea)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/minmea)
endif()
configure_file(${CMAKE_CURRENT_LIST_DIR}/minmea/minmea.h
${CMAKE_BINARY_DIR}/include/minmea/minmea.h COPYONLY)
target_sources(c PRIVATE minmea/minmea.c) target_sources(c PRIVATE minmea/minmea.c)
endif() endif()