conanfile.py 2 KB
Newer Older
1
2
3
4
5
from conans import CMake, ConanFile, tools


class Pylene(ConanFile):
    name = "pylene"
6
    version = "head"
7
8
9
10
11
    license = "https://gitlab.lrde.epita.fr/olena/pylene/blob/dev/LICENSE"
    url = "https://gitlab.lrde.epita.fr/olena/pylene"
    description = "C++ Generic Image Processing Library."
    settings = "os", "compiler", "arch", "build_type", "cppstd"
    options = {"gtest": [True, False], "benchmark": [True, False], "freeimage": [
Michaël Roynard's avatar
Michaël Roynard committed
12
        True, False], "boost": [True, False],
Michaël Roynard's avatar
Michaël Roynard committed
13
14
               # TO REMOVE once docker image is fixed with the buildfarm profile updated
               "boost_program_options": [True, False]}
Michaël Roynard's avatar
Michaël Roynard committed
15
16
17
    default_options = ("gtest=False", "benchmark=False", "freeimage=False", "boost=False",
                       # TO REMOVE once docker image is fixed with the buildfarm profile updated
                       "boost_program_options=False")
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    generators = "cmake_paths"
    exports_sources = ["pylene/*", "cmake/*", "CMakeLists.txt", "LICENSE"]

    def get_cmake_config(self):
        cmake = CMake(self)
        cmake.definitions["PYLENE_BUILD_LIBS_ONLY"] = "YES"
        cmake.configure()
        return cmake

    def build(self):
        cmake = self.get_cmake_config()
        cmake.build()

    def package(self):
        cmake = self.get_cmake_config()
        cmake.install()
        self.copy("*", dst="", src="cmake")

    def package_info(self):
        if self.settings.compiler in ["gcc", "clang"]:
            self.cpp_info.cppflags = ["-std=c++17"]

    # Requirements part of the INTERFACE
    def requirements(self):
42
43
        self.requires("range-v3/0.5.0@lrde/patched")
        self.requires("cmcstl2/head@dlrde/testing")
44
45
46
47
48
49
50
51

        if self.options.freeimage:
            self.requires("freeimage/3.18.0@dutiona/stable")

        if self.options.gtest:
            self.requires("gtest/1.8.1@bincrafters/stable")

        if self.options.benchmark:
52
            self.requires("benchmark/head@dutiona/stable")
Michaël Roynard's avatar
Michaël Roynard committed
53
54
55

        if self.options.boost:
            self.requires("boost/1.69.0@conan/stable")