-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a new executable 'simulator' for application testing
- Loading branch information
Showing
18 changed files
with
1,745 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: build ubuntu latest | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- simulator | ||
push: | ||
branches: | ||
- simulator | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Update package list | ||
run: sudo apt-get update | ||
- name: Install software-properties-common | ||
run: sudo apt-get install software-properties-common | ||
- name: Install clang compiler and tools | ||
run: | | ||
sudo apt-get -y install clang ccache cmake pkg-config curl wget | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install -y \ | ||
libc++-dev libomp-dev liblzma-dev libxml2-dev libmarisa-dev \ | ||
libqt5remoteobjects5-bin libqt5quickwidgets5 \ | ||
libqt5quickcontrols2-5 libqt5qmlmodels5 libqt5qml5 \ | ||
libqt5positioning5 libqt5dbus5 libqt5remoteobjects5-dev \ | ||
libqt5svg5-dev libqt5sensors5-dev \ | ||
qttools5-dev qttools5-dev-tools qtdeclarative5-dev \ | ||
qtquickcontrols2-5-dev qtmultimedia5-dev qtpositioning5-dev \ | ||
qml-module-qtquick2 qml-module-qtgraphicaleffects \ | ||
qml-module-qtquick-layouts qml-module-qtquick-controls2 \ | ||
qml-module-qt-labs-settings \ | ||
libreadline-dev | ||
- name: Fetch submodules | ||
run: git submodule init && git submodule update | ||
- name: Configure build | ||
run: | | ||
cmake -B build \ | ||
-DBUILD_DEVICE_MOBILE=ON \ | ||
-DBUILD_SIMULATOR=ON -DBUILD_SIMULATOR_WITH_READLINE=ON \ | ||
-Wno-dev | ||
- name: Build | ||
run: cmake --build build | ||
- name: Install | ||
run: sudo cmake --install build | ||
|
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,74 @@ | ||
cmake_minimum_required(VERSION 3.8.2) | ||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
unset(CMAKE_IGNORE_PATH) | ||
|
||
set(OSMIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src) | ||
|
||
include_directories(BEFORE SYSTEM | ||
${PROJECT_BINARY_DIR} | ||
${OSMIN_SRC_DIR} | ||
${LIBOSMSCOUT_INCLUDE_DIRS} | ||
) | ||
|
||
option(BUILD_SIMULATOR_WITH_READLINE "Enable Readline support" ON) | ||
|
||
if(SIMULATOR_WITH_READLINE) | ||
find_package(Readline QUIET) | ||
if(READLINE_FOUND) | ||
include_directories(${Readline_INCLUDE_DIR}) | ||
add_definitions("-DHAVE_READLINE") | ||
endif() | ||
endif() | ||
|
||
set(simulator_SOURCES main.cpp | ||
simulatedcompass.cpp | ||
simulatedpositionsource.cpp | ||
simulatedsensorplugin.cpp | ||
commandline.cpp | ||
simulator.cpp | ||
gpxrunner.cpp | ||
${OSMIN_SRC_DIR}/converter.cpp | ||
${OSMIN_SRC_DIR}/csvparser.cpp | ||
${OSMIN_SRC_DIR}/gpxfilemodel.cpp | ||
${OSMIN_SRC_DIR}/tracker.cpp | ||
${OSMIN_SRC_DIR}/service.cpp | ||
${OSMIN_SRC_DIR}/signalhandler.cpp | ||
${OSMIN_SRC_DIR}/utils.cpp | ||
${OSMIN_SRC_DIR}/compass/genericcompass.cpp | ||
${OSMIN_SRC_DIR}/compass/plugin.cpp | ||
) | ||
set(simulator_HEADERS | ||
commandline.h | ||
gpxrunner.h | ||
simulatedcompass.h | ||
simulatedpositionsource.h | ||
simulatedsensorplugin.h | ||
simulator.h | ||
simulatorbreaker.h | ||
${OSMIN_SRC_DIR}/converter.h | ||
${OSMIN_SRC_DIR}/locked.h | ||
${OSMIN_SRC_DIR}/gpxfilemodel.h | ||
${OSMIN_SRC_DIR}/tracker.h | ||
${OSMIN_SRC_DIR}/service.h | ||
${OSMIN_SRC_DIR}/signalhandler.h | ||
) | ||
|
||
qt5_generate_repc(simulator_SOURCES | ||
${OSMIN_SRC_DIR}/servicemessenger.rep SOURCE) | ||
qt5_generate_repc(simulator_SOURCES | ||
${OSMIN_SRC_DIR}/servicemessenger.rep REPLICA) | ||
|
||
add_executable(simulator ${simulator_SOURCES} ${simulator_HEADERS}) | ||
|
||
target_link_libraries(simulator PRIVATE | ||
${LIBOSMSCOUT_LIBRARIES} | ||
Qt5::RemoteObjects Qt5::Positioning | ||
Qt5::Sensors Qt5::Core | ||
) | ||
|
||
if(READLINE_FOUND) | ||
target_link_libraries(simulator PRIVATE ${Readline_LIBRARY}) | ||
endif() | ||
|
||
set_target_properties(simulator PROPERTIES OUTPUT_NAME "osmin-simulator") |
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,47 @@ | ||
# - Try to find readline include dirs and libraries | ||
# | ||
# Usage of this module as follows: | ||
# | ||
# find_package(Readline) | ||
# | ||
# Variables used by this module, they can change the default behaviour and need | ||
# to be set before calling find_package: | ||
# | ||
# Readline_ROOT_DIR Set this variable to the root installation of | ||
# readline if the module has problems finding the | ||
# proper installation path. | ||
# | ||
# Variables defined by this module: | ||
# | ||
# READLINE_FOUND System has readline, include and lib dirs found | ||
# Readline_INCLUDE_DIR The readline include directories. | ||
# Readline_LIBRARY The readline library. | ||
|
||
find_path(Readline_ROOT_DIR | ||
NAMES include/readline/readline.h | ||
) | ||
|
||
find_path(Readline_INCLUDE_DIR | ||
NAMES readline/readline.h | ||
HINTS ${Readline_ROOT_DIR}/include | ||
) | ||
|
||
find_library(Readline_LIBRARY | ||
NAMES readline | ||
HINTS ${Readline_ROOT_DIR}/lib | ||
) | ||
|
||
if(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) | ||
set(READLINE_FOUND TRUE) | ||
else(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) | ||
FIND_LIBRARY(Readline_LIBRARY NAMES readline) | ||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY ) | ||
MARK_AS_ADVANCED(Readline_INCLUDE_DIR Readline_LIBRARY) | ||
endif(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) | ||
|
||
mark_as_advanced( | ||
Readline_ROOT_DIR | ||
Readline_INCLUDE_DIR | ||
Readline_LIBRARY | ||
) |
Oops, something went wrong.