From 272fde1b63010251db1d462a492ff66d5e3aa3c4 Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Wed, 11 Nov 2020 14:50:56 +0100 Subject: [PATCH 1/3] add comms-ublox --- ports/comms-ublox/fix-comms.patch | 23 +++++++++++++++++++++++ ports/comms-ublox/portfile.cmake | 28 ++++++++++++++++++++++++++++ ports/comms-ublox/vcpkg.json | 7 +++++++ 3 files changed, 58 insertions(+) create mode 100644 ports/comms-ublox/fix-comms.patch create mode 100644 ports/comms-ublox/portfile.cmake create mode 100644 ports/comms-ublox/vcpkg.json diff --git a/ports/comms-ublox/fix-comms.patch b/ports/comms-ublox/fix-comms.patch new file mode 100644 index 00000000000000..c1619bfc266c5b --- /dev/null +++ b/ports/comms-ublox/fix-comms.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2b69fe..aff5917 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -66,6 +66,7 @@ endif () + ###################################################################### + + # Use external CommsChampion project or compile it in place ++if(FALSE) + set (CC_EXTERNAL_TGT "comms_champion_external") + if (OPT_BUILD_TEST OR OPT_BUILD_PLUGIN) + set (external_cc_needed TRUE) +@@ -107,6 +108,10 @@ elseif (external_cc_needed) + find_package(CommsChampion NO_MODULE) + set (cc_compile_file "${OPT_CC_MAIN_INSTALL_DIR}/lib/LibComms/cmake/CC_Compile.cmake") + endif () ++else() ++ find_package(LibComms CONFIG REQUIRED) ++ set(cc_compile_file ${LibComms_DIR}/CC_Compile.cmake) ++endif() + + if (EXISTS ${cc_compile_file}) + # Set compiler flags diff --git a/ports/comms-ublox/portfile.cmake b/ports/comms-ublox/portfile.cmake new file mode 100644 index 00000000000000..c665dc31d453e9 --- /dev/null +++ b/ports/comms-ublox/portfile.cmake @@ -0,0 +1,28 @@ +#header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO commschamp/cc.ublox.generated + REF v0.19.1 + SHA512 4f599bc052ea4f4dd4158c7e2d2bd4020393802d8f2bcd97637a618190789cd5797e3e3b56da868949a261d1d4a34b4bf613a97ad28e0da87f82b3f5452498e7 + HEAD_REF master + PATCHES + fix-comms.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DOPT_BUILD_TEST=OFF + -DOPT_BUILD_PLUGIN=OFF + -OPT_NO_COMMS=ON + -OPT_EXTERNALS_UPDATE_DISCONNECTED=ON +) +vcpkg_install_cmake() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/comms-ublox/vcpkg.json b/ports/comms-ublox/vcpkg.json new file mode 100644 index 00000000000000..826c4ee60aadbd --- /dev/null +++ b/ports/comms-ublox/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "comms-ublox", + "version-string": "0.19.1", + "description": "UBLOX (UBX) protocol definition, generated out of cc.ublox.commsdsl", + "homepage": "https://commschamp.github.io/", + "documentation": "https://github.com/commschamp/cc.ublox.generated" +} From 9565b2292531f3242a9c879a119d0d7d5da8bc07 Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Wed, 11 Nov 2020 14:57:43 +0100 Subject: [PATCH 2/3] forgot the dependencies --- ports/comms-ublox/vcpkg.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/comms-ublox/vcpkg.json b/ports/comms-ublox/vcpkg.json index 826c4ee60aadbd..30825b80c54b51 100644 --- a/ports/comms-ublox/vcpkg.json +++ b/ports/comms-ublox/vcpkg.json @@ -3,5 +3,8 @@ "version-string": "0.19.1", "description": "UBLOX (UBX) protocol definition, generated out of cc.ublox.commsdsl", "homepage": "https://commschamp.github.io/", - "documentation": "https://github.com/commschamp/cc.ublox.generated" + "documentation": "https://github.com/commschamp/cc.ublox.generated", + "dependencies": [ + "comms" + ] } From d71d886c48636a29919d0aac92d0c93408a28153 Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Thu, 12 Nov 2020 00:01:08 +0100 Subject: [PATCH 3/3] Fix naming of cmake variables --- ports/comms-ublox/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/comms-ublox/portfile.cmake b/ports/comms-ublox/portfile.cmake index c665dc31d453e9..e308ccd7b25a0e 100644 --- a/ports/comms-ublox/portfile.cmake +++ b/ports/comms-ublox/portfile.cmake @@ -16,8 +16,8 @@ vcpkg_configure_cmake( OPTIONS -DOPT_BUILD_TEST=OFF -DOPT_BUILD_PLUGIN=OFF - -OPT_NO_COMMS=ON - -OPT_EXTERNALS_UPDATE_DISCONNECTED=ON + -DOPT_NO_COMMS=ON + -DOPT_EXTERNALS_UPDATE_DISCONNECTED=ON ) vcpkg_install_cmake() @@ -25,4 +25,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)