Skip to content

Commit f384e89

Browse files
authored
Merge pull request #1 from jgeudens/AppImage
AppImage
2 parents 5d64e50 + 4d39fce commit f384e89

18 files changed

+292
-95
lines changed

.github/workflows/ccpp.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
# Triggered when code is pushed to any branch in a repository
4+
on: push
5+
6+
jobs:
7+
8+
linux:
9+
runs-on: ubuntu-20.04
10+
container: docker://jgeudens/qt-linux:5.15.2_build_1
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Update Modules and Build
15+
run: sh scripts/build_linux.sh
16+
17+
- name: Deploy
18+
run: sh scripts/deploy_linux.sh
19+
20+
- uses: actions/upload-artifact@v2
21+
with:
22+
name: modbussim-linux
23+
path: release/bin/linux/ModbusSim*.AppImage
24+
25+
windows:
26+
runs-on: windows-2019
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: Install Qt installer
32+
run: pip3 install aqtinstall
33+
34+
- name: Setup, build and deploy
35+
shell: cmd
36+
run: scripts/full_build_and_deploy_windows.bat ${{ github.workspace }}
37+
38+
- uses: actions/upload-artifact@v2
39+
with:
40+
name: modbussim-windows
41+
path: |
42+
release\bin\win\ModbusSim.zip

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.16)
22

3-
project(ModbusTestSlave
3+
project(modbussim
44
LANGUAGES CXX
5-
DESCRIPTION "Test module to test Modbus communication"
5+
DESCRIPTION "Modbus Slave Simulation"
66
VERSION 0.0.0
77
)
88

@@ -11,6 +11,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1111
set(CMAKE_CXX_STANDARD 11)
1212
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313

14+
# Tell CMake to run moc when necessary:
1415
set(CMAKE_AUTOUIC ON)
1516
set(CMAKE_AUTOMOC ON)
1617
set(CMAKE_AUTORCC ON)
@@ -27,40 +28,27 @@ find_package(Qt5 COMPONENTS
2728
REQUIRED
2829
)
2930

30-
set(QT_INCLUDES
31-
${Qt5Core_INCLUDE_DIRS}
32-
${Qt5Gui_INCLUDE_DIRS}
33-
${Qt5Widgets_INCLUDE_DIRS}
34-
${Qt5Xml_INCLUDE_DIRS}
35-
${Qt5Network_INCLUDE_DIRS}
36-
${Qt5SerialBus_INCLUDE_DIRS}
37-
)
38-
3931
set(QT_LIB
40-
Qt5::Core
41-
Qt5::Gui
42-
Qt5::Widgets
43-
Qt5::Xml
44-
Qt5::PrintSupport
45-
Qt5::Network
46-
Qt5::SerialBus
32+
Qt::Core
33+
Qt::Gui
34+
Qt::Widgets
35+
Qt::Xml
36+
Qt::PrintSupport
37+
Qt::Network
38+
Qt::SerialBus
4739
)
4840

49-
include_directories(
50-
${CMAKE_CURRENT_SOURCE_DIR}/src
51-
${CMAKE_CURRENT_SOURCE_DIR}/testslave
52-
53-
${QT_INCLUDES}
54-
)
41+
include_directories(SYSTEM ${QT_INCLUDES})
42+
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/testslave)
5543

5644
SET(APP_SRCS
5745
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
5846
${CMAKE_CURRENT_SOURCE_DIR}/src/mainwindow.cpp
5947
${CMAKE_CURRENT_SOURCE_DIR}/src/registerdatamodel.cpp
60-
)
6148

62-
SET(APP_UIS
6349
${CMAKE_CURRENT_SOURCE_DIR}/src/mainwindow.ui
50+
51+
${CMAKE_CURRENT_SOURCE_DIR}/src/app_icon.rc
6452
)
6553

6654
SET(TESTSLAVE_SRCS
@@ -73,13 +61,30 @@ set(GUI_TYPE "")
7361

7462
if(WIN32)
7563
set(GUI_TYPE WIN32)
76-
endif()
64+
set(target_dir "bin/win")
65+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
66+
set(target_dir "bin/linux")
67+
else()
68+
message(SEND_ERROR "You are on an unsupported platform! (Not Win or Unix)")
69+
endif(WIN32)
70+
71+
add_executable(${PROJECT_NAME} ${GUI_TYPE} ${APP_SRCS} ${TESTSLAVE_SRCS})
7772

78-
add_executable(${PROJECT_NAME} ${GUI_TYPE} ${APP_SRCS} ${APP_UIS} ${TESTSLAVE_SRCS})
73+
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${target_dir} )
7974

8075
target_link_libraries(${PROJECT_NAME} PRIVATE
76+
${SCOPESOURCE}
8177
${QT_LIB}
8278
)
8379

8480
# Reset GUI type to blank
8581
set(GUI_TYPE "")
82+
83+
# Do platform specific post target stuff
84+
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
85+
86+
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
87+
88+
elseif(WIN32)
89+
# not required
90+
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

appveyor.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

doc/build.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
4+
cmake -DCMAKE_PREFIX_PATH="/opt/Qt/5.15.1/gcc_64/lib/cmake/Qt5" ..
5+
6+
make -j8
7+
8+

misc/ModbusSim.desktop

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/xdg-open
2+
[Desktop Entry]
3+
Comment=ModbusSim - Simulation modbus slave
4+
Exec=modbussim
5+
GenericName=ModbusSim
6+
Icon=ModbusSim
7+
MimeType=
8+
Name=ModbusSim
9+
Terminal=false
10+
Type=Application
11+
Categories=Utility

misc/ModbusSim.png

5.52 KB
Loading

misc/icon/Icons8_flat_sim_card.svg

Lines changed: 76 additions & 0 deletions
Loading

misc/icon/LICENSE.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Source: https://commons.wikimedia.org/wiki/File:Icons8_flat_sim_card.svg
2+
3+
4+
Copyright © The author(s)
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.

misc/icon/ModbusSim.ico

33.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)