Skip to content

Commit

Permalink
CMake: MacOS Deployment Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Sep 17, 2024
1 parent 8ea10ee commit 26e70d1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:

jobs:
build:
runs-on: macos-13
runs-on: macos-latest

strategy:
matrix:
Expand Down Expand Up @@ -88,6 +88,7 @@ jobs:
working-directory: ${{ runner.temp }}/shadow_build_dir
run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
-DQGC_BUILD_TESTING=${{ matrix.BuildType == 'Debug' && 'ON' || 'OFF' }}
-DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }}

Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ if(QGC_DISABLE_APM_MAVLINK)
add_compile_definitions(NO_ARDUPILOT_DIALECT)
endif()

cmake_dependent_option(QGC_BUILD_DEPENDENCIES "Force Building of Dependencies." OFF "CMAKE_CROSSCOMPILING OR NOT CMAKE_OSX_ARCHITECTURES STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}" ON)

#######################################################
# Custom Build Configuration
#######################################################
Expand Down
2 changes: 1 addition & 1 deletion cmake/CreateMacDMG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ file(REMOVE_RECURSE package)
file(MAKE_DIRECTORY package)
file(COPY staging/QGroundControl.app DESTINATION package)
file(REMOVE /tmp/tmp.dmg)
execute_process(COMMAND hdiutil create /tmp/tmp.dmg -ov -volname QGroundControl -fs HFS+ -srcfolder package)
execute_process(COMMAND hdiutil create /tmp/tmp.dmg -ov -volname QGroundControl -fs APFS -srcfolder package)
execute_process(COMMAND hdiutil convert /tmp/tmp.dmg -format UDBZ -o package/QGroundControl.dmg)
file(REMOVE /tmp/tmp.dmg)
2 changes: 1 addition & 1 deletion src/Geo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_include_directories(Geo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

set(MINIMUM_GEOGRAPHICLIB_VERSION 2.3)

if(NOT CMAKE_CROSSCOMPILING)
if(NOT QGC_BUILD_DEPENDENCIES)
find_package(GeographicLib ${MINIMUM_GEOGRAPHICLIB_VERSION} COMPONENTS STATIC)
if(GeographicLib_FOUND)
message(STATUS "Found GeographicLib")
Expand Down
2 changes: 1 addition & 1 deletion src/Joystick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ qt_add_resources(Joystick "gamecontrollerdb.txt"

set(MINIMUM_SDL2_VERSION 2.30.0)

if(NOT CMAKE_CROSSCOMPILING)
if(NOT QGC_BUILD_DEPENDENCIES)
find_package(SDL2 ${MINIMUM_SDL2_VERSION})
if(SDL2_FOUND)
message(STATUS "Found JoystickSDL ${SDL2_VERSION_STRING}")
Expand Down

0 comments on commit 26e70d1

Please sign in to comment.