-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: initial build support for Ubuntu 22.04
fix MSVC build fix windows, start linux CI Remove dependency on boost fix qt dependency fix mqtt dependency Start CMake build Reenable pugixml fix missing mqttpp lib
- Loading branch information
1 parent
989027a
commit 3de5098
Showing
19 changed files
with
176 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CMake on Ubuntu | ||
|
||
on: [push] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally | ||
# well on Windows or Mac. You can convert this to a matrix build if you need | ||
# cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install dev requirements | ||
run: sudo apt install -yq libfmt-dev libpaho-mqtt-dev libpaho-mqttpp-dev qtbase5-dev | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=g++ -DBUILD_PLUGIN_WITH_TESTS=OFF | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --target all --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
find_path(Libuuid_INCLUDE_DIRS uuid/uuid.h) | ||
find_library(Libuuid_LIBRARIES uuid) | ||
|
||
if (Libuuid_LIBRARIES AND Libuuid_INCLUDE_DIRS) | ||
set(Libuuid_FOUND YES) | ||
if (NOT Libuuid_FIND_QUIETLY) | ||
message(STATUS "Found libuuid: ${Libuuid_LIBRARIES}") | ||
endif () | ||
else () | ||
if (Libuuid_FIND_REQUIRED) | ||
message(SEND_ERROR "Could NOT find libuuid") | ||
else () | ||
if (NOT Libuuid_FIND_QUIETLY) | ||
message(STATUS "Could NOT find libuuid") | ||
endif () | ||
endif () | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# find the Paho MQTT C library | ||
if(PAHO_WITH_SSL) | ||
set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3as) | ||
find_package(OpenSSL REQUIRED) | ||
else() | ||
set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) | ||
endif() | ||
|
||
# add suffix when using static Paho MQTT C library variant on Windows | ||
if(WIN32) | ||
if(PAHO_BUILD_STATIC) | ||
set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) | ||
endif() | ||
endif() | ||
|
||
find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) | ||
unset(_PAHO_MQTT_C_LIB_NAME) | ||
find_path(PAHO_MQTT_C_INCLUDE_DIRS NAMES MQTTAsync.h) | ||
|
||
add_library(PahoMqttC::PahoMqttC UNKNOWN IMPORTED) | ||
|
||
set_target_properties(PahoMqttC::PahoMqttC PROPERTIES | ||
IMPORTED_LOCATION "${PAHO_MQTT_C_LIBRARIES}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${PAHO_MQTT_C_INCLUDE_DIRS}" | ||
IMPORTED_LINK_INTERFACE_LANGUAGES "C") | ||
if(PAHO_WITH_SSL) | ||
set_target_properties(PahoMqttC::PahoMqttC PROPERTIES | ||
INTERFACE_COMPILE_DEFINITIONS "OPENSSL=1" | ||
INTERFACE_LINK_LIBRARIES "OpenSSL::SSL;OpenSSL::Crypto") | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PahoMqttC | ||
REQUIRED_VARS PAHO_MQTT_C_LIBRARIES PAHO_MQTT_C_INCLUDE_DIRS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
FetchContent_Declare( | ||
fmt | ||
GIT_REPOSITORY https://github.com/fmtlib/fmt.git | ||
) | ||
IF (WIN32) | ||
FetchContent_Declare( | ||
fmt | ||
GIT_REPOSITORY https://github.com/fmtlib/fmt.git | ||
) | ||
|
||
FetchContent_MakeAvailable(fmt) | ||
ELSE() | ||
find_package(fmt REQUIRED) | ||
ENDIF() | ||
|
||
FetchContent_MakeAvailable(fmt) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
set(PAHO_BUILD_SHARED OFF CACHE INTERNAL "") | ||
set(PAHO_BUILD_STATIC ON CACHE INTERNAL "") | ||
set(PAHO_ENABLE_TESTING OFF CACHE INTERNAL "") | ||
set(PAHO_BUILD_TESTS OFF CACHE INTERNAL "") | ||
set(PAHO_WITH_MQTT_C ON CACHE INTERNAL "") | ||
|
||
# | ||
# TODO Change to official paho.mqtt.cpp repository once patches to CMake build system have been accepted | ||
FetchContent_Declare( | ||
paho-mqttpp3-static | ||
GIT_REPOSITORY https://github.com/HpLightcorner/paho.mqtt.cpp.git | ||
GIT_TAG mqtt-c-submodule | ||
) | ||
IF (MSVC) | ||
message(STATUS "Setting up PAHO MQTT for Windows") | ||
set(PAHO_BUILD_SHARED OFF CACHE INTERNAL "") | ||
set(PAHO_BUILD_STATIC ON CACHE INTERNAL "") | ||
set(PAHO_ENABLE_TESTING OFF CACHE INTERNAL "") | ||
set(PAHO_BUILD_TESTS OFF CACHE INTERNAL "") | ||
set(PAHO_WITH_MQTT_C ON CACHE INTERNAL "") | ||
|
||
FetchContent_MakeAvailable(paho-mqttpp3-static) | ||
target_include_directories(${PROJECT_NAME} INTERFACE | ||
${paho-mqttpp3-static_SOURCE_DIR}/src | ||
) | ||
# | ||
# TODO Change to official paho.mqtt.cpp repository once patches to CMake build system have been accepted | ||
FetchContent_Declare( | ||
paho-mqttpp3-static | ||
GIT_REPOSITORY https://github.com/HpLightcorner/paho.mqtt.cpp.git | ||
GIT_TAG mqtt-c-submodule | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PUBLIC | ||
paho-mqttpp3-static | ||
) | ||
FetchContent_MakeAvailable(paho-mqttpp3-static) | ||
target_include_directories(${PROJECT_NAME} INTERFACE | ||
${paho-mqttpp3-static_SOURCE_DIR}/src | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PUBLIC | ||
paho-mqttpp3-static | ||
) | ||
ELSE() | ||
message(STATUS "Setting up PAHO MQTT for Linux") | ||
find_package(PahoMqttC REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC PahoMqttC::PahoMqttC) | ||
ENDIF() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
#include "resampling/StreamClock.h" | ||
|
||
// | ||
#include <cstdint> | ||
#include <optional> | ||
#include <vector> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#pragma once | ||
|
||
// | ||
#include <ctype.h> | ||
#include <cstdint> | ||
#include <memory> | ||
|
||
namespace plugin::mqtt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
#include "qml.rcc.h" | ||
|
||
// | ||
#include "fmt/core.h" | ||
#include <fmt/core.h> | ||
|
||
using namespace odk::framework; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.