packaged using conan create, added test_package
This commit is contained in:
parent
7fab978ae7
commit
59044298ea
9 changed files with 162 additions and 46 deletions
41
test_package/conanfile.py
Normal file
41
test_package/conanfile.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
import os.path
|
||||
from conan import ConanFile
|
||||
from conan.tools.meson import Meson
|
||||
from conan.tools.layout import basic_layout
|
||||
from conan.tools.build import can_run
|
||||
|
||||
class ElemmirePackageTestRecipe(ConanFile):
|
||||
# Optional metadata
|
||||
license = "CECILL-2.1/GPL-3.0"
|
||||
author = "The Aquila Consortium"
|
||||
url = "https://bitbucket.org/aquila-consortium/elemmire"
|
||||
description = "The Elemmire library"
|
||||
topics = ("cosmology", "data analysis")
|
||||
|
||||
# Binary configuration
|
||||
generators = "PkgConfigDeps", "MesonToolchain"
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
|
||||
# Location of sources
|
||||
exports_sources = "meson.build", "src/*"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
self.requires("fftw/[>=3.3.8]")
|
||||
|
||||
def build_requirements(self):
|
||||
self.tool_requires("meson/[~1.0]")
|
||||
|
||||
def build(self):
|
||||
meson = Meson(self)
|
||||
meson.configure()
|
||||
meson.build()
|
||||
|
||||
def layout(self):
|
||||
basic_layout(self)
|
||||
self.folders.build = os.path.join(self.folders.build, "meson")
|
||||
|
||||
def test(self):
|
||||
if can_run(self):
|
||||
cmd = os.path.join(self.cpp.build.bindir, "elemmire_test_package")
|
||||
self.run(cmd, env="conanrun")
|
6
test_package/meson.build
Normal file
6
test_package/meson.build
Normal file
|
@ -0,0 +1,6 @@
|
|||
project('Elemmire', 'c',
|
||||
version : '0.1',
|
||||
default_options : ['warning_level=3'])
|
||||
|
||||
fftw = dependency('fftw3', version : '>=3.3.8')
|
||||
exe = executable('elemmire_test_package', 'src/test_package.c', dependencies: fftw)
|
19
test_package/src/test_package.c
Normal file
19
test_package/src/test_package.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include <fftw3.h>
|
||||
|
||||
#define PROJECT_NAME "Elemmire"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if(argc != 1) {
|
||||
printf("%s takes no arguments.\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
printf("This is the test_package executable of project %s.\n", PROJECT_NAME);
|
||||
|
||||
#ifdef NDEBUG
|
||||
printf("%s has been compiled in 'Release' configuration.\n", PROJECT_NAME);
|
||||
#else
|
||||
printf("%s has been compiled in 'Debug' configuration.\n", PROJECT_NAME);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue