From dab9b1fbb4f9e6b68bfa48091e4d2f7416024ac9 Mon Sep 17 00:00:00 2001 From: Holden Date: Thu, 16 Jan 2025 12:58:20 -0500 Subject: [PATCH] IOS: Fix Build --- cmake/find-modules/FindGStreamer.cmake | 20 ++++++++++ deploy/ios/Info.plist.in | 52 ++++++++++++++++++++++++++ test/CMakeLists.txt | 5 ++- test/Comms/CMakeLists.txt | 13 +++++-- test/UnitTestList.cc | 8 +++- 5 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 deploy/ios/Info.plist.in diff --git a/cmake/find-modules/FindGStreamer.cmake b/cmake/find-modules/FindGStreamer.cmake index 3f000ac404e..4d092473ead 100644 --- a/cmake/find-modules/FindGStreamer.cmake +++ b/cmake/find-modules/FindGStreamer.cmake @@ -76,6 +76,26 @@ elseif(IOS) set(GSTREAMER_PREFIX_IOS ${gstreamer_SOURCE_DIR}) endif() set(GSTREAMER_PREFIX ${GSTREAMER_PREFIX_IOS}) + + # set(GSTREAMER_PREFIX_IOS "~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework") + # list(APPEND CMAKE_FRAMEWORK_PATH "/Library/Developer/GStreamer/iPhone.sdk") + # if(DEFINED ENV{GSTREAMER_PREFIX_IOS} AND EXISTS $ENV{GSTREAMER_PREFIX_IOS}) + # set(GSTREAMER_PREFIX $ENV{GSTREAMER_PREFIX_IOS}) + # endif() + # set(GSTREAMER_PKG "gstreamer-1.0-devel-${QGC_GST_TARGET_VERSION}-ios-universal.pkg") + # set(GSTREAMER_URL "https://gstreamer.freedesktop.org/data/pkg/ios/${QGC_GST_TARGET_VERSION}/${GSTREAMER_PKG}") + # set(GSTREAMER_DOWNLOAD "${CMAKE_BINARY_DIR}/_deps/gstreamer/${GSTREAMER_PKG}") + # set(GSTREAMER_INSTALL_DIR "${CMAKE_BINARY_DIR}/_deps/gstreamer/install/gstreamer") + # if(NOT EXISTS ${GSTREAMER_DOWNLOAD}) + # message(STATUS "Downloading GStreamer from ${GSTREAMER_URL}") + # file(DOWNLOAD ${GSTREAMER_URL} ${GSTREAMER_DOWNLOAD} SHOW_PROGRESS) + # endif() + # if(NOT EXISTS ${GSTREAMER_INSTALL_DIR}) + # message(STATUS "Extracting GStreamer to ${GSTREAMER_INSTALL_DIR}") + # file(MAKE_DIRECTORY ${GSTREAMER_INSTALL_DIR}) + # file(ARCHIVE_EXTRACT INPUT ${GSTREAMER_TARBALL} DESTINATION ${GSTREAMER_INSTALL_DIR}) + # endif() + # set(GSTREAMER_PREFIX ${GSTREAMER_PREFIX_IOS}) elseif(ANDROID) if(DEFINED ENV{GSTREAMER_PREFIX_ANDROID} AND EXISTS $ENV{GSTREAMER_PREFIX_ANDROID}) set(GSTREAMER_PREFIX_ANDROID $ENV{GSTREAMER_PREFIX_ANDROID}) diff --git a/deploy/ios/Info.plist.in b/deploy/ios/Info.plist.in new file mode 100644 index 00000000000..120dde2ff8b --- /dev/null +++ b/deploy/ios/Info.plist.in @@ -0,0 +1,52 @@ + + + + + CFBundlePackageType + APPL + + CFBundleName + @MACOSX_BUNDLE_BUNDLE_NAME@ + + CFBundleDisplayName + @MACOSX_BUNDLE_BUNDLE_NAME@ + + CFBundleExecutable + $(EXECUTABLE_NAME) + + CFBundleIdentifier + @MACOSX_BUNDLE_GUI_IDENTIFIER@ + + CFBundleVersion + @MACOSX_BUNDLE_BUNDLE_VERSION@ + + CFBundleShortVersionString + @MACOSX_BUNDLE_SHORT_VERSION_STRING@ + + CFBundleIconFile + ${ASSETCATALOG_COMPILER_APPICON_NAME} + + MinimumOSVersion + ${IPHONEOS_DEPLOYMENT_TARGET} + + ITSAppUsesNonExemptEncryption + + + LSRequiresIPhoneOS + + + NSHighResolutionCapable + + + UILaunchStoryboardName + AppLaunchScreen + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ee1d75a6875..3064838b79c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -45,8 +45,9 @@ add_subdirectory(Camera) add_qgc_test(QGCCameraManagerTest) add_subdirectory(Comms) -add_qgc_test(QGCSerialPortInfoTest) - +if(NOT QGC_NO_SERIAL_LINK) + add_qgc_test(QGCSerialPortInfoTest) +endif() add_subdirectory(FactSystem) add_qgc_test(FactSystemTestGeneric) add_qgc_test(FactSystemTestPX4) diff --git a/test/Comms/CMakeLists.txt b/test/Comms/CMakeLists.txt index c296cce6acc..6cb25b40946 100644 --- a/test/Comms/CMakeLists.txt +++ b/test/Comms/CMakeLists.txt @@ -1,9 +1,14 @@ find_package(Qt6 REQUIRED COMPONENTS Core Qml Test) -qt_add_library(CommsTest STATIC - QGCSerialPortInfoTest.cc - QGCSerialPortInfoTest.h -) +qt_add_library(CommsTest STATIC) + +if(NOT QGC_NO_SERIAL_LINK) + target_sources(CommsTest + PRIVATE + QGCSerialPortInfoTest.cc + QGCSerialPortInfoTest.h + ) +endif() target_link_libraries(CommsTest PRIVATE diff --git a/test/UnitTestList.cc b/test/UnitTestList.cc index 22203eefd82..e5df9c8a7b0 100644 --- a/test/UnitTestList.cc +++ b/test/UnitTestList.cc @@ -32,7 +32,9 @@ #include "QGCCameraManagerTest.h" // Comms +#ifndef NO_SERIAL_LINK #include "QGCSerialPortInfoTest.h" +#endif // FactSystem #include "FactSystemTestGeneric.h" @@ -134,8 +136,10 @@ int runTests(bool stress, QStringView unitTestOptions) // Camera UT_REGISTER_TEST(QGCCameraManagerTest) - // Comms - UT_REGISTER_TEST(QGCSerialPortInfoTest) + // Comms +#ifndef NO_SERIAL_LINK + UT_REGISTER_TEST(QGCSerialPortInfoTest) +#endif // FactSystem UT_REGISTER_TEST(FactSystemTestGeneric)