Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] Fix Windows Plugin Deployment and Fix TMSI Plugin Build Issues #963

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion doc/gh-pages/pages/documentation/scan_tmsi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ nav_order: 13
---
# TMSI

The MNE Scan TMSI plugin adds support for TMSI Refa amplifiers. The plugin is Windows only since the TMSI SDK ships for Windows operating systems. There are no additional steps needed to build the plugin. However, you need to make sure that the `TMSiSDK.dll` is present in `C:/Windows/System32/TMSiSDK.dll`. This is where the plugin will try to load the DLL from.
The TMSI plugin is only available on the Windows operating system; the TMSI SDK is only available for that platform. Currently the TMSI plugin is not available in the compiled binary releases of MNE-CPP. To get the plugin, it is necessary to build mne_scan from source while having the tmsi drivers installed (you need to make sure that the `TMSiSDK.dll` is present in `C:/Windows/System32/TMSiSDK.dll`.). Follow the instruction in the [build guide](../development/buildguide_cmake.md). If building with the command line script, add `tmsi` after the call, like so:

```
./tools/build_project.bat tmsi
```

If building in QtCreator or calling CMake manually, add `-DWITH_TMSI=ON` to your CMake step.

5 changes: 5 additions & 0 deletions src/applications/mne_analyze/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ if(WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
endif()

if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mne_scan_plugins)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mne_scan_plugins)
endif()

set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "")

Expand Down
5 changes: 5 additions & 0 deletions src/applications/mne_rt_server/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if(WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
endif()

if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mne_scan_plugins)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mne_scan_plugins)
endif()

set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "")

Expand Down
5 changes: 5 additions & 0 deletions src/applications/mne_scan/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if(WIN32)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
endif()

if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mne_scan_plugins)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mne_scan_plugins)
endif()

set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "")

Expand Down
3 changes: 2 additions & 1 deletion src/applications/mne_scan/plugins/tmsi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(HEADERS

set(UI
FormFiles/tmsisetup.ui
FormFiles/tmsimanualannotationwidget.ui
FormFiles/tmsimanualannotation.ui
FormFiles/tmsiimpedancewidget.ui
FormFiles/tmsisetupprojectwidget.ui
)
Expand Down Expand Up @@ -74,6 +74,7 @@ if(USE_FFTW)
endif()

target_include_directories(${PROJECT_NAME} PUBLIC ../)
target_include_directories(${PROJECT_NAME} PRIVATE .)

set(QT_REQUIRED_COMPONENT_LIBS ${QT_REQUIRED_COMPONENTS})
list(TRANSFORM QT_REQUIRED_COMPONENT_LIBS PREPEND "Qt${QT_VERSION_MAJOR}::")
Expand Down
2 changes: 1 addition & 1 deletion src/applications/mne_scan/plugins/tmsi/tmsi_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// PREPROCESSOR DEFINES
//=============================================================================================================

#if defined(TMSI_LIBRARY)
#if defined(SCAN_TMSI_PLUGIN)
# define TMSISHARED_EXPORT Q_DECL_EXPORT /**< Q_DECL_EXPORT must be added to the declarations of symbols used when compiling a shared library. */
#else
# define TMSISHARED_EXPORT Q_DECL_IMPORT /**< Q_DECL_IMPORT must be added to the declarations of symbols used when compiling a client that uses the shared library. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//=============================================================================================================
// INCLUDES
//=============================================================================================================
#include <tmsielectrodeitem.h>
#include "tmsielectrodeitem.h"

//=============================================================================================================
// QT INCLUDES
Expand Down
2 changes: 1 addition & 1 deletion src/applications/mne_scan/plugins/tmsi/tmsiimpedanceview.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// INCLUDES
//=============================================================================================================
#include <iostream>
#include <tmsielectrodeitem.h>
#include "tmsielectrodeitem.h"

//=============================================================================================================
// QT INCLUDES
Expand Down
4 changes: 4 additions & 0 deletions tools/build_project.bat
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
IF "%ExtraSection%"=="False" IF "%1"=="static" (
SET "CMakeConfigFlags=!CMakeConfigFlags! -DBUILD_SHARED_LIBS=OFF"
)
IF "%ExtraSection%"=="False" IF "%1"=="tmsi" (
SET "CMakeConfigFlags=!CMakeConfigFlags! -DWITH_TMSI=ON"
)
IF "%ExtraSection%"=="False" IF "%1"=="--" (
SET "ExtraSection=True"
)
Expand Down Expand Up @@ -205,6 +208,7 @@
ECHO [rebuild] - Only rebuild existing build-system configuration.
ECHO [static] - Build project statically. QT_DIR and Qt5_DIR must be set to
ECHO point to a static version of Qt.
ECHO [tmsi] - Build tmsi plugin for mne-scan (needs SDK installed)
ECHO [qt=\path\]- Use specified qt installation to build the project. This \path
ECHO must point to the directory containing the bin and lib folders
ECHO for the desired Qt version. ex. \some\path\to\Qt\5.15.2\msvc2019_64\
Expand Down