From e143531a444fb66f4c95de8668bb33911b4382f1 Mon Sep 17 00:00:00 2001 From: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:50:19 +0200 Subject: [PATCH] chores(cpn): fetch yaml-cpp via cmake --- .gitmodules | 3 --- cmake/FetchYamlCpp.cmake | 12 ++++++++++++ companion/src/CMakeLists.txt | 7 +------ companion/src/firmwares/CMakeLists.txt | 1 - companion/src/thirdparty/yaml-cpp | 1 - 5 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 cmake/FetchYamlCpp.cmake delete mode 160000 companion/src/thirdparty/yaml-cpp diff --git a/.gitmodules b/.gitmodules index 701c9c9bb83..da779449f51 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "radio/src/thirdparty/AccessDenied"] path = radio/src/thirdparty/AccessDenied url = https://github.com/raphaelcoeffic/AccessDenied.git -[submodule "companion/src/thirdparty/yaml-cpp"] - path = companion/src/thirdparty/yaml-cpp - url = https://github.com/jbeder/yaml-cpp.git [submodule "radio/src/thirdparty/FreeRTOS"] path = radio/src/thirdparty/FreeRTOS url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git diff --git a/cmake/FetchYamlCpp.cmake b/cmake/FetchYamlCpp.cmake new file mode 100644 index 00000000000..ee7556d4941 --- /dev/null +++ b/cmake/FetchYamlCpp.cmake @@ -0,0 +1,12 @@ +# Fetch yaml-cpp + +include(FetchContent) + +FetchContent_Declare( + yaml-cpp + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp + GIT_TAG f7320141120f720aecc4c32be25586e7da9eb978 # v0.8.0 +) + +FetchContent_MakeAvailable(yaml-cpp) +message("Fetched yaml-cpp source code from Github: ${yaml-cpp_SOURCE_DIR}") diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 22eac355495..95984f92a56 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -184,6 +184,7 @@ set(CPN_COMMON_LIB common) ############# Supporting libraries ############### include(FetchMiniz) +include(FetchYamlCpp) add_subdirectory(datamodels) add_subdirectory(firmwares) @@ -196,12 +197,6 @@ add_subdirectory(thirdparty/qcustomplot) add_subdirectory(thirdparty/maxlibqt/src/widgets) add_subdirectory(updates) -set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing" FORCE) -set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "Enable parse tools" FORCE) -set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "Enable contrib stuff in library" FORCE) -set(YAML_CPP_INSTALL OFF CACHE BOOL "Enable generation of install target" FORCE) -add_subdirectory(thirdparty/yaml-cpp) - ############# Companion ############### set(companion_SRCS diff --git a/companion/src/firmwares/CMakeLists.txt b/companion/src/firmwares/CMakeLists.txt index a96617f9933..4b1b6035b2f 100644 --- a/companion/src/firmwares/CMakeLists.txt +++ b/companion/src/firmwares/CMakeLists.txt @@ -73,7 +73,6 @@ target_include_directories(firmwares PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} - ${COMPANION_SRC_DIRECTORY}/thirdparty/yaml-cpp/include PUBLIC "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/er9x" diff --git a/companion/src/thirdparty/yaml-cpp b/companion/src/thirdparty/yaml-cpp deleted file mode 160000 index f7320141120..00000000000 --- a/companion/src/thirdparty/yaml-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f7320141120f720aecc4c32be25586e7da9eb978