Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey1994 committed Sep 1, 2022
2 parents cf4907f + 97d018f commit c19299d
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Conan Package

on: [push, pull_request]

jobs:
ConanWindows:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
max-parallel: 4
matrix:
os: [windows-2019]

steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Get Conan
uses: turtlebrowser/get-conan@main
with:
version: 1.50.0
- name: Set Version
id: version
run: if ("tag" -eq $Env:GITHUB_REF_TYPE) { echo "::set-output name=version::$Env:GITHUB_REF_NAME" } else { echo "::set-output name=version::$Env:GITHUB_SHA" }
- name: Check Version
run: echo ${{ steps.version.outputs.version }}
- name: Set Path
run: |
echo %GITHUB_WORKSPACE%\tools>>%GITHUB_PATH%
echo %GITHUB_WORKSPACE%\installed64\lib>>%GITHUB_PATH%
echo %GITHUB_WORKSPACE%\installed32\lib>>%GITHUB_PATH%
shell: cmd
- name: Run Conan packaging
run: |
conan create . demo/testing
shell: cmd
env:
CONAN_CMAKE_SYSTEM_VERSION: 10.0.19041.0
62 changes: 62 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from conans import ConanFile, CMake


class BrainflowConan(ConanFile):
name = "brainflow"
version = "5.2.0"

# Optional metadata
license = "MIT"
author = "Andrey1994 [email protected]"
url = "<Package recipe repository url here, for issues about the package>"
description = "BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors"
topics = ("eeg", "bci", "neurotech")

# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {"libftdi": [True, False], "openmp": [True, False], "onnx": [True, False], "bluetooth": [True, False],
"ble": [True, False], "periphery": [True, False], "oymotion": [True, False],
"static_msvc_runtime": [True, False]}
default_options = {"libftdi": False, "openmp": False, "onnx": True, "bluetooth": True,
"ble": True, "periphery": False, "oymotion": False, "static_msvc_runtime": True}

# Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "src/*", "third_party/*", "cpp_package/build.cmake", "cpp_package/src/*", "cmake/*"

def config_options(self):
if self.settings.os == "Windows":
del self.options.libftdi
del self.options.periphery
else:
del self.options.oymotion
del self.options.msvc_runtime

def build(self):
cmake = CMake(self)
if self.settings.os != "Windows" and self.options.libftdi:
cmake.definitions["USE_LIBFTDI"] = "ON"
if self.options.openmp:
cmake.definitions["USE_OPENMP"] = "ON"
if self.options.onnx:
cmake.definitions["BUILD_ONNX"] = "ON"
if self.options.bluetooth:
cmake.definitions["BUILD_BLUETOOTH"] = "ON"
if self.options.ble:
cmake.definitions["BUILD_BLE"] = "ON"
if self.settings.os != "Windows" and self.options.periphery:
cmake.definitions["USE_PERIPHERY"] = "ON"
if self.settings.os == "Windows" and self.options.oymotion:
cmake.definitions["BUILD_OYMOTION_SDK"] = "ON"
if self.settings.os == "Windows" and self.options.static_msvc_runtime:
cmake.definitions["MSVC_RUNTIME"] = "static"
else:
cmake.definitions["MSVC_RUNTIME"] = "dynamic"
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.libs = ["brainflow"]

0 comments on commit c19299d

Please sign in to comment.