-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix package config The install config has been simplified. The definitions are placed in the `dsplib/defs.h` file generated by cmake. This solves the problem with installing and linking the `float32` version of the package via `find_package()'. * Fix tests. Add `OnePlan` class for nfft=1.
- Loading branch information
Showing
12 changed files
with
106 additions
and
87 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
#pragma once | ||
|
||
#cmakedefine DSPLIB_NO_EXCEPTIONS | ||
#cmakedefine DSPLIB_USE_FLOAT32 | ||
|
||
#define DSPLIB_VERSION "@CMAKE_PROJECT_VERSION@" | ||
#define DSPLIB_MAJOR_VERSION @CMAKE_PROJECT_VERSION_MAJOR@ | ||
#define DSPLIB_MINOR_VERSION @CMAKE_PROJECT_VERSION_MINOR@ | ||
#define DSPLIB_PATCH_VERSION @CMAKE_PROJECT_VERSION_PATCH@ |
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
from conan import ConanFile | ||
from conans.tools import load | ||
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout | ||
import re | ||
|
||
|
||
def get_version(): | ||
try: | ||
content = load("CMakeLists.txt") | ||
with open("CMakeLists.txt", "r", encoding="utf-8", newline="") as handle: | ||
content = handle.read() | ||
version = re.search("project\(dsplib .* VERSION (.*)\)", content).group(1) | ||
return version.strip() | ||
except Exception as e: | ||
return None | ||
|
||
|
||
class DsplibConan(ConanFile): | ||
name = "dsplib" | ||
version = get_version() | ||
|
@@ -19,11 +21,22 @@ class DsplibConan(ConanFile): | |
author = "Vitaly Yulis ([email protected])" | ||
url = "https://github.com/vitalsong/dsplib" | ||
description = "C++ DSP library for MATLAB/Octave similar programming" | ||
topics = ("dsp", "matlab", "c++17", "sound", "radio") | ||
topics = ("dsp", "matlab", "c++17", "audio") | ||
|
||
settings = "os", "compiler", "build_type", "arch" | ||
options = {"shared": [True, False], "fPIC": [True, False], "float32": [True, False]} | ||
default_options = {"shared": False, "fPIC": True, "float32": False} | ||
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
"float32": [True, False], | ||
"noexcept": [True, False], | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"float32": False, | ||
"noexcept": False, | ||
} | ||
generators = "CMakeDeps" | ||
|
||
exports_sources = "cmake/*", "CMakeLists.txt", "lib/*", "include/*" | ||
|
||
|
@@ -36,14 +49,15 @@ def layout(self): | |
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
if self.options.float32: | ||
tc.variables["DSPLIB_USE_FLOAT32"] = "ON" | ||
if self.options.noexcept: | ||
tc.variables["DSPLIB_NO_EXCEPTIONS"] = "ON" | ||
tc.generate() | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure(variables = { | ||
"BUILD_SHARED_LIBS": "ON" if self.options.shared else "OFF", | ||
"DSPLIB_USE_FLOAT32": "ON" if self.options.float32 else "OFF", | ||
"CMAKE_BUILD_TYPE": self.settings.build_type}) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def package(self): | ||
|
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#pragma once | ||
|
||
#include <dsplib/defs.h> | ||
|
||
#ifdef DSPLIB_NO_EXCEPTIONS | ||
|
||
#include <iostream> | ||
|
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
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
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
Oops, something went wrong.