Skip to content

Commit

Permalink
Work on CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Nov 28, 2024
1 parent b0c67a9 commit 54e3eb1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 38 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/builds_desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,35 @@ jobs:
with:
submodules: recursive

# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtconnectivity qtcharts qtpositioning

# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
run: |
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-dev libx11-xcb-dev libzstd-dev -y;
sudo apt-get install cmake ninja-build pkgconf libtool -y;
sudo apt-get install appstream -y;
# Setup env
- name: Setup env
run: |
cmake --version
# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtconnectivity qtcharts qtpositioning

# Build application
- name: Build application
run: |
cmake --version
cmake -B build/ -DCMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build/ --config Release
# Deploy application
- name: Deploy application
run: |
sudo rm /home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/gcc_64/plugins/position/libqtposition_nmea.so
sudo rm /home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/gcc_64/plugins/sqldrivers/libqsqlmimer.so
sudo rm /home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/gcc_64/plugins/sqldrivers/libqsqlmysql.so
sudo rm /home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/gcc_64/plugins/sqldrivers/libqsqlodbc.so
sudo rm /home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/gcc_64/plugins/sqldrivers/libqsqlpsql.so
sudo rm ${{env.QT_ROOT_DIR}}/plugins/position/libqtposition_nmea.so
sudo rm ${{env.QT_ROOT_DIR}}/plugins/sqldrivers/libqsqlmimer.so
sudo rm ${{env.QT_ROOT_DIR}}/plugins/sqldrivers/libqsqlmysql.so
sudo rm ${{env.QT_ROOT_DIR}}/plugins/sqldrivers/libqsqlodbc.so
sudo rm ${{env.QT_ROOT_DIR}}/plugins/sqldrivers/libqsqlpsql.so
./deploy_linux.sh -c -i -p
# Upload application ZIP
Expand Down Expand Up @@ -145,29 +141,25 @@ jobs:
with:
arch: x86_64

# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtconnectivity qtcharts qtpositioning
arch: 'win64_msvc2019_64'

# Install NSIS (already installed in 'windows-2022')
#- name: Install NSIS
# run: |
# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# scoop bucket add extras
# scoop install nsis

# Setup env
- name: Setup env
run: |
cmake --version
# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtconnectivity qtcharts qtpositioning
arch: 'win64_msvc2019_64'

# Build application
- name: Build application
run: |
cmake --version
cmake -B build/ -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles"
cd build/
nmake
Expand Down
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ qt_add_qml_module(${CMAKE_PROJECT_NAME}
qml/MobileApplication.qml
qml/MobileHeader.qml
qml/MobileDrawer.qml
qml/MobileExit.qml
qml/MobileMenu.qml
qml/MobilePermissions.qml
qml/MobileMenu.qml
qml/MobileExit.qml

qml/DesktopApplication.qml
qml/DesktopHeader.qml

qml/PlantBrowser.qml
qml/PlantScreen.qml
qml/ScreenAbout.qml
Expand All @@ -132,6 +134,7 @@ qt_add_qml_module(${CMAKE_PROJECT_NAME}
qml/DevicePlantSensorSettings.qml
qml/DeviceThermometer.qml
qml/DeviceEnvironmental.qml

qml/widgets/DeviceWidget.qml
qml/widgets/DeviceNearbyWidget.qml
qml/widgets/JournalWidget.qml
Expand Down Expand Up @@ -246,7 +249,7 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE thirdparty/)
################################################################################

## Android
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
#QT_ANDROID_ABIS "armeabi-v7a;arm64-v8a;x86;x86_64"
#QT_ANDROID_BUILD_ALL_ABIS ON
Expand All @@ -273,8 +276,8 @@ if(APPLE)
endif()

## macOS
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
#set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/assets/macos/Info.plist")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/assets/macos/${CMAKE_PROJECT_NAME}.entitlements")
Expand All @@ -287,7 +290,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "14.0")
set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") # iPhone,iPad
set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/assets/ios/Info.plist")
set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_SOURCE_DIR}/assets/ios/Info.plist")

set(assets_catalog_path "${CMAKE_SOURCE_DIR}/assets/ios/Images.xcassets")
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${assets_catalog_path})
Expand Down Expand Up @@ -318,7 +321,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()

## Release build? Set "no debug" macros
if (CMAKE_BUILD_TYPE STREQUAL Release)
if(CMAKE_BUILD_TYPE STREQUAL Release)
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
NDEBUG
QT_NO_DEBUG
Expand All @@ -330,14 +333,14 @@ endif()

# Output?
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
#ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
#LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin"
)

# Output?
install(TARGETS ${CMAKE_PROJECT_NAME}
BUNDLE DESTINATION bin/
BUNDLE DESTINATION "${CMAKE_SOURCE_DIR}/bin"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

Expand Down

0 comments on commit 54e3eb1

Please sign in to comment.