Skip to content

Commit a81bbc6

Browse files
committed
Port to CMake + modern Qt
1 parent 02be8f2 commit a81bbc6

File tree

14 files changed

+346
-822
lines changed

14 files changed

+346
-822
lines changed

.appveyor.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 1.13.0.{build}
2+
pull_requests:
3+
do_not_increment_build_number: true
4+
shallow_clone: true
5+
environment:
6+
lsltag: 1.13.0
7+
lslversion: 1.13.0
8+
LSLDIST_URL: "https://github.com/sccn/liblsl/releases/download"
9+
CMakeArgs: ""
10+
matrix:
11+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
12+
QTCOMPILER: msvc2017_64
13+
QTVER: 5.13
14+
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1804
15+
DEPLOYNAME: Linux64-bionic
16+
install:
17+
- cmd: appveyor DownloadFile %LSLDIST_URL%/%lsltag%/liblsl-%lslversion%-Win64.zip -FileName liblsl_x64.zip
18+
- cmd: 7z x liblsl_x64.zip -oLSL
19+
- sh: wget ${LSLDIST_URL}/${lsltag}/liblsl-${lslversion}-${DEPLOYNAME}.deb -O lsl.deb
20+
- sh: sudo dpkg -i lsl.deb
21+
- sh: sudo apt update && sudo apt install -y qtbase5-dev
22+
build_script:
23+
- cmd: cmake -S . -B build -DQt5_DIR=C:/Qt/%QTVER%/%QTCOMPILER%/lib/cmake/Qt5 -DLSL_INSTALL_ROOT=LSL/ %CMakeArgs% -A x64
24+
- sh: cmake -S . -B build -DLSL_UNIXFOLDERS=1 -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=1 ${CMakeArgs}
25+
- cmake --build build --config Release -j --target package
26+
artifacts:
27+
- path: 'build/*.deb'
28+
- path: 'build/*.tar.*'
29+
- path: 'build/*.7z'

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ui_*.h
2+
/build*/
3+
/CMakeLists.txt.user
4+
/CMakeLists.json
5+
/.vs/
6+
/CMakeSettings.json
7+
/out/
8+
.DS_Store

CMakeLists.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
3+
project(SerialPort
4+
LANGUAGES CXX
5+
VERSION 1.13.0
6+
)
7+
8+
# also look for CMake modules in the cmake subfolder
9+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
10+
11+
# Find an installed liblsl in paths set by the user (LSL_INSTALL_ROOT)
12+
# and some default paths
13+
find_package(LSL REQUIRED
14+
HINTS ${LSL_INSTALL_ROOT}
15+
"${CMAKE_CURRENT_LIST_DIR}/../../LSL/liblsl/build/install"
16+
"${CMAKE_CURRENT_LIST_DIR}/../../LSL/liblsl/out/install/x64-Release"
17+
PATH_SUFFIXES share/LSL)
18+
get_filename_component(LSL_PATH ${LSL_CONFIG} DIRECTORY)
19+
message(STATUS "Found LSL lib in ${LSL_PATH}")
20+
LSLAPP_Setup_Boilerplate()
21+
22+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
23+
set(CMAKE_AUTOMOC ON)
24+
set(CMAKE_AUTOUIC ON)
25+
set(CMAKE_AUTORCC ON)
26+
27+
find_package(Qt5 REQUIRED COMPONENTS Widgets)
28+
29+
find_package(Threads REQUIRED)
30+
31+
add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
32+
main.cpp
33+
mainwindow.cpp
34+
mainwindow.hpp
35+
mainwindow.ui
36+
)
37+
38+
target_link_libraries(${PROJECT_NAME}
39+
PRIVATE
40+
Qt5::Widgets
41+
Threads::Threads
42+
LSL::lsl
43+
)
44+
45+
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
46+
47+
installLSLApp(${PROJECT_NAME})
48+
installLSLAuxFiles(${PROJECT_NAME}
49+
${PROJECT_NAME}.cfg
50+
)
51+
LSLGenerateCPackConfig()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The program reads a byte stream from a given COM port and emits it as an LSL str
44

55
# Usage
66
* Start the SerialPort app. You should see a window like the following.
7-
> ![serialport.png](screenshotsserialport.png)
7+
> ![serialport.png](serialport.png)
88
99
* Make sure that your device is plugged in and that you know its COM port (you can usually check this in the Device Manage).
1010

@@ -14,4 +14,4 @@ The program reads a byte stream from a given COM port and emits it as an LSL str
1414

1515
* Click the "Link" button. If all goes well you should now have a stream on your lab network that has the name that you entered under Stream Name and type "Raw". Note that you cannot close the app while it is linked.
1616

17-
* For subsequent uses you can save the settings in the GUI via File / Save Configuration. If the app is frequently used with different settings you might can also make a shortcut on the desktop that points to the app and appends to the Target field the snippet `-c name_of_config.cfg`.
17+
* For subsequent uses you can save the settings in the GUI via File / Save Configuration. If the app is frequently used with different settings you might can also make a shortcut on the desktop that points to the app and appends to the Target field the snippet `name_of_config.cfg`.
File renamed without changes.

SerialPort.sln

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

0 commit comments

Comments
 (0)